@stacklink/sdk 0.2.0 → 0.2.2
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/README.md +10 -0
- package/compatibility.json +1 -1
- package/dist/src/domain/memory-contract.d.ts +1497 -335
- package/dist/src/domain/memory-contract.d.ts.map +1 -1
- package/dist/src/domain/memory-contract.js +330 -59
- package/dist/src/domain/memory-contract.js.map +1 -1
- package/dist/src/domain/provider-branding.d.ts +1 -1
- package/dist/src/domain/provider-branding.d.ts.map +1 -1
- package/dist/src/domain/provider-branding.js +296 -8
- package/dist/src/domain/provider-branding.js.map +1 -1
- package/dist/src/domain/stacklink-meta-tools.d.ts +14 -16
- package/dist/src/domain/stacklink-meta-tools.d.ts.map +1 -1
- package/dist/src/domain/stacklink-meta-tools.js +205 -127
- package/dist/src/domain/stacklink-meta-tools.js.map +1 -1
- package/dist/src/sdk/framework-tools.d.ts +3 -2
- package/dist/src/sdk/framework-tools.d.ts.map +1 -1
- package/dist/src/sdk/framework-tools.js +1 -0
- package/dist/src/sdk/framework-tools.js.map +1 -1
- package/dist/src/sdk/index.d.ts +280 -142
- package/dist/src/sdk/index.d.ts.map +1 -1
- package/dist/src/sdk/index.js +433 -224
- package/dist/src/sdk/index.js.map +1 -1
- package/dist/src/sdk/langchain.d.ts +7 -2
- package/dist/src/sdk/langchain.d.ts.map +1 -1
- package/dist/src/sdk/langchain.js +3 -2
- package/dist/src/sdk/langchain.js.map +1 -1
- package/dist/src/sdk/memory-lifecycle.d.ts +25 -0
- package/dist/src/sdk/memory-lifecycle.d.ts.map +1 -1
- package/dist/src/sdk/memory-lifecycle.js +75 -1
- package/dist/src/sdk/memory-lifecycle.js.map +1 -1
- package/dist/src/sdk/openai-agents.d.ts +6 -6
- package/dist/src/sdk/openai-agents.d.ts.map +1 -1
- package/dist/src/sdk/openai-agents.js +21 -16
- package/dist/src/sdk/openai-agents.js.map +1 -1
- package/dist/src/sdk/openai.d.ts +2 -2
- package/dist/src/sdk/openai.d.ts.map +1 -1
- package/dist/src/sdk/openai.js +67 -31
- package/dist/src/sdk/openai.js.map +1 -1
- package/dist/src/sdk/vercel-ai.d.ts +11 -4
- package/dist/src/sdk/vercel-ai.d.ts.map +1 -1
- package/dist/src/sdk/vercel-ai.js +21 -6
- package/dist/src/sdk/vercel-ai.js.map +1 -1
- package/package.json +1 -1
- package/dist/src/domain/knowledge-meta-tools.d.ts +0 -12
- package/dist/src/domain/knowledge-meta-tools.d.ts.map +0 -1
- package/dist/src/domain/knowledge-meta-tools.js +0 -38
- package/dist/src/domain/knowledge-meta-tools.js.map +0 -1
- package/dist/src/domain/memory-meta-tools.d.ts +0 -5
- package/dist/src/domain/memory-meta-tools.d.ts.map +0 -1
- package/dist/src/domain/memory-meta-tools.js +0 -18
- package/dist/src/domain/memory-meta-tools.js.map +0 -1
- package/dist/src/domain/platform-mcp-tools.d.ts +0 -3
- package/dist/src/domain/platform-mcp-tools.d.ts.map +0 -1
- package/dist/src/domain/platform-mcp-tools.js +0 -30
- package/dist/src/domain/platform-mcp-tools.js.map +0 -1
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"memory-contract.d.ts","sourceRoot":"","sources":["../../../../../src/domain/memory-contract.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAExB,eAAO,MAAM,kBAAkB,sEAOrB,CAAC;AAEX,eAAO,MAAM,iBAAiB,uDAKpB,CAAC;AAEX,eAAO,MAAM,0BAA0B,8BAG7B,CAAC;AAEX,eAAO,MAAM,WAAW,yGAQd,CAAC;AAEX,MAAM,MAAM,UAAU,GAAG,OAAO,WAAW,CAAC,MAAM,CAAC,CAAC;AAEpD,eAAO,MAAM,wBAAwB,2DAK3B,CAAC;AAEX,eAAO,MAAM,2BAA2B,wIAQ9B,CAAC;AAEX,eAAO,MAAM,kBAAkB,iDAIrB,CAAC;AAEX,eAAO,MAAM,4BAA4B,oCAG/B,CAAC;AAEX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C,CAAC;AAEH,eAAO,MAAM,0BAA0B;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CAqH7B,CAAC;AAEX,eAAO,MAAM,sBAAsB;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CA2BzB,CAAC;AAEX,eAAO,MAAM,6BAA6B;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CAqBhC,CAAC;AAEX,wBAAgB,uBAAuB,CAAC,iBAAiB,EAAE,SAAS,MAAM,EAAE;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;EAa3E;AAED,wBAAgB,4BAA4B,CAAC,iBAAiB,EAAE,SAAS,MAAM,EAAE;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;EAkBhF"}
|
|
@@ -32,6 +32,74 @@ export const memorySensitivityClasses = [
|
|
|
32
32
|
'restricted',
|
|
33
33
|
'secret',
|
|
34
34
|
];
|
|
35
|
+
export const memorySourceClasses = [
|
|
36
|
+
'human_communication',
|
|
37
|
+
'structured_temporal',
|
|
38
|
+
'structured_profile',
|
|
39
|
+
'authored_document',
|
|
40
|
+
'operational_event',
|
|
41
|
+
'external_feed',
|
|
42
|
+
];
|
|
43
|
+
export const memoryAuthorshipClasses = [
|
|
44
|
+
'connected_user',
|
|
45
|
+
'other_human',
|
|
46
|
+
'bot',
|
|
47
|
+
'application',
|
|
48
|
+
'system',
|
|
49
|
+
'unknown',
|
|
50
|
+
];
|
|
51
|
+
export const memoryAdmissionBases = [
|
|
52
|
+
'self_authored',
|
|
53
|
+
'provider_structured_state',
|
|
54
|
+
'attributed_third_party',
|
|
55
|
+
'tool_execution',
|
|
56
|
+
'user_confirmed',
|
|
57
|
+
];
|
|
58
|
+
export const memoryDurabilities = [
|
|
59
|
+
'durable',
|
|
60
|
+
'episodic',
|
|
61
|
+
'transient',
|
|
62
|
+
];
|
|
63
|
+
export const memoryQualityRatingClasses = ['low', 'medium', 'high'];
|
|
64
|
+
export const memoryDestinations = [
|
|
65
|
+
'durable_memory',
|
|
66
|
+
'episodic_memory',
|
|
67
|
+
'restricted_candidate',
|
|
68
|
+
'source_only',
|
|
69
|
+
'reject_noise',
|
|
70
|
+
];
|
|
71
|
+
export const memoryRetentionAdmissionStatuses = [
|
|
72
|
+
'memory',
|
|
73
|
+
'source_only',
|
|
74
|
+
'reject_noise',
|
|
75
|
+
'uncertain',
|
|
76
|
+
];
|
|
77
|
+
export const memoryQualityContractVersion = 1;
|
|
78
|
+
export const memoryProviderQualityContextSchema = z.object({
|
|
79
|
+
authorshipBoundary: z.enum(['exact_source_unit', 'message_may_include_quotes']).optional(),
|
|
80
|
+
contract: z.literal('stacklink.memory.source-quality.v1'),
|
|
81
|
+
qualityContractVersion: z.literal(memoryQualityContractVersion),
|
|
82
|
+
sourceClass: z.enum(memorySourceClasses),
|
|
83
|
+
authorshipClass: z.enum(memoryAuthorshipClasses),
|
|
84
|
+
admissionBasis: z.enum(memoryAdmissionBases),
|
|
85
|
+
actorCanonicalKey: z.string().trim().min(1).max(320).nullable(),
|
|
86
|
+
actors: z.array(z.object({
|
|
87
|
+
canonicalKey: z.string().trim().min(1).max(320),
|
|
88
|
+
authorshipClass: z.enum(memoryAuthorshipClasses),
|
|
89
|
+
admissionBasis: z.enum(memoryAdmissionBases),
|
|
90
|
+
defaultDestination: z.enum(memoryDestinations),
|
|
91
|
+
allowedMemoryTypes: z.array(z.enum(memoryTypes)).max(memoryTypes.length),
|
|
92
|
+
}).strict()).max(500).default([]),
|
|
93
|
+
connectedUserCanonicalKey: z.string().trim().min(1).max(320).nullable(),
|
|
94
|
+
allowConnectedUserIntent: z.boolean(),
|
|
95
|
+
allowedMemoryTypes: z.array(z.enum(memoryTypes)).max(memoryTypes.length),
|
|
96
|
+
defaultDestination: z.enum(memoryDestinations),
|
|
97
|
+
defaultDurability: z.enum(memoryDurabilities),
|
|
98
|
+
attachmentsIncluded: z.boolean(),
|
|
99
|
+
hardExclusionSignals: z.array(z.string().trim().min(1).max(160)).max(50),
|
|
100
|
+
validFrom: z.string().datetime().nullable().default(null),
|
|
101
|
+
validTo: z.string().datetime().nullable().default(null),
|
|
102
|
+
}).strict();
|
|
35
103
|
export const memoryRestrictedDataClasses = [
|
|
36
104
|
'health',
|
|
37
105
|
'biometric',
|
|
@@ -96,6 +164,22 @@ const memoryTemporalFieldsShape = {
|
|
|
96
164
|
validFrom: z.string().datetime().optional(),
|
|
97
165
|
validTo: z.string().datetime().optional(),
|
|
98
166
|
};
|
|
167
|
+
/** Minimal retained provenance, independent of the original source payload. */
|
|
168
|
+
export const memoryEvidenceReferenceSchema = z.object({
|
|
169
|
+
contract: z.literal('stacklink.memory.evidence.v1').default('stacklink.memory.evidence.v1'),
|
|
170
|
+
kind: z.enum(['email', 'message', 'object', 'conversation', 'file', 'manual', 'api', 'unknown']),
|
|
171
|
+
href: z.string().url().refine((value) => ['https:', 'http:'].includes(new URL(value).protocol)).optional(),
|
|
172
|
+
availability: z.enum(['available', 'deleted', 'unknown']).default('unknown'),
|
|
173
|
+
from: z.object({ name: z.string().max(1000), address: z.string().max(1000).optional() }).optional(),
|
|
174
|
+
subject: z.string().max(1000).optional(),
|
|
175
|
+
channel: z.string().max(1000).optional(),
|
|
176
|
+
object: z.object({ kind: z.string().max(120), name: z.string().max(1000), id: z.string().max(1000), observed: z.string().optional() }).optional(),
|
|
177
|
+
fields: z.array(z.object({ label: z.string().max(200), before: z.string().max(8000).nullable().optional(), after: z.string().max(8000) })).max(200).optional(),
|
|
178
|
+
conversation: z.object({ sessionId: z.string().uuid().optional(), turn: z.string().max(240).optional(), speaker: z.string().max(1000).optional(), assistant: z.boolean().optional() }).optional(),
|
|
179
|
+
file: z.object({ title: z.string().max(1000), section: z.string().max(1000).optional(), edited: z.string().optional() }).optional(),
|
|
180
|
+
by: z.string().max(1000).optional(),
|
|
181
|
+
requestId: z.string().max(1000).optional(),
|
|
182
|
+
}).strict();
|
|
99
183
|
export const memoryIngestInputSchema = z.object({
|
|
100
184
|
tenantId: z.string().uuid().optional(),
|
|
101
185
|
externalTenantId: z.string().trim().min(1).max(160).optional(),
|
|
@@ -119,6 +203,7 @@ export const memoryIngestInputSchema = z.object({
|
|
|
119
203
|
resourceId: z.string().trim().min(1).max(320).optional(),
|
|
120
204
|
toolExecutionId: z.string().uuid().optional(),
|
|
121
205
|
applicationKey: z.string().trim().min(1).max(160).optional(),
|
|
206
|
+
evidence: memoryEvidenceReferenceSchema.optional(),
|
|
122
207
|
}).strict().default({ kind: 'direct' }),
|
|
123
208
|
idempotencyKey: z.string().trim().min(1).max(240).optional(),
|
|
124
209
|
policyKey: z.string().trim().min(1).max(120).optional(),
|
|
@@ -271,6 +356,87 @@ export const memoryRecordUpdateInputSchema = z.object({
|
|
|
271
356
|
if (value.sensitivityClass !== undefined)
|
|
272
357
|
validateMemorySensitivity(value, ctx);
|
|
273
358
|
});
|
|
359
|
+
export const memoryQualityReviewDispositions = [
|
|
360
|
+
'keep',
|
|
361
|
+
'correct',
|
|
362
|
+
'convert_to_episode',
|
|
363
|
+
'restrict',
|
|
364
|
+
];
|
|
365
|
+
export const memoryQualityReviewEntitySchema = z.object({
|
|
366
|
+
entityType: z.string().trim().min(1).max(80),
|
|
367
|
+
canonicalKey: z.string().trim().min(1).max(320),
|
|
368
|
+
displayName: z.string().trim().min(1).max(320).nullable().optional(),
|
|
369
|
+
attributes: z.record(z.unknown()).default({}),
|
|
370
|
+
}).strict();
|
|
371
|
+
export const memoryRecordQualityReviewInputSchema = z.object({
|
|
372
|
+
disposition: z.enum(memoryQualityReviewDispositions),
|
|
373
|
+
content: z.string().trim().min(1).max(1_000_000).optional(),
|
|
374
|
+
title: z.string().trim().min(1).max(260).nullable().optional(),
|
|
375
|
+
memoryType: z.enum(memoryTypes),
|
|
376
|
+
sensitivityClass: z.enum(memorySensitivityClasses),
|
|
377
|
+
restrictedDataClasses: z.array(z.enum(memoryRestrictedDataClasses)).max(memoryRestrictedDataClasses.length).default([]),
|
|
378
|
+
topicTags: z.array(z.string().trim().min(1).max(120)).max(50).optional(),
|
|
379
|
+
language: z.string().trim().min(1).max(80).nullable().optional(),
|
|
380
|
+
validFrom: z.string().datetime().nullable().optional(),
|
|
381
|
+
validTo: z.string().datetime().nullable().optional(),
|
|
382
|
+
authorshipClass: z.enum(memoryAuthorshipClasses),
|
|
383
|
+
salience: z.enum(memoryQualityRatingClasses),
|
|
384
|
+
evidenceConfidence: z.enum(memoryQualityRatingClasses),
|
|
385
|
+
actorEntity: memoryQualityReviewEntitySchema,
|
|
386
|
+
subjectEntity: memoryQualityReviewEntitySchema,
|
|
387
|
+
reason: z.string().trim().min(1).max(500),
|
|
388
|
+
}).strict().superRefine((value, ctx) => {
|
|
389
|
+
validateMemorySensitivity(value, ctx);
|
|
390
|
+
validateTemporalInterval({
|
|
391
|
+
validFrom: value.validFrom ?? undefined,
|
|
392
|
+
validTo: value.validTo ?? undefined,
|
|
393
|
+
}, ctx);
|
|
394
|
+
if (value.sensitivityClass === 'secret') {
|
|
395
|
+
ctx.addIssue({
|
|
396
|
+
code: z.ZodIssueCode.custom,
|
|
397
|
+
path: ['sensitivityClass'],
|
|
398
|
+
message: 'Secret content cannot be confirmed into Memory; forget or erase the record.',
|
|
399
|
+
});
|
|
400
|
+
}
|
|
401
|
+
if (value.disposition === 'restrict' && value.sensitivityClass !== 'restricted') {
|
|
402
|
+
ctx.addIssue({
|
|
403
|
+
code: z.ZodIssueCode.custom,
|
|
404
|
+
path: ['sensitivityClass'],
|
|
405
|
+
message: 'A restricted review must use restricted or secret sensitivity.',
|
|
406
|
+
});
|
|
407
|
+
}
|
|
408
|
+
if (value.disposition !== 'restrict' && value.sensitivityClass === 'restricted') {
|
|
409
|
+
ctx.addIssue({
|
|
410
|
+
code: z.ZodIssueCode.custom,
|
|
411
|
+
path: ['disposition'],
|
|
412
|
+
message: 'Restricted content must use the restrict disposition.',
|
|
413
|
+
});
|
|
414
|
+
}
|
|
415
|
+
if (value.disposition === 'convert_to_episode' && !value.validTo) {
|
|
416
|
+
ctx.addIssue({
|
|
417
|
+
code: z.ZodIssueCode.custom,
|
|
418
|
+
path: ['validTo'],
|
|
419
|
+
message: 'An episode conversion requires an exact expiry time.',
|
|
420
|
+
});
|
|
421
|
+
}
|
|
422
|
+
if (['preference', 'decision', 'commitment', 'goal', 'constraint'].includes(value.memoryType)) {
|
|
423
|
+
if (value.actorEntity.entityType !== value.subjectEntity.entityType
|
|
424
|
+
|| value.actorEntity.canonicalKey !== value.subjectEntity.canonicalKey) {
|
|
425
|
+
ctx.addIssue({
|
|
426
|
+
code: z.ZodIssueCode.custom,
|
|
427
|
+
path: ['subjectEntity'],
|
|
428
|
+
message: 'Intent memory belongs to the exact actor who expressed it.',
|
|
429
|
+
});
|
|
430
|
+
}
|
|
431
|
+
if (!['connected_user', 'other_human'].includes(value.authorshipClass)) {
|
|
432
|
+
ctx.addIssue({
|
|
433
|
+
code: z.ZodIssueCode.custom,
|
|
434
|
+
path: ['authorshipClass'],
|
|
435
|
+
message: 'Human intent cannot be confirmed from a bot, application, system, or unknown actor.',
|
|
436
|
+
});
|
|
437
|
+
}
|
|
438
|
+
}
|
|
439
|
+
});
|
|
274
440
|
export const memoryForgetInputSchema = z.object({
|
|
275
441
|
reason: z.string().trim().min(1).max(500).optional(),
|
|
276
442
|
});
|
|
@@ -325,7 +491,35 @@ export const memoryConnectedSourceBackfillRangeSchema = z.enum([
|
|
|
325
491
|
'last_90_days',
|
|
326
492
|
'all',
|
|
327
493
|
]);
|
|
494
|
+
function validateSlackOperationalActorControls(value, ctx) {
|
|
495
|
+
if (value.sourceFamilyKey !== 'slack.conversations')
|
|
496
|
+
return;
|
|
497
|
+
if (value.approvedOperationalActorCanonicalKeys.length > 0 && !value.includeBotMessages) {
|
|
498
|
+
ctx.addIssue({
|
|
499
|
+
code: z.ZodIssueCode.custom,
|
|
500
|
+
path: ['approvedOperationalActorCanonicalKeys'],
|
|
501
|
+
message: 'Approved Slack operational actors require bot and app messages to be enabled.',
|
|
502
|
+
});
|
|
503
|
+
}
|
|
504
|
+
for (const actorKey of value.approvedOperationalActorCanonicalKeys) {
|
|
505
|
+
if (!actorKey.startsWith('slack:bot:') && !actorKey.startsWith('slack:app:')) {
|
|
506
|
+
ctx.addIssue({
|
|
507
|
+
code: z.ZodIssueCode.custom,
|
|
508
|
+
path: ['approvedOperationalActorCanonicalKeys'],
|
|
509
|
+
message: 'Approved Slack operational actors must use an exact slack:bot: or slack:app: canonical key.',
|
|
510
|
+
});
|
|
511
|
+
}
|
|
512
|
+
if (value.excludedActorCanonicalKeys.includes(actorKey)) {
|
|
513
|
+
ctx.addIssue({
|
|
514
|
+
code: z.ZodIssueCode.custom,
|
|
515
|
+
path: ['approvedOperationalActorCanonicalKeys'],
|
|
516
|
+
message: 'The same exact Slack actor cannot be both approved and excluded.',
|
|
517
|
+
});
|
|
518
|
+
}
|
|
519
|
+
}
|
|
520
|
+
}
|
|
328
521
|
export const memoryConnectedSourceInputSchema = z.object({
|
|
522
|
+
sessionId: z.string().uuid().optional(),
|
|
329
523
|
idempotencyKey: z.string().trim().min(1).max(240),
|
|
330
524
|
tenantId: z.string().uuid().optional(),
|
|
331
525
|
externalTenantId: z.string().trim().min(1).max(160).optional(),
|
|
@@ -337,6 +531,17 @@ export const memoryConnectedSourceInputSchema = z.object({
|
|
|
337
531
|
existingContent: memoryConnectedSourceBackfillRangeSchema.default('future_only'),
|
|
338
532
|
maxBackfillItems: z.number().int().positive().max(10_000).nullable().default(null),
|
|
339
533
|
deliveryMode: z.enum(['auto', 'webhook', 'polling']).default('auto'),
|
|
534
|
+
authorizationPerspective: z.enum(['provider_default', 'bot', 'user']).default('provider_default'),
|
|
535
|
+
includeAttachments: z.boolean().default(false),
|
|
536
|
+
includeFileContent: z.boolean().default(false),
|
|
537
|
+
includeEmailBodies: z.boolean().default(false),
|
|
538
|
+
includeConversationTranscripts: z.boolean().default(false),
|
|
539
|
+
includeCallActivity: z.boolean().default(false),
|
|
540
|
+
includePrivateConversations: z.boolean().default(false),
|
|
541
|
+
includeExternalConversations: z.boolean().default(false),
|
|
542
|
+
includeBotMessages: z.boolean().default(false),
|
|
543
|
+
approvedOperationalActorCanonicalKeys: z.array(z.string().trim().min(1).max(320)).max(100).default([]),
|
|
544
|
+
excludedActorCanonicalKeys: z.array(z.string().trim().min(1).max(320)).max(500).default([]),
|
|
340
545
|
rememberInstructions: z.string().trim().max(4000).default(''),
|
|
341
546
|
excludeInstructions: z.string().trim().max(4000).default(''),
|
|
342
547
|
allowedMemoryTypes: z.array(z.enum(memoryTypes)).max(memoryTypes.length).default([...memoryTypes]),
|
|
@@ -351,14 +556,34 @@ export const memoryConnectedSourceInputSchema = z.object({
|
|
|
351
556
|
message: 'Provide exactly one of tenantId or externalTenantId.',
|
|
352
557
|
});
|
|
353
558
|
}
|
|
559
|
+
if (value.sourceFamilyKey === 'slack.conversations' && value.authorizationPerspective === 'provider_default') {
|
|
560
|
+
ctx.addIssue({
|
|
561
|
+
code: z.ZodIssueCode.custom,
|
|
562
|
+
path: ['authorizationPerspective'],
|
|
563
|
+
message: 'Slack Memory sources must pin authorizationPerspective to bot or user.',
|
|
564
|
+
});
|
|
565
|
+
}
|
|
566
|
+
validateSlackOperationalActorControls(value, ctx);
|
|
354
567
|
});
|
|
355
568
|
export const memoryConnectedSourcePreviewInputSchema = z.object({
|
|
569
|
+
sessionId: z.string().uuid().optional(),
|
|
356
570
|
tenantId: z.string().uuid().optional(),
|
|
357
571
|
externalTenantId: z.string().trim().min(1).max(160).optional(),
|
|
358
572
|
connectedAccountId: z.string().uuid(),
|
|
359
573
|
sourceFamilyKey: z.string().trim().min(1).max(180),
|
|
360
574
|
resourceIds: z.array(z.string().trim().min(1).max(320)).max(1000).default([]),
|
|
361
575
|
existingContent: memoryConnectedSourceBackfillRangeSchema.default('future_only'),
|
|
576
|
+
authorizationPerspective: z.enum(['provider_default', 'bot', 'user']).default('provider_default'),
|
|
577
|
+
includeAttachments: z.boolean().default(false),
|
|
578
|
+
includeFileContent: z.boolean().default(false),
|
|
579
|
+
includeEmailBodies: z.boolean().default(false),
|
|
580
|
+
includeConversationTranscripts: z.boolean().default(false),
|
|
581
|
+
includeCallActivity: z.boolean().default(false),
|
|
582
|
+
includePrivateConversations: z.boolean().default(false),
|
|
583
|
+
includeExternalConversations: z.boolean().default(false),
|
|
584
|
+
includeBotMessages: z.boolean().default(false),
|
|
585
|
+
approvedOperationalActorCanonicalKeys: z.array(z.string().trim().min(1).max(320)).max(100).default([]),
|
|
586
|
+
excludedActorCanonicalKeys: z.array(z.string().trim().min(1).max(320)).max(500).default([]),
|
|
362
587
|
}).strict().superRefine((value, ctx) => {
|
|
363
588
|
if (Boolean(value.tenantId) === Boolean(value.externalTenantId)) {
|
|
364
589
|
ctx.addIssue({
|
|
@@ -366,11 +591,29 @@ export const memoryConnectedSourcePreviewInputSchema = z.object({
|
|
|
366
591
|
message: 'Provide exactly one of tenantId or externalTenantId.',
|
|
367
592
|
});
|
|
368
593
|
}
|
|
594
|
+
if (value.sourceFamilyKey === 'slack.conversations' && value.authorizationPerspective === 'provider_default') {
|
|
595
|
+
ctx.addIssue({
|
|
596
|
+
code: z.ZodIssueCode.custom,
|
|
597
|
+
path: ['authorizationPerspective'],
|
|
598
|
+
message: 'Slack Memory previews must pin authorizationPerspective to bot or user.',
|
|
599
|
+
});
|
|
600
|
+
}
|
|
601
|
+
validateSlackOperationalActorControls(value, ctx);
|
|
369
602
|
});
|
|
370
603
|
export const memoryConnectedSourceSettingsInputSchema = z.object({
|
|
371
604
|
resourceIds: z.array(z.string().trim().min(1).max(320)).max(1000),
|
|
372
605
|
targets: z.array(memorySubjectRefSchema).min(1).max(20),
|
|
373
606
|
existingContent: memoryConnectedSourceBackfillRangeSchema,
|
|
607
|
+
includeAttachments: z.boolean().default(false),
|
|
608
|
+
includeFileContent: z.boolean().default(false),
|
|
609
|
+
includeEmailBodies: z.boolean().default(false),
|
|
610
|
+
includeConversationTranscripts: z.boolean().default(false),
|
|
611
|
+
includeCallActivity: z.boolean().default(false),
|
|
612
|
+
includePrivateConversations: z.boolean().default(false),
|
|
613
|
+
includeExternalConversations: z.boolean().default(false),
|
|
614
|
+
includeBotMessages: z.boolean().default(false),
|
|
615
|
+
approvedOperationalActorCanonicalKeys: z.array(z.string().trim().min(1).max(320)).max(100).default([]),
|
|
616
|
+
excludedActorCanonicalKeys: z.array(z.string().trim().min(1).max(320)).max(500).default([]),
|
|
374
617
|
rememberInstructions: z.string().trim().max(4000),
|
|
375
618
|
excludeInstructions: z.string().trim().max(4000),
|
|
376
619
|
allowedMemoryTypes: z.array(z.enum(memoryTypes)).max(memoryTypes.length),
|
|
@@ -383,6 +626,9 @@ export const memorySourceBindingUpdateInputSchema = z.object({
|
|
|
383
626
|
}).strict().refine((value) => value.status !== undefined || value.connectedSource !== undefined, {
|
|
384
627
|
message: 'Provide a source status or complete connected-source settings.',
|
|
385
628
|
});
|
|
629
|
+
export const memorySourceRemovalInputSchema = z.object({
|
|
630
|
+
learnedRecords: z.enum(['retain', 'forget', 'erase']),
|
|
631
|
+
}).strict();
|
|
386
632
|
export const memoryProcessSourceJobType = 'memory_process_source';
|
|
387
633
|
export const memoryNormalizeRichSourceJobType = 'memory_normalize_rich_source';
|
|
388
634
|
export const memoryRebuildProfileJobType = 'memory_rebuild_profile';
|
|
@@ -458,42 +704,8 @@ export const memoryPolicyPreviewInputSchema = z.object({
|
|
|
458
704
|
language: z.string().trim().min(1).max(80).optional(),
|
|
459
705
|
policy: memoryProjectPolicyInputSchema.omit({ key: true }).default({}),
|
|
460
706
|
}).strict();
|
|
461
|
-
export const stacklinkPlatformEventTypes = [
|
|
462
|
-
'provider.resource.created',
|
|
463
|
-
'provider.resource.updated',
|
|
464
|
-
'provider.resource.deleted',
|
|
465
|
-
'tool.execution.completed',
|
|
466
|
-
'conversation.turn.completed',
|
|
467
|
-
'artifact.created',
|
|
468
|
-
];
|
|
469
|
-
export const stacklinkPlatformEventSchema = z.object({
|
|
470
|
-
id: z.string().uuid(),
|
|
471
|
-
schemaVersion: z.literal('stacklink.event.v1'),
|
|
472
|
-
consumerAppId: z.string().uuid(),
|
|
473
|
-
tenantId: z.string().uuid(),
|
|
474
|
-
sessionId: z.string().uuid().optional(),
|
|
475
|
-
userId: z.string().uuid().optional(),
|
|
476
|
-
type: z.enum(stacklinkPlatformEventTypes),
|
|
477
|
-
source: z.object({
|
|
478
|
-
kind: z.enum(['provider', 'tool_execution', 'conversation', 'artifact']),
|
|
479
|
-
providerKey: z.string().trim().min(1).max(120).optional(),
|
|
480
|
-
connectedAccountId: z.string().uuid().optional(),
|
|
481
|
-
resourceType: z.string().trim().min(1).max(120).optional(),
|
|
482
|
-
resourceId: z.string().trim().min(1).max(320).optional(),
|
|
483
|
-
resourcePreviousScopeIds: z.array(z.string().trim().min(1).max(320)).max(1000).optional(),
|
|
484
|
-
resourceCurrentScopeIds: z.array(z.string().trim().min(1).max(320)).max(1000).optional(),
|
|
485
|
-
resourceAffectedScopeIds: z.array(z.string().trim().min(1).max(320)).max(1000).optional(),
|
|
486
|
-
toolExecutionId: z.string().uuid().optional(),
|
|
487
|
-
applicationKey: z.string().trim().min(1).max(160).optional(),
|
|
488
|
-
}).strict(),
|
|
489
|
-
occurredAt: z.string().datetime(),
|
|
490
|
-
observedAt: z.string().datetime(),
|
|
491
|
-
payloadRef: z.string().trim().min(1).max(2000).optional(),
|
|
492
|
-
data: z.record(z.unknown()),
|
|
493
|
-
metadata: z.record(z.unknown()),
|
|
494
|
-
}).strict();
|
|
495
707
|
export const memorySessionConfigSchema = z.object({
|
|
496
|
-
enabled: z.boolean().default(
|
|
708
|
+
enabled: z.boolean().default(true),
|
|
497
709
|
agentExternalId: z.string().trim().min(1).max(220).optional(),
|
|
498
710
|
readableSubjects: z.array(z.enum(['session_user', 'session_agent', 'tenant_shared'])).max(3).default(['session_user']),
|
|
499
711
|
writableSubjects: z.array(z.enum(['session_user', 'session_agent', 'tenant_shared'])).max(3).default(['session_user']),
|
|
@@ -534,6 +746,7 @@ const memoryExtractedNullableDateTimeSchema = z.preprocess((value) => {
|
|
|
534
746
|
}, z.string().datetime().nullable());
|
|
535
747
|
export const memoryExtractedClaimSchema = z.object({
|
|
536
748
|
subjectEntityKey: z.string().trim().min(1).max(320),
|
|
749
|
+
assertedByEntityKey: z.string().trim().min(1).max(320).nullable(),
|
|
537
750
|
predicate: z.string().trim().min(1).max(120),
|
|
538
751
|
objectEntityKey: z.string().trim().min(1).max(320).nullable(),
|
|
539
752
|
literalValue: z.unknown().nullable(),
|
|
@@ -571,6 +784,16 @@ export const memoryExtractedRecordSchema = z.object({
|
|
|
571
784
|
sensitivityClass: z.enum(memorySensitivityClasses),
|
|
572
785
|
restrictedDataClasses: z.array(z.enum(memoryRestrictedDataClasses)).max(memoryRestrictedDataClasses.length),
|
|
573
786
|
topicTags: z.array(z.string().trim().min(1).max(120)).max(50),
|
|
787
|
+
actorEntityKey: z.string().trim().min(1).max(320).nullable(),
|
|
788
|
+
subjectEntityKey: z.string().trim().min(1).max(320).nullable(),
|
|
789
|
+
authorshipClass: z.enum(memoryAuthorshipClasses),
|
|
790
|
+
admissionBasis: z.enum(memoryAdmissionBases),
|
|
791
|
+
durability: z.enum(memoryDurabilities),
|
|
792
|
+
salience: z.enum(memoryQualityRatingClasses),
|
|
793
|
+
evidenceConfidence: z.enum(memoryQualityRatingClasses),
|
|
794
|
+
destination: z.enum(memoryDestinations),
|
|
795
|
+
contextEligible: z.boolean(),
|
|
796
|
+
qualityContractVersion: z.literal(memoryQualityContractVersion),
|
|
574
797
|
validFrom: memoryExtractedNullableDateTimeSchema,
|
|
575
798
|
validTo: memoryExtractedNullableDateTimeSchema,
|
|
576
799
|
evidence: z.array(memoryEvidenceSpanSchema).min(1).max(5),
|
|
@@ -578,17 +801,38 @@ export const memoryExtractedRecordSchema = z.object({
|
|
|
578
801
|
claims: z.array(memoryExtractedClaimSchema).max(100),
|
|
579
802
|
attributes: z.record(z.unknown()),
|
|
580
803
|
}).strict().superRefine((value, ctx) => {
|
|
804
|
+
if (value.destination === 'durable_memory' && value.durability !== 'durable') {
|
|
805
|
+
ctx.addIssue({ code: z.ZodIssueCode.custom, path: ['durability'], message: 'durable_memory requires durable durability.' });
|
|
806
|
+
}
|
|
807
|
+
if (value.destination === 'episodic_memory' && value.durability !== 'episodic') {
|
|
808
|
+
ctx.addIssue({ code: z.ZodIssueCode.custom, path: ['durability'], message: 'episodic_memory requires episodic durability.' });
|
|
809
|
+
}
|
|
810
|
+
if (value.contextEligible !== (value.destination === 'durable_memory' || value.destination === 'episodic_memory')) {
|
|
811
|
+
ctx.addIssue({ code: z.ZodIssueCode.custom, path: ['contextEligible'], message: 'Only durable_memory and episodic_memory are context eligible.' });
|
|
812
|
+
}
|
|
581
813
|
validateTemporalInterval({
|
|
582
814
|
validFrom: value.validFrom ?? undefined,
|
|
583
815
|
validTo: value.validTo ?? undefined,
|
|
584
816
|
}, ctx);
|
|
585
817
|
const entityKeys = new Set(value.entities.map((entity) => entity.key));
|
|
818
|
+
for (const [path, entityKey] of [
|
|
819
|
+
['actorEntityKey', value.actorEntityKey],
|
|
820
|
+
['subjectEntityKey', value.subjectEntityKey],
|
|
821
|
+
]) {
|
|
822
|
+
if (entityKey && !entityKeys.has(entityKey)) {
|
|
823
|
+
ctx.addIssue({
|
|
824
|
+
code: z.ZodIssueCode.custom,
|
|
825
|
+
path: [path],
|
|
826
|
+
message: `${path} must reference an entity in the same candidate.`,
|
|
827
|
+
});
|
|
828
|
+
}
|
|
829
|
+
}
|
|
586
830
|
for (const [index, claim] of value.claims.entries()) {
|
|
587
831
|
if (!entityKeys.has(claim.subjectEntityKey)) {
|
|
588
832
|
ctx.addIssue({
|
|
589
833
|
code: z.ZodIssueCode.custom,
|
|
590
834
|
path: ['claims', index, 'subjectEntityKey'],
|
|
591
|
-
message:
|
|
835
|
+
message: `Claim subjectEntityKey must reference an entity in the same candidate. ${JSON.stringify(claim.subjectEntityKey)} is not in this record's declared entity keys ${JSON.stringify([...entityKeys])}. Use claims: [] when entities is empty; otherwise use an exact declared key.`,
|
|
592
836
|
});
|
|
593
837
|
}
|
|
594
838
|
if (claim.objectEntityKey && !entityKeys.has(claim.objectEntityKey)) {
|
|
@@ -598,14 +842,23 @@ export const memoryExtractedRecordSchema = z.object({
|
|
|
598
842
|
message: 'Claim objectEntityKey must reference an entity in the same candidate.',
|
|
599
843
|
});
|
|
600
844
|
}
|
|
845
|
+
if (claim.assertedByEntityKey && !entityKeys.has(claim.assertedByEntityKey)) {
|
|
846
|
+
ctx.addIssue({
|
|
847
|
+
code: z.ZodIssueCode.custom,
|
|
848
|
+
path: ['claims', index, 'assertedByEntityKey'],
|
|
849
|
+
message: 'Claim assertedByEntityKey must reference an entity in the same candidate.',
|
|
850
|
+
});
|
|
851
|
+
}
|
|
601
852
|
}
|
|
602
853
|
});
|
|
603
854
|
export const memoryExtractionResultSchema = z.object({
|
|
604
855
|
records: z.array(memoryExtractedRecordSchema).max(100),
|
|
605
856
|
}).strict();
|
|
606
857
|
export const memorySafetyDecisionSchema = z.object({
|
|
858
|
+
authorshipStatus: z.enum(['verified_sender_text', 'quoted_or_forwarded', 'uncertain']).optional(),
|
|
607
859
|
candidateId: z.string().trim().min(1).max(120),
|
|
608
860
|
status: z.enum(['classified', 'uncertain']),
|
|
861
|
+
retentionStatus: z.enum(memoryRetentionAdmissionStatuses),
|
|
609
862
|
sensitivityClass: z.enum(memorySensitivityClasses),
|
|
610
863
|
restrictedDataClasses: z.array(z.enum(memoryRestrictedDataClasses)).max(memoryRestrictedDataClasses.length),
|
|
611
864
|
reason: z.string().trim().min(1).max(1000),
|
|
@@ -697,15 +950,17 @@ export const memoryExtractionJsonSchema = {
|
|
|
697
950
|
required: [
|
|
698
951
|
'candidateId', 'recordKind', 'memoryType', 'title', 'content', 'language',
|
|
699
952
|
'sensitivityClass', 'restrictedDataClasses', 'topicTags', 'validFrom', 'validTo',
|
|
700
|
-
'
|
|
953
|
+
'actorEntityKey', 'subjectEntityKey', 'authorshipClass', 'admissionBasis',
|
|
954
|
+
'durability', 'salience', 'evidenceConfidence', 'destination', 'contextEligible',
|
|
955
|
+
'qualityContractVersion', 'evidence', 'entities', 'claims', 'attributes',
|
|
701
956
|
],
|
|
702
957
|
properties: {
|
|
703
|
-
candidateId: { type: 'string' },
|
|
958
|
+
candidateId: { type: 'string', minLength: 1, maxLength: 120 },
|
|
704
959
|
recordKind: { type: 'string', enum: [...memoryAutomaticRecordKinds] },
|
|
705
960
|
memoryType: { type: 'string', enum: [...memoryTypes] },
|
|
706
|
-
title: { type: 'string' },
|
|
707
|
-
content: { type: 'string' },
|
|
708
|
-
language: { type: 'string' },
|
|
961
|
+
title: { type: 'string', minLength: 1, maxLength: 260 },
|
|
962
|
+
content: { type: 'string', minLength: 1, maxLength: 200_000 },
|
|
963
|
+
language: { type: 'string', minLength: 1, maxLength: 80 },
|
|
709
964
|
sensitivityClass: { type: 'string', enum: [...memorySensitivityClasses] },
|
|
710
965
|
restrictedDataClasses: {
|
|
711
966
|
type: 'array',
|
|
@@ -717,6 +972,22 @@ export const memoryExtractionJsonSchema = {
|
|
|
717
972
|
maxItems: 50,
|
|
718
973
|
items: { type: 'string' },
|
|
719
974
|
},
|
|
975
|
+
actorEntityKey: {
|
|
976
|
+
type: ['string', 'null'], minLength: 1, maxLength: 320,
|
|
977
|
+
description: 'When non-null, must exactly match an entities[].key in this same record.',
|
|
978
|
+
},
|
|
979
|
+
subjectEntityKey: {
|
|
980
|
+
type: ['string', 'null'], minLength: 1, maxLength: 320,
|
|
981
|
+
description: 'When non-null, must exactly match an entities[].key in this same record.',
|
|
982
|
+
},
|
|
983
|
+
authorshipClass: { type: 'string', enum: [...memoryAuthorshipClasses] },
|
|
984
|
+
admissionBasis: { type: 'string', enum: [...memoryAdmissionBases] },
|
|
985
|
+
durability: { type: 'string', enum: [...memoryDurabilities] },
|
|
986
|
+
salience: { type: 'string', enum: [...memoryQualityRatingClasses] },
|
|
987
|
+
evidenceConfidence: { type: 'string', enum: [...memoryQualityRatingClasses] },
|
|
988
|
+
destination: { type: 'string', enum: [...memoryDestinations] },
|
|
989
|
+
contextEligible: { type: 'boolean' },
|
|
990
|
+
qualityContractVersion: { type: 'integer', const: memoryQualityContractVersion },
|
|
720
991
|
validFrom: { type: ['string', 'null'], format: 'date-time' },
|
|
721
992
|
validTo: { type: ['string', 'null'], format: 'date-time' },
|
|
722
993
|
evidence: {
|
|
@@ -728,48 +999,47 @@ export const memoryExtractionJsonSchema = {
|
|
|
728
999
|
additionalProperties: false,
|
|
729
1000
|
required: ['sourceObjectId', 'segmentId', 'startOffset', 'endOffset', 'quotedText'],
|
|
730
1001
|
properties: {
|
|
731
|
-
sourceObjectId: { type: 'string' },
|
|
732
|
-
segmentId: { type: 'string' },
|
|
1002
|
+
sourceObjectId: { type: 'string', minLength: 1, maxLength: 320 },
|
|
1003
|
+
segmentId: { type: 'string', minLength: 1, maxLength: 80 },
|
|
733
1004
|
startOffset: { type: 'integer', minimum: 0 },
|
|
734
1005
|
endOffset: { type: 'integer', minimum: 1 },
|
|
735
|
-
quotedText: { type: 'string' },
|
|
1006
|
+
quotedText: { type: 'string', minLength: 1, maxLength: 20_000 },
|
|
736
1007
|
},
|
|
737
1008
|
},
|
|
738
1009
|
},
|
|
739
1010
|
entities: {
|
|
740
|
-
type: 'array',
|
|
1011
|
+
type: 'array', maxItems: 50,
|
|
741
1012
|
description: 'Entities used by this record. Every entity key referenced by this record claims must be declared in this same array.',
|
|
742
1013
|
items: {
|
|
743
1014
|
type: 'object',
|
|
744
1015
|
additionalProperties: false,
|
|
745
1016
|
required: ['key', 'type', 'canonicalKey', 'displayName', 'attributes'],
|
|
746
1017
|
properties: {
|
|
747
|
-
key: { type: 'string', description: 'A key unique within this record and used by this record claims.' },
|
|
748
|
-
type: { type: 'string' },
|
|
749
|
-
canonicalKey: { type: 'string' },
|
|
750
|
-
displayName: { type: ['string', 'null'] },
|
|
751
|
-
attributes: { type: 'object', additionalProperties:
|
|
1018
|
+
key: { type: 'string', minLength: 1, maxLength: 320, description: 'A key unique within this record and used by this record claims.' },
|
|
1019
|
+
type: { type: 'string', minLength: 1, maxLength: 80 },
|
|
1020
|
+
canonicalKey: { type: 'string', minLength: 1, maxLength: 320 },
|
|
1021
|
+
displayName: { type: ['string', 'null'], minLength: 1, maxLength: 320 },
|
|
1022
|
+
attributes: { type: 'object', properties: {}, additionalProperties: false, description: 'Use the declared entity fields; source metadata is attached by the runtime.' },
|
|
752
1023
|
},
|
|
753
1024
|
},
|
|
754
1025
|
},
|
|
755
1026
|
claims: {
|
|
756
|
-
type: 'array',
|
|
1027
|
+
type: 'array', maxItems: 100,
|
|
757
1028
|
description: 'Claims for this record. Entity references may only use keys declared in this same record entities array.',
|
|
758
1029
|
items: {
|
|
759
1030
|
type: 'object',
|
|
760
1031
|
additionalProperties: false,
|
|
761
|
-
required: ['subjectEntityKey', 'predicate', 'objectEntityKey', 'literalValue', 'validFrom', 'validTo'],
|
|
1032
|
+
required: ['subjectEntityKey', 'assertedByEntityKey', 'predicate', 'objectEntityKey', 'literalValue', 'validFrom', 'validTo'],
|
|
762
1033
|
properties: {
|
|
763
|
-
subjectEntityKey: { type: 'string', description: 'Must exactly match an entities[].key in this same record.' },
|
|
764
|
-
|
|
765
|
-
|
|
1034
|
+
subjectEntityKey: { type: 'string', minLength: 1, maxLength: 320, description: 'Must exactly match an entities[].key in this same record.' },
|
|
1035
|
+
assertedByEntityKey: { type: ['string', 'null'], minLength: 1, maxLength: 320, description: 'When non-null, must exactly match an entities[].key in this same record.' },
|
|
1036
|
+
predicate: { type: 'string', minLength: 1, maxLength: 120 },
|
|
1037
|
+
objectEntityKey: { type: ['string', 'null'], minLength: 1, maxLength: 320, description: 'When non-null, must exactly match an entities[].key in this same record.' },
|
|
766
1038
|
literalValue: {
|
|
767
1039
|
anyOf: [
|
|
768
1040
|
{ type: 'string' },
|
|
769
1041
|
{ type: 'number' },
|
|
770
1042
|
{ type: 'boolean' },
|
|
771
|
-
{ type: 'object' },
|
|
772
|
-
{ type: 'array' },
|
|
773
1043
|
{ type: 'null' },
|
|
774
1044
|
],
|
|
775
1045
|
},
|
|
@@ -778,7 +1048,7 @@ export const memoryExtractionJsonSchema = {
|
|
|
778
1048
|
},
|
|
779
1049
|
},
|
|
780
1050
|
},
|
|
781
|
-
attributes: { type: 'object', additionalProperties:
|
|
1051
|
+
attributes: { type: 'object', properties: {}, additionalProperties: false, description: 'Use the declared memory fields; source metadata is attached by the runtime.' },
|
|
782
1052
|
},
|
|
783
1053
|
},
|
|
784
1054
|
},
|
|
@@ -795,10 +1065,11 @@ export const memorySafetyJsonSchema = {
|
|
|
795
1065
|
items: {
|
|
796
1066
|
type: 'object',
|
|
797
1067
|
additionalProperties: false,
|
|
798
|
-
required: ['candidateId', 'status', 'sensitivityClass', 'restrictedDataClasses', 'reason'],
|
|
1068
|
+
required: ['candidateId', 'status', 'retentionStatus', 'sensitivityClass', 'restrictedDataClasses', 'reason'],
|
|
799
1069
|
properties: {
|
|
800
1070
|
candidateId: { type: 'string' },
|
|
801
1071
|
status: { type: 'string', enum: ['classified', 'uncertain'] },
|
|
1072
|
+
retentionStatus: { type: 'string', enum: [...memoryRetentionAdmissionStatuses] },
|
|
802
1073
|
sensitivityClass: { type: 'string', enum: [...memorySensitivityClasses] },
|
|
803
1074
|
restrictedDataClasses: {
|
|
804
1075
|
type: 'array',
|