dotmem 0.2.4 → 0.2.6
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/AGENTS.md +107 -0
- package/CHANGELOG.md +24 -4
- package/MEMORY.md +3 -1
- package/README.md +431 -457
- package/agent.cjs +114 -91
- package/agent.js +114 -91
- package/bin/dotmem-burst-stats.cjs +25 -0
- package/bin/dotmem-burst-stats.js +25 -0
- package/built-in-context.json +12 -12
- package/cli.cjs +249 -201
- package/cli.js +249 -201
- package/context/profiles/joy/ai.md +1 -1
- package/context/profiles/joy/behavior.md +16 -0
- package/context/profiles/joy/soul.md +1 -1
- package/global.cjs +114 -91
- package/global.js +114 -91
- package/index.cjs +142 -119
- package/index.js +142 -119
- package/llms.txt +30 -7
- package/mcp.cjs +157 -134
- package/mcp.js +157 -134
- package/package.json +1 -1
- package/types/fflate-browser.d.ts +1 -5
- package/types/global-types.d.ts +96 -307
- package/types/memory.d.ts +8 -39
- package/types/policy.d.ts +5 -25
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "dotmem",
|
|
3
3
|
"codeName": "dotmem",
|
|
4
|
-
"version": "0.2.
|
|
4
|
+
"version": "0.2.6",
|
|
5
5
|
"license": "MIT",
|
|
6
6
|
"type": "module",
|
|
7
7
|
"description": "The AI memory layer for agents and apps: acquired experience, discovery, context projection, continuity, and logic engine. Built on Memorio's state+store foundation.",
|
package/types/global-types.d.ts
CHANGED
|
@@ -210,53 +210,11 @@ interface CapturePayload {
|
|
|
210
210
|
}
|
|
211
211
|
}
|
|
212
212
|
|
|
213
|
-
type ShortIntent =
|
|
214
|
-
|
|
215
|
-
|
|
216
|
-
|
|
217
|
-
|
|
218
|
-
| 'update'
|
|
219
|
-
| 'patch'
|
|
220
|
-
| 'acquire'
|
|
221
|
-
| 'verify'
|
|
222
|
-
| 'important'
|
|
223
|
-
| 'avoid'
|
|
224
|
-
| 'prefer'
|
|
225
|
-
| 'warning'
|
|
226
|
-
| 'context'
|
|
227
|
-
| 'bootstrap'
|
|
228
|
-
| 'rules'
|
|
229
|
-
| 'policy'
|
|
230
|
-
| 'project'
|
|
231
|
-
| 'discover'
|
|
232
|
-
| 'inspect'
|
|
233
|
-
| 'dump'
|
|
234
|
-
| 'audit'
|
|
235
|
-
| 'projectAudit'
|
|
236
|
-
| 'health'
|
|
237
|
-
| 'doctor'
|
|
238
|
-
| 'repair'
|
|
239
|
-
| 'cleanup'
|
|
240
|
-
| 'relate'
|
|
241
|
-
| 'link'
|
|
242
|
-
| 'unlink'
|
|
243
|
-
| 'merge'
|
|
244
|
-
| 'configure'
|
|
245
|
-
| 'capabilities'
|
|
246
|
-
| 'seed'
|
|
247
|
-
| 'capture'
|
|
248
|
-
|
|
249
|
-
type ShortResultStatus =
|
|
250
|
-
| 'completed'
|
|
251
|
-
| 'failed'
|
|
252
|
-
| 'blocked'
|
|
253
|
-
| 'pending'
|
|
254
|
-
| 'skipped'
|
|
255
|
-
|
|
256
|
-
type IntentHandler = (
|
|
257
|
-
runtime: any,
|
|
258
|
-
payload: unknown
|
|
259
|
-
) => Promise<ShortResultBase>
|
|
213
|
+
type ShortIntent = 'note' | 'remember' | 'recall' | 'forget' | 'update' | 'patch' | 'acquire' | 'verify' | 'important' | 'avoid' | 'prefer' | 'warning' | 'context' | 'bootstrap' | 'rules' | 'policy' | 'project' | 'discover' | 'inspect' | 'dump' | 'audit' | 'projectAudit' | 'health' | 'doctor' | 'repair' | 'cleanup' | 'relate' | 'link' | 'unlink' | 'merge' | 'configure' | 'capabilities' | 'seed' | 'capture'
|
|
214
|
+
|
|
215
|
+
type ShortResultStatus = 'completed' | 'failed' | 'blocked' | 'pending' | 'skipped'
|
|
216
|
+
|
|
217
|
+
type IntentHandler = (runtime: any, payload: unknown) => Promise<ShortResultBase>
|
|
260
218
|
|
|
261
219
|
interface BuildProfileDocument {
|
|
262
220
|
readonly name: string
|
|
@@ -296,13 +254,18 @@ interface BuildConfig {
|
|
|
296
254
|
|
|
297
255
|
interface ContextRunOptions {
|
|
298
256
|
explain?: boolean
|
|
257
|
+
verbose?: boolean
|
|
299
258
|
json?: boolean
|
|
300
259
|
full?: boolean
|
|
260
|
+
compact?: boolean
|
|
261
|
+
summaryRestart?: boolean
|
|
301
262
|
claimsOnly?: boolean
|
|
302
263
|
limit?: number
|
|
303
264
|
/** Offset into the ranked candidate list for cursor-based pagination. */
|
|
304
265
|
offset?: number
|
|
305
266
|
format?: 'brief'
|
|
267
|
+
diagnostics?: boolean
|
|
268
|
+
debug?: boolean
|
|
306
269
|
/** Return the omission manifest instead of the rendered projection. */
|
|
307
270
|
manifest?: boolean
|
|
308
271
|
/** Expand one claim by id to its canonical record. */
|
|
@@ -406,36 +369,12 @@ interface DotMemEncryptedEnvelope {
|
|
|
406
369
|
|
|
407
370
|
interface SubtleCryptoLike {
|
|
408
371
|
digest(algorithm: string, data: Uint8Array): Promise<Uint8Array>
|
|
409
|
-
deriveKey(
|
|
410
|
-
|
|
411
|
-
baseKey: CryptoKey,
|
|
412
|
-
derivedKeyAlgorithm: AlikeAlgorithm,
|
|
413
|
-
extractable: boolean,
|
|
414
|
-
keyUsages: SubKeyUsages
|
|
415
|
-
): Promise<CryptoKey>
|
|
416
|
-
deriveBits(
|
|
417
|
-
algorithm: AlikeAlgorithm,
|
|
418
|
-
baseKey: CryptoKey,
|
|
419
|
-
length: number
|
|
420
|
-
): Promise<Uint8Array>
|
|
372
|
+
deriveKey(algorithm: AlikeAlgorithm, baseKey: CryptoKey, derivedKeyAlgorithm: AlikeAlgorithm, extractable: boolean, keyUsages: SubKeyUsages): Promise<CryptoKey>
|
|
373
|
+
deriveBits(algorithm: AlikeAlgorithm, baseKey: CryptoKey, length: number): Promise<Uint8Array>
|
|
421
374
|
exportKey(format: string, key: CryptoKey): Promise<Uint8Array>
|
|
422
|
-
importKey(
|
|
423
|
-
|
|
424
|
-
|
|
425
|
-
algorithm: AlikeAlgorithm,
|
|
426
|
-
extractable: boolean,
|
|
427
|
-
keyUsages: SubKeyUsages
|
|
428
|
-
): Promise<CryptoKey>
|
|
429
|
-
encrypt(
|
|
430
|
-
algorithm: AlikeAlgorithm,
|
|
431
|
-
key: CryptoKey,
|
|
432
|
-
data: Uint8Array
|
|
433
|
-
): Promise<Uint8Array>
|
|
434
|
-
decrypt(
|
|
435
|
-
algorithm: AlikeAlgorithm,
|
|
436
|
-
key: CryptoKey,
|
|
437
|
-
data: Uint8Array
|
|
438
|
-
): Promise<Uint8Array>
|
|
375
|
+
importKey(format: string, keyData: Uint8Array, algorithm: AlikeAlgorithm, extractable: boolean, keyUsages: SubKeyUsages): Promise<CryptoKey>
|
|
376
|
+
encrypt(algorithm: AlikeAlgorithm, key: CryptoKey, data: Uint8Array): Promise<Uint8Array>
|
|
377
|
+
decrypt(algorithm: AlikeAlgorithm, key: CryptoKey, data: Uint8Array): Promise<Uint8Array>
|
|
439
378
|
}
|
|
440
379
|
|
|
441
380
|
type SubKeyUsages = readonly ['encrypt', 'decrypt'] | readonly ['deriveKey'] | readonly ['deriveBits']
|
|
@@ -494,54 +433,55 @@ interface ContextRunOptions {
|
|
|
494
433
|
/** With `explain`, return the structured explanation model instead of rendered text. */
|
|
495
434
|
json?: boolean
|
|
496
435
|
/**
|
|
497
|
-
|
|
498
|
-
|
|
499
|
-
|
|
500
|
-
|
|
501
|
-
|
|
502
|
-
|
|
503
|
-
|
|
436
|
+
* Explicit current HI identity supplied by the runtime (the operator layer).
|
|
437
|
+
*
|
|
438
|
+
* This is the only channel through which a current USER_IDENTITY may enter
|
|
439
|
+
* the projection. An ordinary memory
|
|
440
|
+
* claim named `user-name` never asserts current identity; it remains
|
|
441
|
+
* historical evidence in the store.
|
|
442
|
+
*/
|
|
504
443
|
hiIdentity?: string
|
|
505
444
|
/**
|
|
506
|
-
|
|
507
|
-
|
|
508
|
-
|
|
509
|
-
|
|
510
|
-
|
|
445
|
+
* Explicit current HI assignment for the AGENT identity (the operator layer).
|
|
446
|
+
*
|
|
447
|
+
* When present it wins over the canonical profile default; when absent the
|
|
448
|
+
* resolver uses the profile. Memory and context never assign it.
|
|
449
|
+
*/
|
|
511
450
|
agentIdentity?: string
|
|
512
451
|
/**
|
|
513
|
-
|
|
514
|
-
|
|
515
|
-
|
|
516
|
-
|
|
452
|
+
* Scoped, temporary overlays for this run. Overlays may
|
|
453
|
+
* influence behavior but never identity, invariants, or authority, and they
|
|
454
|
+
* are never persisted.
|
|
455
|
+
*/
|
|
517
456
|
overlays?: readonly unknown[]
|
|
518
457
|
/**
|
|
519
|
-
|
|
520
|
-
|
|
521
|
-
|
|
522
|
-
|
|
523
|
-
|
|
524
|
-
|
|
525
|
-
|
|
526
|
-
|
|
458
|
+
* A verified carrier handshake session record.
|
|
459
|
+
*
|
|
460
|
+
* The CLI activation path is handshake-gated: `npx dotmem` projects the
|
|
461
|
+
* identity channel only for a carrier that demonstrated the minimal
|
|
462
|
+
* identity/authority separation contract. Programmatic callers may pass a
|
|
463
|
+
* valid record here. The record is session state, never authority: it
|
|
464
|
+
* describes the carrier evaluation, it does not grant anything.
|
|
465
|
+
*/
|
|
527
466
|
handshake?: HandshakeSessionRecord
|
|
528
467
|
/**
|
|
529
|
-
|
|
530
|
-
|
|
531
|
-
|
|
532
|
-
|
|
468
|
+
* Bypass the session-start projection ceiling (default 3000 characters) and
|
|
469
|
+
* the candidate cap, returning the complete projection. CLI:
|
|
470
|
+
* `dotmem context "<situation>" --full`. Read-only: never persisted.
|
|
471
|
+
*/
|
|
533
472
|
full?: boolean
|
|
473
|
+
summaryRestart?: boolean
|
|
534
474
|
/**
|
|
535
|
-
|
|
536
|
-
|
|
537
|
-
|
|
538
|
-
|
|
539
|
-
|
|
540
|
-
|
|
541
|
-
|
|
542
|
-
|
|
543
|
-
|
|
544
|
-
|
|
475
|
+
* Omit the trusted identity channel and all auxiliary rendering (index,
|
|
476
|
+
* size disclosure, personality anchor, exemplars), returning only the
|
|
477
|
+
* memory-context envelope (`DOTMEM_CONTEXT_V1` and the candidate claims).
|
|
478
|
+
* Default behavior (full projection) is unchanged for backward compatibility.
|
|
479
|
+
* CLI: `dotmem context "<situation>" --claims-only`.
|
|
480
|
+
*
|
|
481
|
+
* The identity channel is never withheld from an unbound carrier: the
|
|
482
|
+
* activation gate above already enforces fail-closed, and this flag only
|
|
483
|
+
* affects the payload of an already-authorized projection.
|
|
484
|
+
*/
|
|
545
485
|
claimsOnly?: boolean
|
|
546
486
|
/**
|
|
547
487
|
* Cap the number of candidate claims returned, best first.
|
|
@@ -555,9 +495,9 @@ interface ContextRunOptions {
|
|
|
555
495
|
*/
|
|
556
496
|
offset?: number
|
|
557
497
|
/**
|
|
558
|
-
|
|
559
|
-
|
|
560
|
-
|
|
498
|
+
* Filter to brief one-line-per-claim output format.
|
|
499
|
+
* CLI: `dotmem context "<situation>" --format brief`.
|
|
500
|
+
*/
|
|
561
501
|
format?: 'brief'
|
|
562
502
|
/**
|
|
563
503
|
* Return the omission manifest as JSON instead of the rendered projection.
|
|
@@ -652,16 +592,9 @@ interface EpisodeClaim {
|
|
|
652
592
|
|
|
653
593
|
type ConvergenceStatus = 'continue' | 'stop'
|
|
654
594
|
|
|
655
|
-
type LearningEvent =
|
|
656
|
-
| 'corrected-error'
|
|
657
|
-
| 'disproved-assumption'
|
|
658
|
-
| 'compensated-success'
|
|
659
|
-
| 'repeated-non-convergence'
|
|
595
|
+
type LearningEvent = 'corrected-error' | 'disproved-assumption' | 'compensated-success' | 'repeated-non-convergence'
|
|
660
596
|
|
|
661
|
-
type ExplicitProfileRequest =
|
|
662
|
-
| { readonly kind: 'canonical'; readonly id: string }
|
|
663
|
-
| { readonly kind: 'unknown'; readonly id: string }
|
|
664
|
-
| null
|
|
597
|
+
type ExplicitProfileRequest = { readonly kind: 'canonical'; readonly id: string } | { readonly kind: 'unknown'; readonly id: string } | null
|
|
665
598
|
|
|
666
599
|
interface DotMemProfileDocument {
|
|
667
600
|
readonly name: string
|
|
@@ -913,20 +846,9 @@ interface RunAuthorityRecoveryInput {
|
|
|
913
846
|
readonly handshakeRerunState?: 'COMPATIBLE' | 'LIMITED' | 'INCOMPATIBLE'
|
|
914
847
|
}
|
|
915
848
|
|
|
916
|
-
type RoleMapField =
|
|
917
|
-
| 'HOST'
|
|
918
|
-
| 'EXECUTOR'
|
|
919
|
-
| 'OPERATIONAL_ROLE'
|
|
920
|
-
| 'USER'
|
|
921
|
-
| 'HI_AUTHORITY'
|
|
922
|
-
| 'CONVERSATIONAL_PROFILE'
|
|
849
|
+
type RoleMapField = 'HOST' | 'EXECUTOR' | 'OPERATIONAL_ROLE' | 'USER' | 'HI_AUTHORITY' | 'CONVERSATIONAL_PROFILE'
|
|
923
850
|
|
|
924
|
-
type AuthorityDriftPattern =
|
|
925
|
-
| 'claims-hi-authority'
|
|
926
|
-
| 'commands-the-hi'
|
|
927
|
-
| 'role-as-other-party'
|
|
928
|
-
| 'denies-own-role'
|
|
929
|
-
| 'retrospective-authority-attribution'
|
|
851
|
+
type AuthorityDriftPattern = 'claims-hi-authority' | 'commands-the-hi' | 'role-as-other-party' | 'denies-own-role' | 'retrospective-authority-attribution'
|
|
930
852
|
|
|
931
853
|
type RetrospectiveVerdict = 'SUPPORTED' | 'NO_EVIDENCE'
|
|
932
854
|
|
|
@@ -1053,16 +975,7 @@ interface IdentityResolutionContext {
|
|
|
1053
975
|
checkpoints?: Array<{ name: string; source: string; timestamp: string }>
|
|
1054
976
|
}
|
|
1055
977
|
|
|
1056
|
-
type IdentityAuthoritySource =
|
|
1057
|
-
| 'explicit-user-decision'
|
|
1058
|
-
| 'authoritative-project-config'
|
|
1059
|
-
| 'verified-project-metadata'
|
|
1060
|
-
| 'governance'
|
|
1061
|
-
| 'historical-claim'
|
|
1062
|
-
| 'summary'
|
|
1063
|
-
| 'checkpoint'
|
|
1064
|
-
| 'cache'
|
|
1065
|
-
| 'index'
|
|
978
|
+
type IdentityAuthoritySource = 'explicit-user-decision' | 'authoritative-project-config' | 'verified-project-metadata' | 'governance' | 'historical-claim' | 'summary' | 'checkpoint' | 'cache' | 'index'
|
|
1066
979
|
|
|
1067
980
|
interface CanonicalReconstructionInput {
|
|
1068
981
|
/** The canonical identity after governance resolution. */
|
|
@@ -1436,13 +1349,7 @@ interface BuildHandshakeSessionRecordInput {
|
|
|
1436
1349
|
|
|
1437
1350
|
type CompatibilityState = 'COMPATIBLE' | 'LIMITED' | 'INCOMPATIBLE'
|
|
1438
1351
|
|
|
1439
|
-
type HandshakeCapability =
|
|
1440
|
-
| 'identityComposition'
|
|
1441
|
-
| 'rolePreservation'
|
|
1442
|
-
| 'authorityPreservation'
|
|
1443
|
-
| 'memoryAsData'
|
|
1444
|
-
| 'hostAuthoritySeparation'
|
|
1445
|
-
| 'profileHostCoexistence'
|
|
1352
|
+
type HandshakeCapability = 'identityComposition' | 'rolePreservation' | 'authorityPreservation' | 'memoryAsData' | 'hostAuthoritySeparation' | 'profileHostCoexistence'
|
|
1446
1353
|
|
|
1447
1354
|
type RoleMappingValue = 'preserved' | 'violated' | 'refused' | 'unclear'
|
|
1448
1355
|
|
|
@@ -1546,11 +1453,7 @@ interface IdentityAndRuntime {
|
|
|
1546
1453
|
readonly model: string | null
|
|
1547
1454
|
}
|
|
1548
1455
|
|
|
1549
|
-
type IdentityFusionKind =
|
|
1550
|
-
| 'identity+environment'
|
|
1551
|
-
| 'identity+model'
|
|
1552
|
-
| 'identity+authority-label'
|
|
1553
|
-
| 'identity+role-metadata'
|
|
1456
|
+
type IdentityFusionKind = 'identity+environment' | 'identity+model' | 'identity+authority-label' | 'identity+role-metadata'
|
|
1554
1457
|
|
|
1555
1458
|
interface IdentityGovernance {
|
|
1556
1459
|
format: 'dotmem.identity-governance'
|
|
@@ -1629,20 +1532,9 @@ interface IdentityResolutionInput {
|
|
|
1629
1532
|
retrievedText?: readonly IdentityCandidate[]
|
|
1630
1533
|
}
|
|
1631
1534
|
|
|
1632
|
-
type IdentityCandidateSource =
|
|
1633
|
-
| 'HI_ASSIGNMENT'
|
|
1634
|
-
| 'PROFILE'
|
|
1635
|
-
| 'MEMORY'
|
|
1636
|
-
| 'RETRIEVED_TEXT'
|
|
1535
|
+
type IdentityCandidateSource = 'HI_ASSIGNMENT' | 'PROFILE' | 'MEMORY' | 'RETRIEVED_TEXT'
|
|
1637
1536
|
|
|
1638
|
-
type IdentityDisposition =
|
|
1639
|
-
| 'SELECTED'
|
|
1640
|
-
| 'SHADOWED'
|
|
1641
|
-
| 'HISTORICAL'
|
|
1642
|
-
| 'UNTRUSTED_DATA'
|
|
1643
|
-
| 'SELF_PROMOTED'
|
|
1644
|
-
| 'CONFLICT'
|
|
1645
|
-
| 'UNRESOLVED'
|
|
1537
|
+
type IdentityDisposition = 'SELECTED' | 'SHADOWED' | 'HISTORICAL' | 'UNTRUSTED_DATA' | 'SELF_PROMOTED' | 'CONFLICT' | 'UNRESOLVED'
|
|
1646
1538
|
|
|
1647
1539
|
interface IncidentCase {
|
|
1648
1540
|
id: string
|
|
@@ -2216,28 +2108,13 @@ type PolicyAction = 'allow' | 'block-and-ask' | 'block'
|
|
|
2216
2108
|
|
|
2217
2109
|
type OverrideRelaxTo = EnforcementTier
|
|
2218
2110
|
|
|
2219
|
-
type PolicyAuditAction =
|
|
2220
|
-
| 'assign'
|
|
2221
|
-
| 'remove'
|
|
2222
|
-
| 'clear'
|
|
2223
|
-
| 'override'
|
|
2224
|
-
| 'revoke'
|
|
2225
|
-
| 'lock-break'
|
|
2111
|
+
type PolicyAuditAction = 'assign' | 'remove' | 'clear' | 'override' | 'revoke' | 'lock-break'
|
|
2226
2112
|
|
|
2227
|
-
type PolicyAuditAuthority =
|
|
2228
|
-
| PolicyAuthority
|
|
2229
|
-
| { kind: 'system'; source: string }
|
|
2113
|
+
type PolicyAuditAuthority = PolicyAuthority | { kind: 'system'; source: string }
|
|
2230
2114
|
|
|
2231
2115
|
type PolicyOverrideState = 'ACTIVE' | 'EXPIRED' | 'STALE' | 'INERT' | 'NONE'
|
|
2232
2116
|
|
|
2233
|
-
type PolicyOverrideInertDetail =
|
|
2234
|
-
| 'active'
|
|
2235
|
-
| 'policy-missing'
|
|
2236
|
-
| 'policy-changed'
|
|
2237
|
-
| 'expired'
|
|
2238
|
-
| 'revoked'
|
|
2239
|
-
| 'superseded'
|
|
2240
|
-
| 'multiple-active'
|
|
2117
|
+
type PolicyOverrideInertDetail = 'active' | 'policy-missing' | 'policy-changed' | 'expired' | 'revoked' | 'superseded' | 'multiple-active'
|
|
2241
2118
|
|
|
2242
2119
|
interface SummaryFact {
|
|
2243
2120
|
id: string
|
|
@@ -2296,6 +2173,12 @@ interface SizeDisclosureOptions {
|
|
|
2296
2173
|
hostCeilingBytes: number
|
|
2297
2174
|
/** When present, the manifest is summarized instead of only counted. */
|
|
2298
2175
|
manifest?: OmissionManifest
|
|
2176
|
+
/** Include full omitted ID list (debug/full mode only). */
|
|
2177
|
+
includeOmittedIds?: boolean
|
|
2178
|
+
/** Automatic loading level (0-3), when available. */
|
|
2179
|
+
loadingLevel?: number
|
|
2180
|
+
/** Reason for the selected loading level. */
|
|
2181
|
+
loadingReason?: string
|
|
2299
2182
|
}
|
|
2300
2183
|
|
|
2301
2184
|
interface BootstrapProjectionClaim {
|
|
@@ -2495,13 +2378,7 @@ interface RelocateStorageOptions {
|
|
|
2495
2378
|
updateProjectSettings?: boolean
|
|
2496
2379
|
}
|
|
2497
2380
|
|
|
2498
|
-
type DotMemStorageSource =
|
|
2499
|
-
| 'cli-override'
|
|
2500
|
-
| 'override'
|
|
2501
|
-
| 'project-settings'
|
|
2502
|
-
| 'user-settings'
|
|
2503
|
-
| 'locator'
|
|
2504
|
-
| 'default'
|
|
2381
|
+
type DotMemStorageSource = 'cli-override' | 'override' | 'project-settings' | 'user-settings' | 'locator' | 'default'
|
|
2505
2382
|
|
|
2506
2383
|
type DotMemStorageDivergence = 'none' | 'SHADOWED' | 'SPLIT_BRAIN' | 'MIGRATION_REQUIRED'
|
|
2507
2384
|
|
|
@@ -2701,6 +2578,8 @@ interface DiscoveryOptions {
|
|
|
2701
2578
|
maxCandidates?: number
|
|
2702
2579
|
/** Explicit runtime facts that override situation-prose derivation. */
|
|
2703
2580
|
facts?: SituationFacts
|
|
2581
|
+
diagnostics?: boolean
|
|
2582
|
+
debug?: boolean
|
|
2704
2583
|
/**
|
|
2705
2584
|
* Project identity the retrieval runs for. Enables the scope-eligibility
|
|
2706
2585
|
* gate: a project-scoped claim is eligible only for its owning project.
|
|
@@ -2887,32 +2766,11 @@ type SituationApplicability = Record<string, JsonPrimitive>
|
|
|
2887
2766
|
|
|
2888
2767
|
type SituationFacts = SituationApplicability
|
|
2889
2768
|
|
|
2890
|
-
type CurrentnessState =
|
|
2891
|
-
|
|
2892
|
-
|
|
2893
|
-
|
|
2894
|
-
|
|
2895
|
-
| 'unverified'
|
|
2896
|
-
| 'contested'
|
|
2897
|
-
| 'unknown-currentness'
|
|
2898
|
-
|
|
2899
|
-
type OmissionReason =
|
|
2900
|
-
| 'retracted'
|
|
2901
|
-
| 'superseded'
|
|
2902
|
-
| 'expired'
|
|
2903
|
-
| 'scope'
|
|
2904
|
-
| 'applicability-mismatch'
|
|
2905
|
-
| 'no-term-match'
|
|
2906
|
-
| 'limit'
|
|
2907
|
-
| 'budget'
|
|
2908
|
-
|
|
2909
|
-
type OmissionGate =
|
|
2910
|
-
| 'revision-resolution'
|
|
2911
|
-
| 'scope'
|
|
2912
|
-
| 'freshness'
|
|
2913
|
-
| 'applicability'
|
|
2914
|
-
| 'ranking'
|
|
2915
|
-
| 'projection'
|
|
2769
|
+
type CurrentnessState = 'historical' | 'superseded' | 'expired' | 'verified' | 'unverified' | 'contested' | 'unknown-currentness'
|
|
2770
|
+
|
|
2771
|
+
type OmissionReason = 'retracted' | 'superseded' | 'expired' | 'scope' | 'applicability-mismatch' | 'no-term-match' | 'limit' | 'budget'
|
|
2772
|
+
|
|
2773
|
+
type OmissionGate = 'revision-resolution' | 'scope' | 'freshness' | 'applicability' | 'ranking' | 'projection'
|
|
2916
2774
|
|
|
2917
2775
|
type ClaimDisposition = 'selected' | 'excluded' | 'unresolved'
|
|
2918
2776
|
|
|
@@ -2920,21 +2778,9 @@ type ClaimRevisionState = 'current' | 'retracted' | 'superseded' | 'historical-o
|
|
|
2920
2778
|
|
|
2921
2779
|
type ExplanationGate = 'revision-resolution' | 'applicability-gate'
|
|
2922
2780
|
|
|
2923
|
-
type DiscoveryPipelineStage =
|
|
2924
|
-
|
|
2925
|
-
|
|
2926
|
-
| 'applicability-gate'
|
|
2927
|
-
| 'ranking'
|
|
2928
|
-
| 'projection'
|
|
2929
|
-
|
|
2930
|
-
type ExplanationReason =
|
|
2931
|
-
| 'current'
|
|
2932
|
-
| 'retracted'
|
|
2933
|
-
| 'superseded'
|
|
2934
|
-
| 'baseline'
|
|
2935
|
-
| 'applicability-match'
|
|
2936
|
-
| 'applicability-mismatch'
|
|
2937
|
-
| 'applicability-unspecified'
|
|
2781
|
+
type DiscoveryPipelineStage = 'candidate-collection' | 'revision-resolution' | 'applicability-gate' | 'ranking' | 'projection'
|
|
2782
|
+
|
|
2783
|
+
type ExplanationReason = 'current' | 'retracted' | 'superseded' | 'baseline' | 'applicability-match' | 'applicability-mismatch' | 'applicability-unspecified'
|
|
2938
2784
|
|
|
2939
2785
|
type ProjectedExperienceStatus = 'prior-acquired-experience-candidate'
|
|
2940
2786
|
|
|
@@ -3306,43 +3152,11 @@ interface MemoryFacadeLike {
|
|
|
3306
3152
|
|
|
3307
3153
|
type MemoryType = 'fact' | 'preference' | 'decision' | 'task' | 'context'
|
|
3308
3154
|
|
|
3309
|
-
type OrchestrationRunStatus =
|
|
3310
|
-
|
|
3311
|
-
|
|
3312
|
-
|
|
3313
|
-
|
|
3314
|
-
| 'completed'
|
|
3315
|
-
| 'failed'
|
|
3316
|
-
| 'partially_completed'
|
|
3317
|
-
| 'cancelled'
|
|
3318
|
-
| 'recovery_blocked'
|
|
3319
|
-
|
|
3320
|
-
type TaskLifecycleState =
|
|
3321
|
-
| 'discovered'
|
|
3322
|
-
| 'eligible'
|
|
3323
|
-
| 'assigned'
|
|
3324
|
-
| 'dispatch_accepted'
|
|
3325
|
-
| 'running'
|
|
3326
|
-
| 'blocked'
|
|
3327
|
-
| 'completed'
|
|
3328
|
-
| 'failed'
|
|
3329
|
-
| 'timed_out'
|
|
3330
|
-
| 'cancelled'
|
|
3331
|
-
| 'result_received'
|
|
3332
|
-
| 'result_validated'
|
|
3333
|
-
| 'accepted'
|
|
3334
|
-
|
|
3335
|
-
type ExceptionCategory =
|
|
3336
|
-
| 'agent_unavailable'
|
|
3337
|
-
| 'agent_busy'
|
|
3338
|
-
| 'permission_denied'
|
|
3339
|
-
| 'no_useful_subtask'
|
|
3340
|
-
| 'execution_failed'
|
|
3341
|
-
| 'timed_out'
|
|
3342
|
-
| 'cancelled'
|
|
3343
|
-
| 'provider_unreachable'
|
|
3344
|
-
| 'discovery_incomplete'
|
|
3345
|
-
| 'recovery_blocked'
|
|
3155
|
+
type OrchestrationRunStatus = 'discovering' | 'planning' | 'assigned' | 'running' | 'completed' | 'failed' | 'partially_completed' | 'cancelled' | 'recovery_blocked'
|
|
3156
|
+
|
|
3157
|
+
type TaskLifecycleState = 'discovered' | 'eligible' | 'assigned' | 'dispatch_accepted' | 'running' | 'blocked' | 'completed' | 'failed' | 'timed_out' | 'cancelled' | 'result_received' | 'result_validated' | 'accepted'
|
|
3158
|
+
|
|
3159
|
+
type ExceptionCategory = 'agent_unavailable' | 'agent_busy' | 'permission_denied' | 'no_useful_subtask' | 'execution_failed' | 'timed_out' | 'cancelled' | 'provider_unreachable' | 'discovery_incomplete' | 'recovery_blocked'
|
|
3346
3160
|
|
|
3347
3161
|
interface AgentDescriptor {
|
|
3348
3162
|
agentId: string
|
|
@@ -3498,10 +3312,7 @@ interface ProviderAdapter {
|
|
|
3498
3312
|
declareCapabilities(): ProviderCapabilityDeclaration
|
|
3499
3313
|
dispatch(task: DispatchTask): Promise<AgentJobHandle>
|
|
3500
3314
|
getProgress(jobHandle: AgentJobHandle): Promise<AgentProgress>
|
|
3501
|
-
subscribeToProgress?(
|
|
3502
|
-
jobHandle: AgentJobHandle,
|
|
3503
|
-
callback: (progress: AgentProgress) => void
|
|
3504
|
-
): Promise<() => void>
|
|
3315
|
+
subscribeToProgress?(jobHandle: AgentJobHandle, callback: (progress: AgentProgress) => void): Promise<() => void>
|
|
3505
3316
|
getResult(jobHandle: AgentJobHandle): Promise<AgentResult>
|
|
3506
3317
|
cancel(jobHandle: AgentJobHandle): Promise<boolean>
|
|
3507
3318
|
normalizeError(error: unknown): NormalizedAdapterError
|
|
@@ -3509,15 +3320,7 @@ interface ProviderAdapter {
|
|
|
3509
3320
|
getAuthContext?(): Promise<{ scopes: string[]; expiresAt?: string }>
|
|
3510
3321
|
}
|
|
3511
3322
|
|
|
3512
|
-
type ProviderProtocol =
|
|
3513
|
-
| 'a2a'
|
|
3514
|
-
| 'mcp'
|
|
3515
|
-
| 'provider-native'
|
|
3516
|
-
| 'http'
|
|
3517
|
-
| 'websocket'
|
|
3518
|
-
| 'sdk'
|
|
3519
|
-
| 'cli'
|
|
3520
|
-
| 'other'
|
|
3323
|
+
type ProviderProtocol = 'a2a' | 'mcp' | 'provider-native' | 'http' | 'websocket' | 'sdk' | 'cli' | 'other'
|
|
3521
3324
|
|
|
3522
3325
|
type ProviderHealthStatus = 'healthy' | 'degraded' | 'unavailable'
|
|
3523
3326
|
|
|
@@ -3525,23 +3328,9 @@ type AgentAvailability = 'available' | 'unavailable' | 'disabled'
|
|
|
3525
3328
|
|
|
3526
3329
|
type AgentInvocationMode = 'sync' | 'async' | 'streaming'
|
|
3527
3330
|
|
|
3528
|
-
type TaskLifecycleCapability =
|
|
3529
|
-
|
|
3530
|
-
|
|
3531
|
-
| 'cancellation'
|
|
3532
|
-
| 'progress-streaming'
|
|
3533
|
-
| 'artifacts'
|
|
3534
|
-
| 'retry'
|
|
3535
|
-
|
|
3536
|
-
type AuthorizationStatus = 'authorized' | 'unauthorized' | 'unknown'
|
|
3537
|
-
|
|
3538
|
-
| 'discovered'
|
|
3539
|
-
| 'available'
|
|
3540
|
-
| 'unavailable'
|
|
3541
|
-
| 'invocable'
|
|
3542
|
-
| 'not-invocable'
|
|
3543
|
-
| 'authorized'
|
|
3544
|
-
| 'unauthorized'
|
|
3331
|
+
type TaskLifecycleCapability = 'status-polling' | 'status-subscription' | 'cancellation' | 'progress-streaming' | 'artifacts' | 'retry'
|
|
3332
|
+
|
|
3333
|
+
type AuthorizationStatus = 'authorized' | 'unauthorized' | 'unknown' | 'discovered' | 'available' | 'unavailable' | 'invocable' | 'not-invocable' | 'authorized' | 'unauthorized'
|
|
3545
3334
|
|
|
3546
3335
|
interface RecoveryResult {
|
|
3547
3336
|
requiresSelection: boolean
|
package/types/memory.d.ts
CHANGED
|
@@ -4,12 +4,7 @@ declare global {
|
|
|
4
4
|
}
|
|
5
5
|
|
|
6
6
|
type MemoryScope = 'hot' | 'session' | 'local' | 'durable'
|
|
7
|
-
type MemoryType =
|
|
8
|
-
| 'fact'
|
|
9
|
-
| 'preference'
|
|
10
|
-
| 'decision'
|
|
11
|
-
| 'task'
|
|
12
|
-
| 'context'
|
|
7
|
+
type MemoryType = 'fact' | 'preference' | 'decision' | 'task' | 'context'
|
|
13
8
|
type MemoryStatus = 'active' | 'obsolete' | 'superseded'
|
|
14
9
|
type MemoryKind = 'experience' | 'agent' | 'relationship' | 'logic' | 'note' | 'rule'
|
|
15
10
|
type JsonPrimitive = string | number | boolean | null
|
|
@@ -85,6 +80,9 @@ interface DiscoveryOptions {
|
|
|
85
80
|
maxCandidates?: number
|
|
86
81
|
/** Explicit runtime facts that override situation-prose derivation. */
|
|
87
82
|
facts?: SituationFacts
|
|
83
|
+
/** Enable discovery diagnostics on stderr. */
|
|
84
|
+
diagnostics?: boolean
|
|
85
|
+
debug?: boolean
|
|
88
86
|
}
|
|
89
87
|
interface DiscoveryExplanation {
|
|
90
88
|
matchedTerms: string[]
|
|
@@ -100,22 +98,8 @@ interface DiscoveryCandidate {
|
|
|
100
98
|
/** Derived currentness, so the projection renders what discovery resolved. */
|
|
101
99
|
currentness?: CurrentnessState
|
|
102
100
|
}
|
|
103
|
-
type OmissionReason =
|
|
104
|
-
|
|
105
|
-
| 'superseded'
|
|
106
|
-
| 'expired'
|
|
107
|
-
| 'scope'
|
|
108
|
-
| 'applicability-mismatch'
|
|
109
|
-
| 'no-term-match'
|
|
110
|
-
| 'limit'
|
|
111
|
-
| 'budget'
|
|
112
|
-
type OmissionGate =
|
|
113
|
-
| 'revision-resolution'
|
|
114
|
-
| 'scope'
|
|
115
|
-
| 'freshness'
|
|
116
|
-
| 'applicability'
|
|
117
|
-
| 'ranking'
|
|
118
|
-
| 'projection'
|
|
101
|
+
type OmissionReason = 'retracted' | 'superseded' | 'expired' | 'scope' | 'applicability-mismatch' | 'no-term-match' | 'limit' | 'budget'
|
|
102
|
+
type OmissionGate = 'revision-resolution' | 'scope' | 'freshness' | 'applicability' | 'ranking' | 'projection'
|
|
119
103
|
interface OmissionRecord {
|
|
120
104
|
id: string
|
|
121
105
|
reason: OmissionReason
|
|
@@ -160,14 +144,7 @@ interface ProjectedExperience {
|
|
|
160
144
|
/** Derived currentness of the underlying claim, when discovery computed it. */
|
|
161
145
|
currentness?: CurrentnessState
|
|
162
146
|
}
|
|
163
|
-
type CurrentnessState =
|
|
164
|
-
| 'historical'
|
|
165
|
-
| 'superseded'
|
|
166
|
-
| 'expired'
|
|
167
|
-
| 'verified'
|
|
168
|
-
| 'unverified'
|
|
169
|
-
| 'contested'
|
|
170
|
-
| 'unknown-currentness'
|
|
147
|
+
type CurrentnessState = 'historical' | 'superseded' | 'expired' | 'verified' | 'unverified' | 'contested' | 'unknown-currentness'
|
|
171
148
|
interface ContextProjection {
|
|
172
149
|
format: 'dotmem-context-v1'
|
|
173
150
|
status: 'candidate-context-not-current-truth'
|
|
@@ -195,15 +172,7 @@ interface PatchOperation {
|
|
|
195
172
|
* The `delete` operation creates an explicit tombstone entry so concurrent
|
|
196
173
|
* updates/replay do not resurrect deleted values.
|
|
197
174
|
*/
|
|
198
|
-
type MemoryOperation =
|
|
199
|
-
| 'remember'
|
|
200
|
-
| 'update'
|
|
201
|
-
| 'forget'
|
|
202
|
-
| 'expire'
|
|
203
|
-
| 'confirm'
|
|
204
|
-
| 'supersede'
|
|
205
|
-
| 'delete'
|
|
206
|
-
| 'patch'
|
|
175
|
+
type MemoryOperation = 'remember' | 'update' | 'forget' | 'expire' | 'confirm' | 'supersede' | 'delete' | 'patch'
|
|
207
176
|
/**
|
|
208
177
|
* Synchronization state of a journal entry against a remote/cloud backend.
|
|
209
178
|
*/
|