zam-core 0.3.11 → 0.3.13

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/index.d.ts CHANGED
@@ -509,8 +509,10 @@ declare function deleteCardForUser(db: Database, tokenId: string, userId: string
509
509
  * then by due_at ascending (oldest first).
510
510
  *
511
511
  * Ported from the PoC's due-tokens command.
512
+ *
513
+ * When `domain` is set, only due cards in that token domain are returned.
512
514
  */
513
- declare function getDueCards(db: Database, userId: string, now?: string): Promise<DueCard[]>;
515
+ declare function getDueCards(db: Database, userId: string, now?: string, domain?: string): Promise<DueCard[]>;
514
516
  /**
515
517
  * Get all blocked cards for a user.
516
518
  *
@@ -1235,6 +1237,79 @@ interface DiscoveryOptions {
1235
1237
  */
1236
1238
  declare function discoverSkills(sessionCommands: Map<string, CommandRecord[]>, options?: DiscoveryOptions): SkillProposal[];
1237
1239
 
1240
+ /**
1241
+ * Provider-neutral protocol for the native UI observer sidecar.
1242
+ *
1243
+ * Reports are evidence only. They must not update cards or FSRS state without
1244
+ * passing through confirmed session synthesis.
1245
+ */
1246
+ declare const UI_OBSERVATION_PROTOCOL_VERSION: 1;
1247
+ type UiObservationKind = "progress" | "step-completed" | "error" | "help-seeking" | "uncertain" | "privacy-pause" | "heartbeat";
1248
+ type UiActionType = "click" | "shortcut" | "typing" | "scroll" | "window-change";
1249
+ type UiEvidenceType = "uia" | "keyframe" | "clip" | "window";
1250
+ interface UiApplicationContext {
1251
+ processName: string;
1252
+ processId?: number;
1253
+ windowTitle?: string;
1254
+ }
1255
+ interface UiObservedAction {
1256
+ type: UiActionType;
1257
+ target?: string;
1258
+ result?: string;
1259
+ }
1260
+ interface UiEvidenceRef {
1261
+ type: UiEvidenceType;
1262
+ ref: string;
1263
+ redacted: boolean;
1264
+ }
1265
+ interface UiCandidateToken {
1266
+ slug: string;
1267
+ confidence: number;
1268
+ rationale: string;
1269
+ }
1270
+ interface UiObservationReport {
1271
+ version: typeof UI_OBSERVATION_PROTOCOL_VERSION;
1272
+ sessionId: string;
1273
+ sequence: number;
1274
+ observedFrom: string;
1275
+ observedTo: string;
1276
+ kind: UiObservationKind;
1277
+ application: UiApplicationContext;
1278
+ summary: string;
1279
+ actions: UiObservedAction[];
1280
+ evidence: UiEvidenceRef[];
1281
+ candidateTokens: UiCandidateToken[];
1282
+ confidence: number;
1283
+ }
1284
+ declare function isUiObservationReport(value: unknown): value is UiObservationReport;
1285
+ /** Parse report JSONL and skip malformed or unsupported records. */
1286
+ declare function parseUiObservationLog(jsonl: string): UiObservationReport[];
1287
+
1288
+ /**
1289
+ * Read and append observer-agent reports in ~/.zam/observer/<session-id>.reports.jsonl.
1290
+ */
1291
+
1292
+ declare function getUiObserverDir(): string;
1293
+ declare function getUiObservationPath(sessionId: string): string;
1294
+ declare function ensureUiObserverDir(): void;
1295
+ declare function uiObservationLogExists(sessionId: string): boolean;
1296
+ declare function readUiObservationLog(sessionId: string): UiObservationReport[];
1297
+ declare function appendUiObservationReport(report: UiObservationReport): void;
1298
+
1299
+ /**
1300
+ * Map persisted UI observer reports into session synthesis candidates.
1301
+ */
1302
+
1303
+ declare function buildUiSynthesisCandidates(reports: UiObservationReport[], tokens: Map<string, Token>, applied: Set<string>, minConfidence: SynthesisConfidence): {
1304
+ candidates: SessionSynthesisCandidate[];
1305
+ skippedLowConfidence: number;
1306
+ };
1307
+ declare function uiObservationTimeSpan(reports: UiObservationReport[]): {
1308
+ start: string;
1309
+ end: string;
1310
+ durationMs: number;
1311
+ } | null;
1312
+
1238
1313
  /**
1239
1314
  * Rating Evaluator
1240
1315
  *
@@ -1657,4 +1732,4 @@ declare function resolveAllBeliefPaths(db: Database): Promise<string[]>;
1657
1732
  */
1658
1733
  declare function resolveAllGoalPaths(db: Database): Promise<string[]>;
1659
1734
 
1660
- export { type ADOConfig, type ADOCredentials, type AgentSkill, type AnalysisResult, type ApplySessionSynthesisInput, type ApplySessionSynthesisResult, type BloomLevel$1 as BloomLevel, type Card, type CardDeletionImpact, type CardState$1 as CardState, type CascadeBlockResult, type CommandRecord, type CommandSequence, type ConnectionOptions, type CreateAgentSkillInput, type CreateGoalInput, type CreateReviewInput, type CreateSessionInput, type CreateTokenInput, type Credentials, DEFAULT_REVIEW_CONTEXT_MAX_CHARS, type Database, type DatabaseProvider, type DatabaseValue, type DeleteCardResult, type DeleteTokenResult, type DiscoveryOptions, type DomainCompetence, type EvaluateInput, type EvaluateResult, type ExecuteReviewActionInput, type ExecutionContext, type FSRSParameters, type Goal, type GoalFrontmatter, type GoalStatus, type GoalSummary, HOMEBREW_CASK, type ImportResult, type InstallChannel, type InstallConfig, type InstallMode, type InstallPlan, type InstallResult, type LocalLLMRunner, type LogStepInput, type MonitorEvent, type Neighborhood, type NeighborhoodToken, type ObservationRating, type PrepareSessionSynthesisInput, type Prerequisite, type PrerequisiteWithToken, type PromptInput, type Rating, type RecallPrompt, type RemoteDatabaseOptions, type RepoPaths, type ResolvedReference, type ReviewActionResult, type ReviewActionType, type ReviewContext, type ReviewLog, type ReviewQueue, type ReviewQueueItem, type ReviewQueueOptions, type RunResult, SNAPSHOT_VERSION, type SchedulingCard, type Session, type SessionStep, type SessionSummary, type SessionSynthesisCandidate, type SessionSynthesisEvidence, type SessionSynthesisPreview, type SessionSynthesisRecord, type SkillProposal, type SkillSource, type SnapshotManifest, type Statement, type SupportedLocale, type SymbiosisMode, type SynthesisConfidence, type SystemProfile, type Token, type TokenDeleteImpact, type TokenPattern, type TranslationKey, type TursoCredentials, type UnblockResult, type UpdateActionKind, type UpdateCardInput, type UpdateDecision, type UpdateTokenInput, type UserSetting, type UserStats, WINGET_PACKAGE_ID, type WorkItem, addPrerequisite, analyzeObservation, applySessionSynthesis, buildReviewQueue, cascadeBlock, clearADOCredentials, clearTursoCredentials, compareVersions, createAgentSkill, createFSRS, createGoal, createToken, decideUpdate, deleteCardForUser, deleteSetting, deleteToken, deprecateToken, detectSyncProvider, detectSystemLocale, discoverSkills, distributeGlobalSkills, endSession, ensureCard, ensureMonitorDir, evaluateRating, executeReviewAction, exportSnapshot, extractTasks, extractTokenRefs, fetchActiveWorkItems, findTokens, generateBashHooks, generateBashUnhooks, generateConceptFreeCue, generatePowerShellHooks, generatePowerShellUnhooks, generatePrompt, generateZshHooks, generateZshUnhooks, getADOCredentials, getAgentSkill, getAllSettings, getAllSettingsDetailed, getBlockedCards, getCard, getCardById, getCardDeletionImpact, getDefaultDbPath, getDependents, getDomainCompetence, getDueCards, getGoal, getGoalTree, getInstallChannel, getInstallMode, getMonitorDir, getMonitorLogStats, getMonitorPath, getPackageSkillPath, getPrerequisites, getRepoPaths, getReviewsForCard, getReviewsForUser, getSessionSummary, getSessionSynthesisRecords, getSetting, getSystemProfile, getTokenById, getTokenBySlug, getTokenDeleteImpact, getTokenNeighborhood, getTursoCredentials, getUserStats, hasCommand, importSnapshot, injectShellHooks, installFastFlowLM, installOllama, installOpenCode, interleave, listAgentSkills, listGoals, listTokens, loadADOConfig, loadCredentials, loadInstallConfig, logReview, logStep, matchesFilePath, monitorLogExists, normalizeLocale, normalizePath, openDatabase, openDatabaseWithSync, openRemoteDatabase, pairCommands, parseGoalFile, parseMonitorLog, parseSnapshot, planOpenCodeInstall, prepareLocalModel, prepareSessionSynthesis, readMonitorLog, resolveAllBeliefPaths, resolveAllGoalPaths, resolveReference, resolveRepoPath, resolveReviewContext, saveCredentials, saveInstallConfig, serializeGoal, setADOCredentials, setInstallChannel, setInstallMode, setSetting, setTursoCredentials, startSession, t, unblockReady, updateCard, updateGoalStatus, updateToken, verifySnapshot, wouldCreateCycle, writeMonitorEvent };
1735
+ export { type ADOConfig, type ADOCredentials, type AgentSkill, type AnalysisResult, type ApplySessionSynthesisInput, type ApplySessionSynthesisResult, type BloomLevel$1 as BloomLevel, type Card, type CardDeletionImpact, type CardState$1 as CardState, type CascadeBlockResult, type CommandRecord, type CommandSequence, type ConnectionOptions, type CreateAgentSkillInput, type CreateGoalInput, type CreateReviewInput, type CreateSessionInput, type CreateTokenInput, type Credentials, DEFAULT_REVIEW_CONTEXT_MAX_CHARS, type Database, type DatabaseProvider, type DatabaseValue, type DeleteCardResult, type DeleteTokenResult, type DiscoveryOptions, type DomainCompetence, type EvaluateInput, type EvaluateResult, type ExecuteReviewActionInput, type ExecutionContext, type FSRSParameters, type Goal, type GoalFrontmatter, type GoalStatus, type GoalSummary, HOMEBREW_CASK, type ImportResult, type InstallChannel, type InstallConfig, type InstallMode, type InstallPlan, type InstallResult, type LocalLLMRunner, type LogStepInput, type MonitorEvent, type Neighborhood, type NeighborhoodToken, type ObservationRating, type PrepareSessionSynthesisInput, type Prerequisite, type PrerequisiteWithToken, type PromptInput, type Rating, type RecallPrompt, type RemoteDatabaseOptions, type RepoPaths, type ResolvedReference, type ReviewActionResult, type ReviewActionType, type ReviewContext, type ReviewLog, type ReviewQueue, type ReviewQueueItem, type ReviewQueueOptions, type RunResult, SNAPSHOT_VERSION, type SchedulingCard, type Session, type SessionStep, type SessionSummary, type SessionSynthesisCandidate, type SessionSynthesisEvidence, type SessionSynthesisPreview, type SessionSynthesisRecord, type SkillProposal, type SkillSource, type SnapshotManifest, type Statement, type SupportedLocale, type SymbiosisMode, type SynthesisConfidence, type SystemProfile, type Token, type TokenDeleteImpact, type TokenPattern, type TranslationKey, type TursoCredentials, UI_OBSERVATION_PROTOCOL_VERSION, type UiActionType, type UiApplicationContext, type UiCandidateToken, type UiEvidenceRef, type UiEvidenceType, type UiObservationKind, type UiObservationReport, type UiObservedAction, type UnblockResult, type UpdateActionKind, type UpdateCardInput, type UpdateDecision, type UpdateTokenInput, type UserSetting, type UserStats, WINGET_PACKAGE_ID, type WorkItem, addPrerequisite, analyzeObservation, appendUiObservationReport, applySessionSynthesis, buildReviewQueue, buildUiSynthesisCandidates, cascadeBlock, clearADOCredentials, clearTursoCredentials, compareVersions, createAgentSkill, createFSRS, createGoal, createToken, decideUpdate, deleteCardForUser, deleteSetting, deleteToken, deprecateToken, detectSyncProvider, detectSystemLocale, discoverSkills, distributeGlobalSkills, endSession, ensureCard, ensureMonitorDir, ensureUiObserverDir, evaluateRating, executeReviewAction, exportSnapshot, extractTasks, extractTokenRefs, fetchActiveWorkItems, findTokens, generateBashHooks, generateBashUnhooks, generateConceptFreeCue, generatePowerShellHooks, generatePowerShellUnhooks, generatePrompt, generateZshHooks, generateZshUnhooks, getADOCredentials, getAgentSkill, getAllSettings, getAllSettingsDetailed, getBlockedCards, getCard, getCardById, getCardDeletionImpact, getDefaultDbPath, getDependents, getDomainCompetence, getDueCards, getGoal, getGoalTree, getInstallChannel, getInstallMode, getMonitorDir, getMonitorLogStats, getMonitorPath, getPackageSkillPath, getPrerequisites, getRepoPaths, getReviewsForCard, getReviewsForUser, getSessionSummary, getSessionSynthesisRecords, getSetting, getSystemProfile, getTokenById, getTokenBySlug, getTokenDeleteImpact, getTokenNeighborhood, getTursoCredentials, getUiObservationPath, getUiObserverDir, getUserStats, hasCommand, importSnapshot, injectShellHooks, installFastFlowLM, installOllama, installOpenCode, interleave, isUiObservationReport, listAgentSkills, listGoals, listTokens, loadADOConfig, loadCredentials, loadInstallConfig, logReview, logStep, matchesFilePath, monitorLogExists, normalizeLocale, normalizePath, openDatabase, openDatabaseWithSync, openRemoteDatabase, pairCommands, parseGoalFile, parseMonitorLog, parseSnapshot, parseUiObservationLog, planOpenCodeInstall, prepareLocalModel, prepareSessionSynthesis, readMonitorLog, readUiObservationLog, resolveAllBeliefPaths, resolveAllGoalPaths, resolveReference, resolveRepoPath, resolveReviewContext, saveCredentials, saveInstallConfig, serializeGoal, setADOCredentials, setInstallChannel, setInstallMode, setSetting, setTursoCredentials, startSession, t, uiObservationLogExists, uiObservationTimeSpan, unblockReady, updateCard, updateGoalStatus, updateToken, verifySnapshot, wouldCreateCycle, writeMonitorEvent };