Class: UserStore
Defined in: src/libs/user_store.ts:49
Constructors
Constructor
new UserStore(
dbFilePath):UserStore
Defined in: src/libs/user_store.ts:74
Parameters
dbFilePath
string
Returns
UserStore
Properties
DEFAULT_USER_AVATAR_URL
readonlystaticDEFAULT_USER_AVATAR_URL:"/_assets/images/jetienne-avatar.jpg"='/_assets/images/jetienne-avatar.jpg'
Defined in: src/libs/user_store.ts:63
DEFAULT_USER_DISPLAY_NAME
readonlystaticDEFAULT_USER_DISPLAY_NAME:"John Doe"='John Doe'
Defined in: src/libs/user_store.ts:61
Profile fields applied when the default user is first seeded by ensureDefaultUser. The password is intentionally well-known: it is a local-development convenience and matches the web client login and the Playwright auth setup.
DEFAULT_USER_EMAIL
readonlystaticDEFAULT_USER_EMAIL:"john@example.com"='john@example.com'
Defined in: src/libs/user_store.ts:55
Email of the seeded default user. Single source of truth for the CLI’s
--user-email default and the web’s job-worker session-log lookup, so the
identity a worker writes under and the one the web reads back never drift.
DEFAULT_USER_PASSWORD
readonlystaticDEFAULT_USER_PASSWORD:"weakPassword"='weakPassword'
Defined in: src/libs/user_store.ts:62
Methods
close()
close():
void
Defined in: src/libs/user_store.ts:91
Returns
void
createLocalUser()
createLocalUser(
__namedParameters):Promise<UserRecord>
Defined in: src/libs/user_store.ts:129
Parameters
__namedParameters
displayName
string
string
isAdmin?
boolean = false
password
string
Returns
Promise<UserRecord>
ensureDefaultUser()
ensureDefaultUser():
Promise<UserRecord>
Defined in: src/libs/user_store.ts:201
Seed the default local user on first call and return it on every call thereafter. Idempotent, so it is safe to invoke on each CLI launch to give a fresh checkout a usable identity without a manual seed step (issue #261).
If a concurrent process wins the insert race (the UNIQUE email constraint fires), the now-present record is fetched and returned rather than thrown.
Returns
Promise<UserRecord>
findByEmail()
findByEmail(
UserRecord|null
Defined in: src/libs/user_store.ts:114
Parameters
string
Returns
UserRecord | null
findById()
findById(
id):UserRecord|null
Defined in: src/libs/user_store.ts:105
Parameters
id
string
Returns
UserRecord | null
getSqliteDatabase()
getSqliteDatabase():
Database
Defined in: src/libs/user_store.ts:95
Returns
Database
upsertGoogleUser()
upsertGoogleUser(
googleProfile):UserRecord
Defined in: src/libs/user_store.ts:155
Parameters
googleProfile
displayName
string
emails?
object[]
id
string
photos?
object[]
Returns
verifyPassword()
verifyPassword(
userRecord,password):Promise<boolean>
Defined in: src/libs/user_store.ts:231
Parameters
userRecord
password
string
Returns
Promise<boolean>
defaultDbPath()
staticdefaultDbPath():string
Defined in: src/libs/user_store.ts:70
Absolute path to the shared user-store SQLite, resolved through
SkilletPaths.userStoreDb (the agent state dir’s .user_store.sqlite,
e.g. .skilled-agent/state/.user_store.sqlite in a checkout) regardless of
the caller’s cwd — so the webclient and CLI both open the exact same database
file.
Returns
string