@lssm/lib.communication-spec 3.1.1
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 +201 -0
- package/dist/browser/capabilities/comms-ai.capabilities.js +1 -0
- package/dist/browser/capabilities/communication-os.capability-ids.js +1 -0
- package/dist/browser/capabilities/ecosystem-messaging.capabilities.js +1 -0
- package/dist/browser/capabilities/index.js +1 -0
- package/dist/browser/commands/comms-ai.commands.js +1 -0
- package/dist/browser/commands/index.js +1 -0
- package/dist/browser/contracts/agent-communication.js +1 -0
- package/dist/browser/contracts/agent-lifecycle-projection.js +1 -0
- package/dist/browser/contracts/agent-surface-control.js +1 -0
- package/dist/browser/contracts/ai-assistance.operations.js +1 -0
- package/dist/browser/contracts/artifact-digest.js +1 -0
- package/dist/browser/contracts/canonical-agent-conversation.js +1 -0
- package/dist/browser/contracts/channel-preferences.js +1 -0
- package/dist/browser/contracts/channel-routing.js +1 -0
- package/dist/browser/contracts/collaboration.operations.js +1 -0
- package/dist/browser/contracts/customer-live-chat-grant.operations.js +1 -0
- package/dist/browser/contracts/delivery-eligibility.js +1 -0
- package/dist/browser/contracts/delivery-fallback-eligibility-validation.js +1 -0
- package/dist/browser/contracts/delivery-fallback-validation.js +1 -0
- package/dist/browser/contracts/delivery-fallback.js +1 -0
- package/dist/browser/contracts/delivery-intent-validation.js +1 -0
- package/dist/browser/contracts/delivery-intent.js +1 -0
- package/dist/browser/contracts/delivery-progress.js +1 -0
- package/dist/browser/contracts/discord-community-intelligence.operations.js +1 -0
- package/dist/browser/contracts/discord-community.events.js +1 -0
- package/dist/browser/contracts/discord-community.models.js +1 -0
- package/dist/browser/contracts/discord-community.operations.js +1 -0
- package/dist/browser/contracts/ecosystem-attachment.operations.js +1 -0
- package/dist/browser/contracts/ecosystem-auth.operations.js +1 -0
- package/dist/browser/contracts/ecosystem-binding.operations.js +1 -0
- package/dist/browser/contracts/ecosystem-connection-subscription.events.js +1 -0
- package/dist/browser/contracts/ecosystem-governed-work-v2.operations.js +1 -0
- package/dist/browser/contracts/ecosystem-governed-work.operations.js +1 -0
- package/dist/browser/contracts/ecosystem-identity-v3.operations.js +1 -0
- package/dist/browser/contracts/ecosystem-identity.operations.js +1 -0
- package/dist/browser/contracts/ecosystem-message.operations.js +1 -0
- package/dist/browser/contracts/ecosystem-messaging.dtos.js +0 -0
- package/dist/browser/contracts/ecosystem-messaging.events.js +1 -0
- package/dist/browser/contracts/ecosystem-messaging.models.js +1 -0
- package/dist/browser/contracts/ecosystem-navigation-v3.operations.js +1 -0
- package/dist/browser/contracts/ecosystem-webhook.operations.js +1 -0
- package/dist/browser/contracts/ecosystem-workspace.operations.js +1 -0
- package/dist/browser/contracts/enums.js +1 -0
- package/dist/browser/contracts/erasure.operations.js +1 -0
- package/dist/browser/contracts/events.js +1 -0
- package/dist/browser/contracts/index.js +1 -0
- package/dist/browser/contracts/ingestion.js +1 -0
- package/dist/browser/contracts/ingress-admission-policy.js +1 -0
- package/dist/browser/contracts/ingress-admission.js +1 -0
- package/dist/browser/contracts/models.js +1 -0
- package/dist/browser/contracts/operations.js +1 -0
- package/dist/browser/contracts/persistence.js +1 -0
- package/dist/browser/contracts/preference-resolution.js +1 -0
- package/dist/browser/contracts/query.operations.js +1 -0
- package/dist/browser/contracts/sequence-intent.js +1 -0
- package/dist/browser/contracts/sovereignty.js +1 -0
- package/dist/browser/contracts/support-internal-note.operations.js +1 -0
- package/dist/browser/contracts/thread-link-kind.js +1 -0
- package/dist/browser/contracts/thread-message.operations.js +1 -0
- package/dist/browser/events/index.js +1 -0
- package/dist/browser/fixtures/agent-omnichannel-primitives.js +1 -0
- package/dist/browser/fixtures/agent-omnichannel.js +1 -0
- package/dist/browser/fixtures/gtm-learning-loop-neutral.parts.js +1 -0
- package/dist/browser/fixtures/index.js +1 -0
- package/dist/browser/fixtures/normalized-ingestion.js +1 -0
- package/dist/browser/index.js +1 -0
- package/dist/browser/queries/index.js +1 -0
- package/dist/browser/types/domain-command.js +0 -0
- package/dist/browser/types/index.js +1 -0
- package/dist/browser/validation/domain-command.js +1 -0
- package/dist/browser/validation/index.js +1 -0
- package/dist/capabilities/comms-ai.capabilities.d.ts +72 -0
- package/dist/capabilities/comms-ai.capabilities.js +2 -0
- package/dist/capabilities/communication-os-capability-boundary.test.d.ts +1 -0
- package/dist/capabilities/communication-os.capability-ids.d.ts +39 -0
- package/dist/capabilities/communication-os.capability-ids.js +2 -0
- package/dist/capabilities/communication-os.capability-ids.test.d.ts +1 -0
- package/dist/capabilities/ecosystem-messaging.capabilities.d.ts +9 -0
- package/dist/capabilities/ecosystem-messaging.capabilities.js +2 -0
- package/dist/capabilities/index.d.ts +4 -0
- package/dist/capabilities/index.js +2 -0
- package/dist/commands/comms-ai.commands.d.ts +272 -0
- package/dist/commands/comms-ai.commands.js +2 -0
- package/dist/commands/index.d.ts +10 -0
- package/dist/commands/index.js +2 -0
- package/dist/contracts/agent-communication.d.ts +108 -0
- package/dist/contracts/agent-communication.js +2 -0
- package/dist/contracts/agent-communication.test.d.ts +1 -0
- package/dist/contracts/agent-lifecycle-projection.d.ts +98 -0
- package/dist/contracts/agent-lifecycle-projection.js +2 -0
- package/dist/contracts/agent-lifecycle-projection.test.d.ts +1 -0
- package/dist/contracts/agent-surface-control.d.ts +210 -0
- package/dist/contracts/agent-surface-control.js +2 -0
- package/dist/contracts/agent-surface-control.test.d.ts +1 -0
- package/dist/contracts/ai-assistance.operations.d.ts +187 -0
- package/dist/contracts/ai-assistance.operations.js +2 -0
- package/dist/contracts/artifact-digest.d.ts +3 -0
- package/dist/contracts/artifact-digest.js +2 -0
- package/dist/contracts/canonical-agent-conversation.d.ts +46 -0
- package/dist/contracts/canonical-agent-conversation.js +2 -0
- package/dist/contracts/canonical-agent-conversation.test.d.ts +1 -0
- package/dist/contracts/channel-preferences.d.ts +115 -0
- package/dist/contracts/channel-preferences.js +2 -0
- package/dist/contracts/channel-routing.d.ts +58 -0
- package/dist/contracts/channel-routing.js +2 -0
- package/dist/contracts/channel-routing.test.d.ts +1 -0
- package/dist/contracts/collaboration.operations.d.ts +315 -0
- package/dist/contracts/collaboration.operations.js +2 -0
- package/dist/contracts/customer-live-chat-grant.operations.d.ts +132 -0
- package/dist/contracts/customer-live-chat-grant.operations.js +2 -0
- package/dist/contracts/delivery-contracts.test.d.ts +1 -0
- package/dist/contracts/delivery-eligibility.d.ts +126 -0
- package/dist/contracts/delivery-eligibility.js +2 -0
- package/dist/contracts/delivery-eligibility.test.d.ts +1 -0
- package/dist/contracts/delivery-fallback-eligibility-validation.d.ts +6 -0
- package/dist/contracts/delivery-fallback-eligibility-validation.js +2 -0
- package/dist/contracts/delivery-fallback-validation.d.ts +24 -0
- package/dist/contracts/delivery-fallback-validation.js +2 -0
- package/dist/contracts/delivery-fallback.d.ts +117 -0
- package/dist/contracts/delivery-fallback.js +2 -0
- package/dist/contracts/delivery-intent-validation.d.ts +13 -0
- package/dist/contracts/delivery-intent-validation.js +2 -0
- package/dist/contracts/delivery-intent.d.ts +137 -0
- package/dist/contracts/delivery-intent.js +2 -0
- package/dist/contracts/delivery-progress.d.ts +61 -0
- package/dist/contracts/delivery-progress.js +2 -0
- package/dist/contracts/discord-community-intelligence.operations.d.ts +405 -0
- package/dist/contracts/discord-community-intelligence.operations.js +2 -0
- package/dist/contracts/discord-community.events.d.ts +162 -0
- package/dist/contracts/discord-community.events.js +2 -0
- package/dist/contracts/discord-community.models.d.ts +167 -0
- package/dist/contracts/discord-community.models.js +2 -0
- package/dist/contracts/discord-community.operations.d.ts +663 -0
- package/dist/contracts/discord-community.operations.js +2 -0
- package/dist/contracts/discord-community.test.d.ts +1 -0
- package/dist/contracts/ecosystem-attachment.operations.d.ts +129 -0
- package/dist/contracts/ecosystem-attachment.operations.js +2 -0
- package/dist/contracts/ecosystem-auth.operations.d.ts +345 -0
- package/dist/contracts/ecosystem-auth.operations.js +2 -0
- package/dist/contracts/ecosystem-binding.operations.d.ts +231 -0
- package/dist/contracts/ecosystem-binding.operations.js +2 -0
- package/dist/contracts/ecosystem-connection-subscription.events.d.ts +332 -0
- package/dist/contracts/ecosystem-connection-subscription.events.js +2 -0
- package/dist/contracts/ecosystem-governed-work-v2.operations.d.ts +234 -0
- package/dist/contracts/ecosystem-governed-work-v2.operations.js +2 -0
- package/dist/contracts/ecosystem-governed-work.operations.d.ts +265 -0
- package/dist/contracts/ecosystem-governed-work.operations.js +2 -0
- package/dist/contracts/ecosystem-governed-work.operations.test.d.ts +1 -0
- package/dist/contracts/ecosystem-identity-v3.operations.d.ts +65 -0
- package/dist/contracts/ecosystem-identity-v3.operations.js +2 -0
- package/dist/contracts/ecosystem-identity.operations.d.ts +174 -0
- package/dist/contracts/ecosystem-identity.operations.js +2 -0
- package/dist/contracts/ecosystem-identity.operations.test.d.ts +1 -0
- package/dist/contracts/ecosystem-message.operations.d.ts +1092 -0
- package/dist/contracts/ecosystem-message.operations.js +2 -0
- package/dist/contracts/ecosystem-messaging.dtos.d.ts +68 -0
- package/dist/contracts/ecosystem-messaging.dtos.js +1 -0
- package/dist/contracts/ecosystem-messaging.dtos.test.d.ts +1 -0
- package/dist/contracts/ecosystem-messaging.events.d.ts +608 -0
- package/dist/contracts/ecosystem-messaging.events.js +2 -0
- package/dist/contracts/ecosystem-messaging.models.d.ts +386 -0
- package/dist/contracts/ecosystem-messaging.models.js +2 -0
- package/dist/contracts/ecosystem-messaging.test.d.ts +1 -0
- package/dist/contracts/ecosystem-navigation-v3.operations.d.ts +149 -0
- package/dist/contracts/ecosystem-navigation-v3.operations.js +2 -0
- package/dist/contracts/ecosystem-webhook.operations.d.ts +187 -0
- package/dist/contracts/ecosystem-webhook.operations.js +2 -0
- package/dist/contracts/ecosystem-workspace.operations.d.ts +590 -0
- package/dist/contracts/ecosystem-workspace.operations.js +2 -0
- package/dist/contracts/enums.d.ts +9 -0
- package/dist/contracts/enums.js +2 -0
- package/dist/contracts/erasure.operations.d.ts +114 -0
- package/dist/contracts/erasure.operations.js +2 -0
- package/dist/contracts/erasure.test.d.ts +1 -0
- package/dist/contracts/events.d.ts +174 -0
- package/dist/contracts/events.js +2 -0
- package/dist/contracts/index.d.ts +43 -0
- package/dist/contracts/index.js +2 -0
- package/dist/contracts/ingestion.d.ts +169 -0
- package/dist/contracts/ingestion.js +2 -0
- package/dist/contracts/ingress-admission-policy.d.ts +14 -0
- package/dist/contracts/ingress-admission-policy.js +2 -0
- package/dist/contracts/ingress-admission.d.ts +184 -0
- package/dist/contracts/ingress-admission.js +2 -0
- package/dist/contracts/ingress-admission.test.d.ts +1 -0
- package/dist/contracts/models.d.ts +851 -0
- package/dist/contracts/models.js +2 -0
- package/dist/contracts/operations.d.ts +5 -0
- package/dist/contracts/operations.js +2 -0
- package/dist/contracts/persistence.d.ts +353 -0
- package/dist/contracts/persistence.js +2 -0
- package/dist/contracts/persistence.test.d.ts +1 -0
- package/dist/contracts/preference-resolution.d.ts +154 -0
- package/dist/contracts/preference-resolution.js +2 -0
- package/dist/contracts/preference-resolution.test.d.ts +1 -0
- package/dist/contracts/query.operations.d.ts +600 -0
- package/dist/contracts/query.operations.js +2 -0
- package/dist/contracts/sequence-intent.d.ts +103 -0
- package/dist/contracts/sequence-intent.js +2 -0
- package/dist/contracts/sequence-intent.test.d.ts +1 -0
- package/dist/contracts/sovereignty.d.ts +164 -0
- package/dist/contracts/sovereignty.js +2 -0
- package/dist/contracts/support-internal-note.operations.d.ts +309 -0
- package/dist/contracts/support-internal-note.operations.js +2 -0
- package/dist/contracts/support-internal-note.operations.test.d.ts +1 -0
- package/dist/contracts/thread-link-kind.d.ts +20 -0
- package/dist/contracts/thread-link-kind.js +2 -0
- package/dist/contracts/thread-message.operations.d.ts +485 -0
- package/dist/contracts/thread-message.operations.js +2 -0
- package/dist/events/index.d.ts +4 -0
- package/dist/events/index.js +2 -0
- package/dist/fixtures/agent-omnichannel-primitives.d.ts +240 -0
- package/dist/fixtures/agent-omnichannel-primitives.js +2 -0
- package/dist/fixtures/agent-omnichannel.d.ts +682 -0
- package/dist/fixtures/agent-omnichannel.js +2 -0
- package/dist/fixtures/agent-omnichannel.test.d.ts +1 -0
- package/dist/fixtures/gtm-learning-loop-neutral.parts.d.ts +20 -0
- package/dist/fixtures/gtm-learning-loop-neutral.parts.js +2 -0
- package/dist/fixtures/index.d.ts +3 -0
- package/dist/fixtures/index.js +2 -0
- package/dist/fixtures/normalized-ingestion.d.ts +102 -0
- package/dist/fixtures/normalized-ingestion.js +2 -0
- package/dist/fixtures/normalized-ingestion.test.d.ts +1 -0
- package/dist/index.d.ts +7 -0
- package/dist/index.js +2 -0
- package/dist/node/capabilities/comms-ai.capabilities.js +1 -0
- package/dist/node/capabilities/communication-os.capability-ids.js +1 -0
- package/dist/node/capabilities/ecosystem-messaging.capabilities.js +1 -0
- package/dist/node/capabilities/index.js +1 -0
- package/dist/node/commands/comms-ai.commands.js +1 -0
- package/dist/node/commands/index.js +1 -0
- package/dist/node/contracts/agent-communication.js +1 -0
- package/dist/node/contracts/agent-lifecycle-projection.js +1 -0
- package/dist/node/contracts/agent-surface-control.js +1 -0
- package/dist/node/contracts/ai-assistance.operations.js +1 -0
- package/dist/node/contracts/artifact-digest.js +1 -0
- package/dist/node/contracts/canonical-agent-conversation.js +1 -0
- package/dist/node/contracts/channel-preferences.js +1 -0
- package/dist/node/contracts/channel-routing.js +1 -0
- package/dist/node/contracts/collaboration.operations.js +1 -0
- package/dist/node/contracts/customer-live-chat-grant.operations.js +1 -0
- package/dist/node/contracts/delivery-eligibility.js +1 -0
- package/dist/node/contracts/delivery-fallback-eligibility-validation.js +1 -0
- package/dist/node/contracts/delivery-fallback-validation.js +1 -0
- package/dist/node/contracts/delivery-fallback.js +1 -0
- package/dist/node/contracts/delivery-intent-validation.js +1 -0
- package/dist/node/contracts/delivery-intent.js +1 -0
- package/dist/node/contracts/delivery-progress.js +1 -0
- package/dist/node/contracts/discord-community-intelligence.operations.js +1 -0
- package/dist/node/contracts/discord-community.events.js +1 -0
- package/dist/node/contracts/discord-community.models.js +1 -0
- package/dist/node/contracts/discord-community.operations.js +1 -0
- package/dist/node/contracts/ecosystem-attachment.operations.js +1 -0
- package/dist/node/contracts/ecosystem-auth.operations.js +1 -0
- package/dist/node/contracts/ecosystem-binding.operations.js +1 -0
- package/dist/node/contracts/ecosystem-connection-subscription.events.js +1 -0
- package/dist/node/contracts/ecosystem-governed-work-v2.operations.js +1 -0
- package/dist/node/contracts/ecosystem-governed-work.operations.js +1 -0
- package/dist/node/contracts/ecosystem-identity-v3.operations.js +1 -0
- package/dist/node/contracts/ecosystem-identity.operations.js +1 -0
- package/dist/node/contracts/ecosystem-message.operations.js +1 -0
- package/dist/node/contracts/ecosystem-messaging.dtos.js +0 -0
- package/dist/node/contracts/ecosystem-messaging.events.js +1 -0
- package/dist/node/contracts/ecosystem-messaging.models.js +1 -0
- package/dist/node/contracts/ecosystem-navigation-v3.operations.js +1 -0
- package/dist/node/contracts/ecosystem-webhook.operations.js +1 -0
- package/dist/node/contracts/ecosystem-workspace.operations.js +1 -0
- package/dist/node/contracts/enums.js +1 -0
- package/dist/node/contracts/erasure.operations.js +1 -0
- package/dist/node/contracts/events.js +1 -0
- package/dist/node/contracts/index.js +1 -0
- package/dist/node/contracts/ingestion.js +1 -0
- package/dist/node/contracts/ingress-admission-policy.js +1 -0
- package/dist/node/contracts/ingress-admission.js +1 -0
- package/dist/node/contracts/models.js +1 -0
- package/dist/node/contracts/operations.js +1 -0
- package/dist/node/contracts/persistence.js +1 -0
- package/dist/node/contracts/preference-resolution.js +1 -0
- package/dist/node/contracts/query.operations.js +1 -0
- package/dist/node/contracts/sequence-intent.js +1 -0
- package/dist/node/contracts/sovereignty.js +1 -0
- package/dist/node/contracts/support-internal-note.operations.js +1 -0
- package/dist/node/contracts/thread-link-kind.js +1 -0
- package/dist/node/contracts/thread-message.operations.js +1 -0
- package/dist/node/events/index.js +1 -0
- package/dist/node/fixtures/agent-omnichannel-primitives.js +1 -0
- package/dist/node/fixtures/agent-omnichannel.js +1 -0
- package/dist/node/fixtures/gtm-learning-loop-neutral.parts.js +1 -0
- package/dist/node/fixtures/index.js +1 -0
- package/dist/node/fixtures/normalized-ingestion.js +1 -0
- package/dist/node/index.js +1 -0
- package/dist/node/queries/index.js +1 -0
- package/dist/node/types/domain-command.js +0 -0
- package/dist/node/types/index.js +1 -0
- package/dist/node/validation/domain-command.js +1 -0
- package/dist/node/validation/index.js +1 -0
- package/dist/package-exports.test.d.ts +1 -0
- package/dist/queries/index.d.ts +4 -0
- package/dist/queries/index.js +2 -0
- package/dist/types/domain-command.d.ts +54 -0
- package/dist/types/domain-command.js +1 -0
- package/dist/types/index.d.ts +3 -0
- package/dist/types/index.js +2 -0
- package/dist/validation/domain-command.d.ts +3 -0
- package/dist/validation/domain-command.js +2 -0
- package/dist/validation/index.d.ts +53 -0
- package/dist/validation/index.js +2 -0
- package/package.json +1227 -0
|
@@ -0,0 +1,98 @@
|
|
|
1
|
+
import type { AgentHelpRequestV1 } from '@lssm/lib.contracts-spec/agent/protocol/help';
|
|
2
|
+
import { z } from 'zod';
|
|
3
|
+
export declare const COMMUNICATION_AGENT_LIFECYCLE_PROJECTION_SCHEMA_VERSION: '1.0.0';
|
|
4
|
+
export declare const CommunicationAgentLifecycleProjectionStatusV1Schema: z.ZodEnum<{
|
|
5
|
+
blocked: "blocked";
|
|
6
|
+
cancelled: "cancelled";
|
|
7
|
+
completed: "completed";
|
|
8
|
+
failed: "failed";
|
|
9
|
+
queued: "queued";
|
|
10
|
+
running: "running";
|
|
11
|
+
waiting_for_approval: "waiting_for_approval";
|
|
12
|
+
waiting_for_help: "waiting_for_help";
|
|
13
|
+
}>;
|
|
14
|
+
/** Immutable communication view of durable agent state; never an effect command. */
|
|
15
|
+
export declare const CommunicationAgentLifecycleProjectionV1Schema: z.ZodObject<{
|
|
16
|
+
schemaVersion: z.ZodLiteral<"1.0.0">;
|
|
17
|
+
projectionRef: z.ZodString;
|
|
18
|
+
projectionDigest: z.ZodString;
|
|
19
|
+
scope: z.ZodObject<{
|
|
20
|
+
tenantRef: z.ZodString;
|
|
21
|
+
workspaceRef: z.ZodOptional<z.ZodString>;
|
|
22
|
+
spaceRef: z.ZodOptional<z.ZodString>;
|
|
23
|
+
subjectRef: z.ZodString;
|
|
24
|
+
}, z.core.$strict>;
|
|
25
|
+
lifecycleLink: z.ZodObject<{
|
|
26
|
+
schemaVersion: z.ZodLiteral<"1.0.0">;
|
|
27
|
+
linkRef: z.ZodString;
|
|
28
|
+
profile: z.ZodObject<{
|
|
29
|
+
ref: z.ZodString;
|
|
30
|
+
digest: z.ZodString;
|
|
31
|
+
revision: z.ZodNumber;
|
|
32
|
+
}, z.core.$strict>;
|
|
33
|
+
agentRef: z.ZodString;
|
|
34
|
+
applicationRef: z.ZodString;
|
|
35
|
+
scope: z.ZodObject<{
|
|
36
|
+
tenantRef: z.ZodString;
|
|
37
|
+
workspaceRef: z.ZodOptional<z.ZodString>;
|
|
38
|
+
spaceRef: z.ZodOptional<z.ZodString>;
|
|
39
|
+
subjectRef: z.ZodString;
|
|
40
|
+
}, z.core.$strict>;
|
|
41
|
+
runRef: z.ZodOptional<z.ZodString>;
|
|
42
|
+
taskRef: z.ZodOptional<z.ZodString>;
|
|
43
|
+
helpRequestRef: z.ZodOptional<z.ZodString>;
|
|
44
|
+
approvalRequestRef: z.ZodOptional<z.ZodString>;
|
|
45
|
+
backgroundResultRef: z.ZodOptional<z.ZodString>;
|
|
46
|
+
canonicalConversation: z.ZodOptional<z.ZodObject<{
|
|
47
|
+
ref: z.ZodString;
|
|
48
|
+
digest: z.ZodString;
|
|
49
|
+
}, z.core.$strict>>;
|
|
50
|
+
session: z.ZodOptional<z.ZodObject<{
|
|
51
|
+
ref: z.ZodString;
|
|
52
|
+
digest: z.ZodString;
|
|
53
|
+
revision: z.ZodNumber;
|
|
54
|
+
}, z.core.$strict>>;
|
|
55
|
+
correlationRef: z.ZodString;
|
|
56
|
+
evidenceRefs: z.ZodArray<z.ZodString>;
|
|
57
|
+
}, z.core.$strict>;
|
|
58
|
+
status: z.ZodEnum<{
|
|
59
|
+
blocked: "blocked";
|
|
60
|
+
cancelled: "cancelled";
|
|
61
|
+
completed: "completed";
|
|
62
|
+
failed: "failed";
|
|
63
|
+
queued: "queued";
|
|
64
|
+
running: "running";
|
|
65
|
+
waiting_for_approval: "waiting_for_approval";
|
|
66
|
+
waiting_for_help: "waiting_for_help";
|
|
67
|
+
}>;
|
|
68
|
+
checkpoint: z.ZodObject<{
|
|
69
|
+
ref: z.ZodString;
|
|
70
|
+
digest: z.ZodString;
|
|
71
|
+
}, z.core.$strict>;
|
|
72
|
+
canonicalConversation: z.ZodOptional<z.ZodObject<{
|
|
73
|
+
ref: z.ZodString;
|
|
74
|
+
digest: z.ZodString;
|
|
75
|
+
}, z.core.$strict>>;
|
|
76
|
+
helpRequest: z.ZodOptional<z.ZodObject<{
|
|
77
|
+
ref: z.ZodString;
|
|
78
|
+
digest: z.ZodString;
|
|
79
|
+
}, z.core.$strict>>;
|
|
80
|
+
approvalRequest: z.ZodOptional<z.ZodObject<{
|
|
81
|
+
ref: z.ZodString;
|
|
82
|
+
digest: z.ZodString;
|
|
83
|
+
}, z.core.$strict>>;
|
|
84
|
+
progressSummaryRef: z.ZodString;
|
|
85
|
+
occurredAt: z.ZodString;
|
|
86
|
+
evidenceRefs: z.ZodArray<z.ZodString>;
|
|
87
|
+
effectAuthority: z.ZodLiteral<"none">;
|
|
88
|
+
}, z.core.$strict>;
|
|
89
|
+
export type CommunicationAgentLifecycleProjectionV1 = z.infer<typeof CommunicationAgentLifecycleProjectionV1Schema>;
|
|
90
|
+
export declare function validateCommunicationAgentLifecycleProjectionV1(input: {
|
|
91
|
+
projection: CommunicationAgentLifecycleProjectionV1;
|
|
92
|
+
helpRequest?: AgentHelpRequestV1;
|
|
93
|
+
}): string[];
|
|
94
|
+
/** Strict G012 binding used by canonical-conversation persistence paths. */
|
|
95
|
+
export declare function validateCanonicalAgentLifecycleProjectionV1(input: {
|
|
96
|
+
projection: CommunicationAgentLifecycleProjectionV1;
|
|
97
|
+
helpRequest?: AgentHelpRequestV1;
|
|
98
|
+
}): string[];
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
// @bun
|
|
2
|
+
import{z as s}from"zod";import{z as c}from"zod";var R="1.0.0",y="1.0.0",q={id:"communication-os.agent-omnichannel.v1",title:"CommunicationOS agent omnichannel contracts",body:"Provider-neutral agent profiles and lifecycle links bind applications, runs, tasks, help requests, background results, routes, preferences, policies, and evidence through opaque references. They grant no provider access or effect authority.",kind:"reference",route:"/docs/communication-os/agent-omnichannel-v1",visibility:"public"},t=c.string().trim().min(1),d=c.string().datetime({offset:!0}),p=c.string().regex(/^sha256:[a-f0-9]{64}$/),r=c.object({ref:t,digest:p}).strict(),a=r.extend({revision:c.number().int().positive()}).strict(),f=c.object({tenantRef:t,workspaceRef:t.optional(),spaceRef:t.optional(),subjectRef:t}).strict(),S=c.object({schemaVersion:c.literal(R),profileRef:t,revision:c.number().int().positive(),agentRef:t,applicationRef:t,scope:f,routeBindings:c.array(a),connectionRefs:c.array(t),preferenceSet:a,policyRefs:c.array(t).min(1),evidenceRefs:c.array(t).min(1),createdAt:d,updatedAt:d,profileDigest:p}).strict().superRefine((e,i)=>{for(let n of["connectionRefs","policyRefs","evidenceRefs"])if(new Set(e[n]).size!==e[n].length)i.addIssue({code:c.ZodIssueCode.custom,path:[n],message:`${n} must be unique`});let o=e.routeBindings.map((n)=>n.ref);if(new Set(o).size!==o.length)i.addIssue({code:c.ZodIssueCode.custom,path:["routeBindings"],message:"route bindings must be unique"})}),g=c.object({schemaVersion:c.literal(y),linkRef:t,profile:a,agentRef:t,applicationRef:t,scope:f,runRef:t.optional(),taskRef:t.optional(),helpRequestRef:t.optional(),approvalRequestRef:t.optional(),backgroundResultRef:t.optional(),canonicalConversation:r.optional(),session:a.optional(),correlationRef:t,evidenceRefs:c.array(t).min(1)}).strict().superRefine((e,i)=>{if(new Set(e.evidenceRefs).size!==e.evidenceRefs.length)i.addIssue({code:c.ZodIssueCode.custom,path:["evidenceRefs"],message:"evidenceRefs must be unique"});if(!e.runRef&&!e.taskRef&&!e.helpRequestRef&&!e.approvalRequestRef&&!e.backgroundResultRef)i.addIssue({code:c.ZodIssueCode.custom,path:["runRef"],message:"at least one run, task, help request, approval request, or background result ref is required"})});function l(e,i){return e.tenantRef===i.tenantRef&&e.workspaceRef===i.workspaceRef&&e.spaceRef===i.spaceRef&&e.subjectRef===i.subjectRef}function k(e){let i=[];for(let o of["agentRef","applicationRef"])if(e.profile[o]!==e.lifecycleLink[o])i.push(`Lifecycle ${o} does not match the agent profile`);if(e.lifecycleLink.profile.ref!==e.profile.profileRef||e.lifecycleLink.profile.revision!==e.profile.revision||e.lifecycleLink.profile.digest!==e.profile.profileDigest)i.push("Lifecycle profile binding does not match the agent profile");if(!l(e.profile.scope,e.lifecycleLink.scope))i.push("Lifecycle scope does not match the agent profile");return i}function b(e){let{intent:i,progress:o}=e,n=[];if(o.deliveryRef!==i.deliveryRef||o.intent.ref!==i.deliveryRef||o.intent.digest!==i.deliveryDigest)n.push("Progress delivery does not match the intent");if(!l(o.scope,i.scope))n.push("Progress scope does not match the intent");if(o.recipientRef!==i.recipientRefs[0])n.push("Progress recipient does not match the intent");let u=i.requestedRoutes.find((h)=>h.ref===o.route.ref);if(!u||u.revision!==o.route.revision||u.digest!==o.route.digest)n.push("Progress route was not requested by the intent");if(Date.parse(o.occurredAt)<Date.parse(i.createdAt)||Date.parse(o.occurredAt)>Date.parse(i.expiresAt))n.push("Progress occurred outside the intent validity window");return n}var C="1.0.0",m=s.string().trim().min(1),v=s.string().datetime({offset:!0}),V=s.enum(["queued","running","waiting_for_help","waiting_for_approval","blocked","completed","failed","cancelled"]),B=s.object({schemaVersion:s.literal(C),projectionRef:m,projectionDigest:p,scope:f,lifecycleLink:g,status:V,checkpoint:r,canonicalConversation:r.optional(),helpRequest:r.optional(),approvalRequest:r.optional(),progressSummaryRef:m,occurredAt:v,evidenceRefs:s.array(m).min(1),effectAuthority:s.literal("none")}).strict().superRefine((e,i)=>{if(new Set(e.evidenceRefs).size!==e.evidenceRefs.length)i.addIssue({code:s.ZodIssueCode.custom,path:["evidenceRefs"],message:"evidenceRefs must be unique"});if(e.status==="waiting_for_help"!==Boolean(e.helpRequest))i.addIssue({code:s.ZodIssueCode.custom,path:["helpRequest"],message:"help binding is required only while waiting for help"});if(e.status==="waiting_for_approval"!==Boolean(e.approvalRequest))i.addIssue({code:s.ZodIssueCode.custom,path:["approvalRequest"],message:"approval binding is required only while waiting for approval"})});function A(e){let i=[],{projection:o,helpRequest:n}=e;if(o.canonicalConversation&&(o.canonicalConversation.ref!==o.lifecycleLink.canonicalConversation?.ref||o.canonicalConversation.digest!==o.lifecycleLink.canonicalConversation?.digest))i.push("Lifecycle projection conversation does not match its link");if(o.status==="waiting_for_help"&&!n)i.push("Waiting-for-help projection requires the durable help request");if(!l(o.scope,o.lifecycleLink.scope))i.push("Projection scope does not match the lifecycle link");if(n&&(o.lifecycleLink.runRef!==n.runRef||o.lifecycleLink.helpRequestRef!==n.id))i.push("Help request does not match the lifecycle link");if(n&&o.helpRequest?.ref!==n.id)i.push("Projection help binding does not match the help request");if(n&&o.checkpoint.ref!==n.checkpointRef)i.push("Projection checkpoint does not match the help request");if(o.approvalRequest?.ref!==o.lifecycleLink.approvalRequestRef)i.push("Projection approval binding does not match the lifecycle link");return i}function _(e){let{projection:i}=e;if(!i.canonicalConversation)return["Lifecycle projection requires a canonical conversation"];if(!i.lifecycleLink.session)return["Lifecycle projection requires a canonical session"];return A(e)}export{C as COMMUNICATION_AGENT_LIFECYCLE_PROJECTION_SCHEMA_VERSION,V as CommunicationAgentLifecycleProjectionStatusV1Schema,B as CommunicationAgentLifecycleProjectionV1Schema,_ as validateCanonicalAgentLifecycleProjectionV1,A as validateCommunicationAgentLifecycleProjectionV1};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -0,0 +1,210 @@
|
|
|
1
|
+
import { z } from 'zod';
|
|
2
|
+
export declare const COMMUNICATION_AGENT_SURFACE_CONTROL_V1: 'communication.agent-surface-control.v1';
|
|
3
|
+
export declare const COMMUNICATION_AGENT_SURFACE_CONTROL_RESULT_V1: 'communication.agent-surface-control-result.v1';
|
|
4
|
+
export declare const CommunicationAgentSurfaceControlPayloadV1Schema: z.ZodDiscriminatedUnion<[z.ZodObject<{
|
|
5
|
+
kind: z.ZodLiteral<"help_response">;
|
|
6
|
+
helpRequest: z.ZodObject<{
|
|
7
|
+
ref: z.ZodString;
|
|
8
|
+
digest: z.ZodString;
|
|
9
|
+
}, z.core.$strict>;
|
|
10
|
+
response: z.ZodObject<{
|
|
11
|
+
ref: z.ZodString;
|
|
12
|
+
digest: z.ZodString;
|
|
13
|
+
}, z.core.$strict>;
|
|
14
|
+
}, z.core.$strict>, z.ZodObject<{
|
|
15
|
+
kind: z.ZodLiteral<"approval_decision">;
|
|
16
|
+
approvalRequest: z.ZodObject<{
|
|
17
|
+
ref: z.ZodString;
|
|
18
|
+
digest: z.ZodString;
|
|
19
|
+
}, z.core.$strict>;
|
|
20
|
+
decision: z.ZodEnum<{
|
|
21
|
+
approved: "approved";
|
|
22
|
+
rejected: "rejected";
|
|
23
|
+
}>;
|
|
24
|
+
effect: z.ZodObject<{
|
|
25
|
+
ref: z.ZodString;
|
|
26
|
+
digest: z.ZodString;
|
|
27
|
+
}, z.core.$strict>;
|
|
28
|
+
}, z.core.$strict>, z.ZodObject<{
|
|
29
|
+
kind: z.ZodLiteral<"steer">;
|
|
30
|
+
instruction: z.ZodObject<{
|
|
31
|
+
ref: z.ZodString;
|
|
32
|
+
digest: z.ZodString;
|
|
33
|
+
}, z.core.$strict>;
|
|
34
|
+
}, z.core.$strict>, z.ZodObject<{
|
|
35
|
+
kind: z.ZodLiteral<"queue">;
|
|
36
|
+
instruction: z.ZodObject<{
|
|
37
|
+
ref: z.ZodString;
|
|
38
|
+
digest: z.ZodString;
|
|
39
|
+
}, z.core.$strict>;
|
|
40
|
+
}, z.core.$strict>, z.ZodObject<{
|
|
41
|
+
kind: z.ZodLiteral<"pause">;
|
|
42
|
+
reasonRef: z.ZodString;
|
|
43
|
+
}, z.core.$strict>, z.ZodObject<{
|
|
44
|
+
kind: z.ZodLiteral<"cancel">;
|
|
45
|
+
reasonRef: z.ZodString;
|
|
46
|
+
}, z.core.$strict>, z.ZodObject<{
|
|
47
|
+
kind: z.ZodLiteral<"branch">;
|
|
48
|
+
branchRequest: z.ZodObject<{
|
|
49
|
+
ref: z.ZodString;
|
|
50
|
+
digest: z.ZodString;
|
|
51
|
+
}, z.core.$strict>;
|
|
52
|
+
}, z.core.$strict>], "kind">;
|
|
53
|
+
/** Origin-neutral control request; the injected authority remains decisive. */
|
|
54
|
+
export declare const CommunicationAgentSurfaceControlV1Schema: z.ZodObject<{
|
|
55
|
+
schemaVersion: z.ZodLiteral<"communication.agent-surface-control.v1">;
|
|
56
|
+
controlRef: z.ZodString;
|
|
57
|
+
controlDigest: z.ZodString;
|
|
58
|
+
scope: z.ZodObject<{
|
|
59
|
+
tenantRef: z.ZodString;
|
|
60
|
+
workspaceRef: z.ZodOptional<z.ZodString>;
|
|
61
|
+
spaceRef: z.ZodOptional<z.ZodString>;
|
|
62
|
+
subjectRef: z.ZodString;
|
|
63
|
+
}, z.core.$strict>;
|
|
64
|
+
canonicalConversation: z.ZodObject<{
|
|
65
|
+
ref: z.ZodString;
|
|
66
|
+
digest: z.ZodString;
|
|
67
|
+
}, z.core.$strict>;
|
|
68
|
+
lifecycleLink: z.ZodObject<{
|
|
69
|
+
schemaVersion: z.ZodLiteral<"1.0.0">;
|
|
70
|
+
linkRef: z.ZodString;
|
|
71
|
+
profile: z.ZodObject<{
|
|
72
|
+
ref: z.ZodString;
|
|
73
|
+
digest: z.ZodString;
|
|
74
|
+
revision: z.ZodNumber;
|
|
75
|
+
}, z.core.$strict>;
|
|
76
|
+
agentRef: z.ZodString;
|
|
77
|
+
applicationRef: z.ZodString;
|
|
78
|
+
scope: z.ZodObject<{
|
|
79
|
+
tenantRef: z.ZodString;
|
|
80
|
+
workspaceRef: z.ZodOptional<z.ZodString>;
|
|
81
|
+
spaceRef: z.ZodOptional<z.ZodString>;
|
|
82
|
+
subjectRef: z.ZodString;
|
|
83
|
+
}, z.core.$strict>;
|
|
84
|
+
runRef: z.ZodOptional<z.ZodString>;
|
|
85
|
+
taskRef: z.ZodOptional<z.ZodString>;
|
|
86
|
+
helpRequestRef: z.ZodOptional<z.ZodString>;
|
|
87
|
+
approvalRequestRef: z.ZodOptional<z.ZodString>;
|
|
88
|
+
backgroundResultRef: z.ZodOptional<z.ZodString>;
|
|
89
|
+
canonicalConversation: z.ZodOptional<z.ZodObject<{
|
|
90
|
+
ref: z.ZodString;
|
|
91
|
+
digest: z.ZodString;
|
|
92
|
+
}, z.core.$strict>>;
|
|
93
|
+
session: z.ZodOptional<z.ZodObject<{
|
|
94
|
+
ref: z.ZodString;
|
|
95
|
+
digest: z.ZodString;
|
|
96
|
+
revision: z.ZodNumber;
|
|
97
|
+
}, z.core.$strict>>;
|
|
98
|
+
correlationRef: z.ZodString;
|
|
99
|
+
evidenceRefs: z.ZodArray<z.ZodString>;
|
|
100
|
+
}, z.core.$strict>;
|
|
101
|
+
actorPrincipalRef: z.ZodString;
|
|
102
|
+
actorIdentityEvidence: z.ZodObject<{
|
|
103
|
+
ref: z.ZodString;
|
|
104
|
+
digest: z.ZodString;
|
|
105
|
+
}, z.core.$strict>;
|
|
106
|
+
authorityDecision: z.ZodObject<{
|
|
107
|
+
ref: z.ZodString;
|
|
108
|
+
digest: z.ZodString;
|
|
109
|
+
}, z.core.$strict>;
|
|
110
|
+
payload: z.ZodDiscriminatedUnion<[z.ZodObject<{
|
|
111
|
+
kind: z.ZodLiteral<"help_response">;
|
|
112
|
+
helpRequest: z.ZodObject<{
|
|
113
|
+
ref: z.ZodString;
|
|
114
|
+
digest: z.ZodString;
|
|
115
|
+
}, z.core.$strict>;
|
|
116
|
+
response: z.ZodObject<{
|
|
117
|
+
ref: z.ZodString;
|
|
118
|
+
digest: z.ZodString;
|
|
119
|
+
}, z.core.$strict>;
|
|
120
|
+
}, z.core.$strict>, z.ZodObject<{
|
|
121
|
+
kind: z.ZodLiteral<"approval_decision">;
|
|
122
|
+
approvalRequest: z.ZodObject<{
|
|
123
|
+
ref: z.ZodString;
|
|
124
|
+
digest: z.ZodString;
|
|
125
|
+
}, z.core.$strict>;
|
|
126
|
+
decision: z.ZodEnum<{
|
|
127
|
+
approved: "approved";
|
|
128
|
+
rejected: "rejected";
|
|
129
|
+
}>;
|
|
130
|
+
effect: z.ZodObject<{
|
|
131
|
+
ref: z.ZodString;
|
|
132
|
+
digest: z.ZodString;
|
|
133
|
+
}, z.core.$strict>;
|
|
134
|
+
}, z.core.$strict>, z.ZodObject<{
|
|
135
|
+
kind: z.ZodLiteral<"steer">;
|
|
136
|
+
instruction: z.ZodObject<{
|
|
137
|
+
ref: z.ZodString;
|
|
138
|
+
digest: z.ZodString;
|
|
139
|
+
}, z.core.$strict>;
|
|
140
|
+
}, z.core.$strict>, z.ZodObject<{
|
|
141
|
+
kind: z.ZodLiteral<"queue">;
|
|
142
|
+
instruction: z.ZodObject<{
|
|
143
|
+
ref: z.ZodString;
|
|
144
|
+
digest: z.ZodString;
|
|
145
|
+
}, z.core.$strict>;
|
|
146
|
+
}, z.core.$strict>, z.ZodObject<{
|
|
147
|
+
kind: z.ZodLiteral<"pause">;
|
|
148
|
+
reasonRef: z.ZodString;
|
|
149
|
+
}, z.core.$strict>, z.ZodObject<{
|
|
150
|
+
kind: z.ZodLiteral<"cancel">;
|
|
151
|
+
reasonRef: z.ZodString;
|
|
152
|
+
}, z.core.$strict>, z.ZodObject<{
|
|
153
|
+
kind: z.ZodLiteral<"branch">;
|
|
154
|
+
branchRequest: z.ZodObject<{
|
|
155
|
+
ref: z.ZodString;
|
|
156
|
+
digest: z.ZodString;
|
|
157
|
+
}, z.core.$strict>;
|
|
158
|
+
}, z.core.$strict>], "kind">;
|
|
159
|
+
idempotencyKey: z.ZodString;
|
|
160
|
+
createdAt: z.ZodString;
|
|
161
|
+
expiresAt: z.ZodString;
|
|
162
|
+
effectAuthority: z.ZodLiteral<"none">;
|
|
163
|
+
}, z.core.$strict>;
|
|
164
|
+
export type CommunicationAgentSurfaceControlV1 = z.infer<typeof CommunicationAgentSurfaceControlV1Schema>;
|
|
165
|
+
export declare const CommunicationAgentSurfaceControlResultV1Schema: z.ZodObject<{
|
|
166
|
+
schemaVersion: z.ZodLiteral<"communication.agent-surface-control-result.v1">;
|
|
167
|
+
resultRef: z.ZodString;
|
|
168
|
+
resultDigest: z.ZodString;
|
|
169
|
+
control: z.ZodObject<{
|
|
170
|
+
ref: z.ZodString;
|
|
171
|
+
digest: z.ZodString;
|
|
172
|
+
}, z.core.$strict>;
|
|
173
|
+
scope: z.ZodObject<{
|
|
174
|
+
tenantRef: z.ZodString;
|
|
175
|
+
workspaceRef: z.ZodOptional<z.ZodString>;
|
|
176
|
+
spaceRef: z.ZodOptional<z.ZodString>;
|
|
177
|
+
subjectRef: z.ZodString;
|
|
178
|
+
}, z.core.$strict>;
|
|
179
|
+
canonicalConversation: z.ZodObject<{
|
|
180
|
+
ref: z.ZodString;
|
|
181
|
+
digest: z.ZodString;
|
|
182
|
+
}, z.core.$strict>;
|
|
183
|
+
authorityDecision: z.ZodObject<{
|
|
184
|
+
ref: z.ZodString;
|
|
185
|
+
digest: z.ZodString;
|
|
186
|
+
}, z.core.$strict>;
|
|
187
|
+
outcome: z.ZodEnum<{
|
|
188
|
+
applied: "applied";
|
|
189
|
+
denied: "denied";
|
|
190
|
+
duplicate: "duplicate";
|
|
191
|
+
expired: "expired";
|
|
192
|
+
}>;
|
|
193
|
+
executionReceipt: z.ZodOptional<z.ZodObject<{
|
|
194
|
+
ref: z.ZodString;
|
|
195
|
+
digest: z.ZodString;
|
|
196
|
+
}, z.core.$strict>>;
|
|
197
|
+
decidedAt: z.ZodString;
|
|
198
|
+
evidenceRefs: z.ZodArray<z.ZodString>;
|
|
199
|
+
effectAuthority: z.ZodLiteral<"none">;
|
|
200
|
+
}, z.core.$strict>;
|
|
201
|
+
export type CommunicationAgentSurfaceControlResultV1 = z.infer<typeof CommunicationAgentSurfaceControlResultV1Schema>;
|
|
202
|
+
export declare function digestCommunicationAgentSurfaceControlV1(control: Omit<CommunicationAgentSurfaceControlV1, 'controlDigest'>): Promise<`sha256:${string}`>;
|
|
203
|
+
export declare function verifyCommunicationAgentSurfaceControlV1(control: CommunicationAgentSurfaceControlV1): Promise<boolean>;
|
|
204
|
+
export declare function digestCommunicationAgentSurfaceControlResultV1(result: Omit<CommunicationAgentSurfaceControlResultV1, 'resultDigest'>): Promise<`sha256:${string}`>;
|
|
205
|
+
export declare function verifyCommunicationAgentSurfaceControlResultV1(result: CommunicationAgentSurfaceControlResultV1): Promise<boolean>;
|
|
206
|
+
export declare function validateCommunicationAgentSurfaceControlBindingV1(control: CommunicationAgentSurfaceControlV1): string[];
|
|
207
|
+
export declare function validateCommunicationAgentSurfaceControlResultBindingV1(input: {
|
|
208
|
+
control: CommunicationAgentSurfaceControlV1;
|
|
209
|
+
result: CommunicationAgentSurfaceControlResultV1;
|
|
210
|
+
}): string[];
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
// @bun
|
|
2
|
+
import{z as o}from"zod";import{z as r}from"zod";var A="1.0.0",V="1.0.0",L={id:"communication-os.agent-omnichannel.v1",title:"CommunicationOS agent omnichannel contracts",body:"Provider-neutral agent profiles and lifecycle links bind applications, runs, tasks, help requests, background results, routes, preferences, policies, and evidence through opaque references. They grant no provider access or effect authority.",kind:"reference",route:"/docs/communication-os/agent-omnichannel-v1",visibility:"public"},i=r.string().trim().min(1),h=r.string().datetime({offset:!0}),a=r.string().regex(/^sha256:[a-f0-9]{64}$/),l=r.object({ref:i,digest:a}).strict(),d=l.extend({revision:r.number().int().positive()}).strict(),m=r.object({tenantRef:i,workspaceRef:i.optional(),spaceRef:i.optional(),subjectRef:i}).strict(),q=r.object({schemaVersion:r.literal(A),profileRef:i,revision:r.number().int().positive(),agentRef:i,applicationRef:i,scope:m,routeBindings:r.array(d),connectionRefs:r.array(i),preferenceSet:d,policyRefs:r.array(i).min(1),evidenceRefs:r.array(i).min(1),createdAt:h,updatedAt:h,profileDigest:a}).strict().superRefine((e,t)=>{for(let c of["connectionRefs","policyRefs","evidenceRefs"])if(new Set(e[c]).size!==e[c].length)t.addIssue({code:r.ZodIssueCode.custom,path:[c],message:`${c} must be unique`});let n=e.routeBindings.map((c)=>c.ref);if(new Set(n).size!==n.length)t.addIssue({code:r.ZodIssueCode.custom,path:["routeBindings"],message:"route bindings must be unique"})}),R=r.object({schemaVersion:r.literal(V),linkRef:i,profile:d,agentRef:i,applicationRef:i,scope:m,runRef:i.optional(),taskRef:i.optional(),helpRequestRef:i.optional(),approvalRequestRef:i.optional(),backgroundResultRef:i.optional(),canonicalConversation:l.optional(),session:d.optional(),correlationRef:i,evidenceRefs:r.array(i).min(1)}).strict().superRefine((e,t)=>{if(new Set(e.evidenceRefs).size!==e.evidenceRefs.length)t.addIssue({code:r.ZodIssueCode.custom,path:["evidenceRefs"],message:"evidenceRefs must be unique"});if(!e.runRef&&!e.taskRef&&!e.helpRequestRef&&!e.approvalRequestRef&&!e.backgroundResultRef)t.addIssue({code:r.ZodIssueCode.custom,path:["runRef"],message:"at least one run, task, help request, approval request, or background result ref is required"})});function p(e,t){return e.tenantRef===t.tenantRef&&e.workspaceRef===t.workspaceRef&&e.spaceRef===t.spaceRef&&e.subjectRef===t.subjectRef}function I(e){let t=[];for(let n of["agentRef","applicationRef"])if(e.profile[n]!==e.lifecycleLink[n])t.push(`Lifecycle ${n} does not match the agent profile`);if(e.lifecycleLink.profile.ref!==e.profile.profileRef||e.lifecycleLink.profile.revision!==e.profile.revision||e.lifecycleLink.profile.digest!==e.profile.profileDigest)t.push("Lifecycle profile binding does not match the agent profile");if(!p(e.profile.scope,e.lifecycleLink.scope))t.push("Lifecycle scope does not match the agent profile");return t}function B(e){let{intent:t,progress:n}=e,c=[];if(n.deliveryRef!==t.deliveryRef||n.intent.ref!==t.deliveryRef||n.intent.digest!==t.deliveryDigest)c.push("Progress delivery does not match the intent");if(!p(n.scope,t.scope))c.push("Progress scope does not match the intent");if(n.recipientRef!==t.recipientRefs[0])c.push("Progress recipient does not match the intent");let f=t.requestedRoutes.find((g)=>g.ref===n.route.ref);if(!f||f.revision!==n.route.revision||f.digest!==n.route.digest)c.push("Progress route was not requested by the intent");if(Date.parse(n.occurredAt)<Date.parse(t.createdAt)||Date.parse(n.occurredAt)>Date.parse(t.expiresAt))c.push("Progress occurred outside the intent validity window");return c}async function C(e){let t=new TextEncoder().encode(y(e)),n=new Uint8Array(t.byteLength);n.set(t);let c=await crypto.subtle.digest("SHA-256",n.buffer),f=Array.from(new Uint8Array(c),(g)=>g.toString(16).padStart(2,"0")).join("");return a.parse(`sha256:${f}`)}function y(e){if(Array.isArray(e))return`[${e.map(y).join(",")}]`;if(e&&typeof e==="object")return`{${Object.entries(e).sort(([t],[n])=>t.localeCompare(n)).map(([t,n])=>`${JSON.stringify(t)}:${y(n)}`).join(",")}}`;return JSON.stringify(e)}var S="communication.agent-surface-control.v1",v="communication.agent-surface-control-result.v1",u=o.string().trim().min(1),s=l,x=o.discriminatedUnion("kind",[o.object({kind:o.literal("help_response"),helpRequest:s,response:s}).strict(),o.object({kind:o.literal("approval_decision"),approvalRequest:s,decision:o.enum(["approved","rejected"]),effect:s}).strict(),o.object({kind:o.literal("steer"),instruction:s}).strict(),o.object({kind:o.literal("queue"),instruction:s}).strict(),o.object({kind:o.literal("pause"),reasonRef:u}).strict(),o.object({kind:o.literal("cancel"),reasonRef:u}).strict(),o.object({kind:o.literal("branch"),branchRequest:s}).strict()]),w=o.object({schemaVersion:o.literal(S),controlRef:u,controlDigest:a,scope:m,canonicalConversation:l,lifecycleLink:R,actorPrincipalRef:u,actorIdentityEvidence:s,authorityDecision:s,payload:x,idempotencyKey:u,createdAt:o.string().datetime({offset:!0}),expiresAt:o.string().datetime({offset:!0}),effectAuthority:o.literal("none")}).strict().superRefine((e,t)=>{if(Date.parse(e.expiresAt)<=Date.parse(e.createdAt))t.addIssue({code:o.ZodIssueCode.custom,path:["expiresAt"],message:"control expiry must follow creation"})}),T=o.object({schemaVersion:o.literal(v),resultRef:u,resultDigest:a,control:s,scope:m,canonicalConversation:s,authorityDecision:s,outcome:o.enum(["applied","duplicate","denied","expired"]),executionReceipt:s.optional(),decidedAt:o.string().datetime({offset:!0}),evidenceRefs:o.array(u).min(1),effectAuthority:o.literal("none")}).strict().superRefine((e,t)=>{if((e.outcome==="applied"||e.outcome==="duplicate")!==Boolean(e.executionReceipt))t.addIssue({code:o.ZodIssueCode.custom,path:["executionReceipt"],message:"executed controls require an execution receipt"})});async function b(e){return C(e)}async function z(e){let{controlDigest:t,...n}=e;return t===await b(n)}async function k(e){return C(e)}async function M(e){let{resultDigest:t,...n}=e;return t===await k(n)}function U(e){let t=[];if(!p(e.scope,e.lifecycleLink.scope))t.push("Agent surface control scope does not match lifecycle scope");if(e.lifecycleLink.canonicalConversation?.ref!==e.canonicalConversation.ref||e.lifecycleLink.canonicalConversation?.digest!==e.canonicalConversation.digest)t.push("Agent surface control conversation does not match lifecycle link");if(!e.lifecycleLink.runRef)t.push("Agent surface control requires a run-bound lifecycle link");if(e.payload.kind==="help_response"&&e.payload.helpRequest.ref!==e.lifecycleLink.helpRequestRef)t.push("Help response does not match the lifecycle help request");if(e.payload.kind==="approval_decision"&&e.payload.approvalRequest.ref!==e.lifecycleLink.approvalRequestRef)t.push("Approval decision does not match the lifecycle approval request");return t}function Z(e){let t=[];if(e.result.control.ref!==e.control.controlRef||e.result.control.digest!==e.control.controlDigest)t.push("Agent surface result control binding does not match");if(!p(e.result.scope,e.control.scope))t.push("Agent surface result scope does not match");if(e.result.canonicalConversation.ref!==e.control.canonicalConversation.ref||e.result.canonicalConversation.digest!==e.control.canonicalConversation.digest)t.push("Agent surface result conversation does not match");if(e.result.authorityDecision.ref!==e.control.authorityDecision.ref||e.result.authorityDecision.digest!==e.control.authorityDecision.digest)t.push("Agent surface result authority decision does not match");return t}export{v as COMMUNICATION_AGENT_SURFACE_CONTROL_RESULT_V1,S as COMMUNICATION_AGENT_SURFACE_CONTROL_V1,x as CommunicationAgentSurfaceControlPayloadV1Schema,T as CommunicationAgentSurfaceControlResultV1Schema,w as CommunicationAgentSurfaceControlV1Schema,k as digestCommunicationAgentSurfaceControlResultV1,b as digestCommunicationAgentSurfaceControlV1,U as validateCommunicationAgentSurfaceControlBindingV1,Z as validateCommunicationAgentSurfaceControlResultBindingV1,M as verifyCommunicationAgentSurfaceControlResultV1,z as verifyCommunicationAgentSurfaceControlV1};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -0,0 +1,187 @@
|
|
|
1
|
+
export declare const ExtractDecisionsCommand: import("@lssm/lib.contracts-spec").OperationSpec<import("@lssm/lib.schema").SchemaModel<{
|
|
2
|
+
threadId: {
|
|
3
|
+
type: import("@lssm/lib.schema").FieldType<string, string>;
|
|
4
|
+
isOptional: false;
|
|
5
|
+
};
|
|
6
|
+
}>, import("@lssm/lib.schema").SchemaModel<{
|
|
7
|
+
decisions: {
|
|
8
|
+
type: import("@lssm/lib.schema").FieldType<Record<string, unknown>, Record<string, unknown>>;
|
|
9
|
+
isArray: true;
|
|
10
|
+
isOptional: false;
|
|
11
|
+
};
|
|
12
|
+
}>, undefined>;
|
|
13
|
+
export declare const ExtractRisksCommand: import("@lssm/lib.contracts-spec").OperationSpec<import("@lssm/lib.schema").SchemaModel<{
|
|
14
|
+
threadId: {
|
|
15
|
+
type: import("@lssm/lib.schema").FieldType<string, string>;
|
|
16
|
+
isOptional: false;
|
|
17
|
+
};
|
|
18
|
+
}>, import("@lssm/lib.schema").SchemaModel<{
|
|
19
|
+
risks: {
|
|
20
|
+
type: import("@lssm/lib.schema").FieldType<Record<string, unknown>, Record<string, unknown>>;
|
|
21
|
+
isArray: true;
|
|
22
|
+
isOptional: false;
|
|
23
|
+
};
|
|
24
|
+
}>, undefined>;
|
|
25
|
+
export declare const DraftReplyCommand: import("@lssm/lib.contracts-spec").OperationSpec<import("@lssm/lib.schema").SchemaModel<{
|
|
26
|
+
threadId: {
|
|
27
|
+
type: import("@lssm/lib.schema").FieldType<string, string>;
|
|
28
|
+
isOptional: false;
|
|
29
|
+
};
|
|
30
|
+
messageId: {
|
|
31
|
+
type: import("@lssm/lib.schema").FieldType<string, string>;
|
|
32
|
+
isOptional: true;
|
|
33
|
+
};
|
|
34
|
+
instruction: {
|
|
35
|
+
type: import("@lssm/lib.schema").FieldType<string, string>;
|
|
36
|
+
isOptional: true;
|
|
37
|
+
};
|
|
38
|
+
}>, import("@lssm/lib.schema").SchemaModel<{
|
|
39
|
+
id: {
|
|
40
|
+
type: import("@lssm/lib.schema").FieldType<string, string>;
|
|
41
|
+
isOptional: false;
|
|
42
|
+
};
|
|
43
|
+
threadId: {
|
|
44
|
+
type: import("@lssm/lib.schema").FieldType<string, string>;
|
|
45
|
+
isOptional: false;
|
|
46
|
+
};
|
|
47
|
+
messageId: {
|
|
48
|
+
type: import("@lssm/lib.schema").FieldType<string, string>;
|
|
49
|
+
isOptional: true;
|
|
50
|
+
};
|
|
51
|
+
body: {
|
|
52
|
+
type: import("@lssm/lib.schema").FieldType<string, string>;
|
|
53
|
+
isOptional: false;
|
|
54
|
+
};
|
|
55
|
+
status: {
|
|
56
|
+
type: import("@lssm/lib.schema").EnumType<[string, string, string, string, string, string]>;
|
|
57
|
+
isOptional: false;
|
|
58
|
+
defaultValue: string;
|
|
59
|
+
};
|
|
60
|
+
generatedBy: {
|
|
61
|
+
type: import("@lssm/lib.schema").FieldType<string, string>;
|
|
62
|
+
isOptional: true;
|
|
63
|
+
};
|
|
64
|
+
modelName: {
|
|
65
|
+
type: import("@lssm/lib.schema").FieldType<string, string>;
|
|
66
|
+
isOptional: true;
|
|
67
|
+
};
|
|
68
|
+
promptVersion: {
|
|
69
|
+
type: import("@lssm/lib.schema").FieldType<string, string>;
|
|
70
|
+
isOptional: true;
|
|
71
|
+
};
|
|
72
|
+
policyVersion: {
|
|
73
|
+
type: import("@lssm/lib.schema").FieldType<string, string>;
|
|
74
|
+
isOptional: true;
|
|
75
|
+
};
|
|
76
|
+
reviewedBy: {
|
|
77
|
+
type: import("@lssm/lib.schema").FieldType<string, string>;
|
|
78
|
+
isOptional: true;
|
|
79
|
+
};
|
|
80
|
+
reviewedAt: {
|
|
81
|
+
type: import("@lssm/lib.schema").FieldType<Date, string>;
|
|
82
|
+
isOptional: true;
|
|
83
|
+
};
|
|
84
|
+
metadata: {
|
|
85
|
+
type: import("@lssm/lib.schema").FieldType<Record<string, unknown>, Record<string, unknown>>;
|
|
86
|
+
isOptional: true;
|
|
87
|
+
};
|
|
88
|
+
createdAt: {
|
|
89
|
+
type: import("@lssm/lib.schema").FieldType<Date, string>;
|
|
90
|
+
isOptional: false;
|
|
91
|
+
};
|
|
92
|
+
updatedAt: {
|
|
93
|
+
type: import("@lssm/lib.schema").FieldType<Date, string>;
|
|
94
|
+
isOptional: false;
|
|
95
|
+
};
|
|
96
|
+
}>, undefined>;
|
|
97
|
+
export declare const SendReplyCommand: import("@lssm/lib.contracts-spec").OperationSpec<import("@lssm/lib.schema").SchemaModel<{
|
|
98
|
+
draftId: {
|
|
99
|
+
type: import("@lssm/lib.schema").FieldType<string, string>;
|
|
100
|
+
isOptional: false;
|
|
101
|
+
};
|
|
102
|
+
}>, import("@lssm/lib.schema").SchemaModel<{
|
|
103
|
+
draftId: {
|
|
104
|
+
type: import("@lssm/lib.schema").FieldType<string, string>;
|
|
105
|
+
isOptional: false;
|
|
106
|
+
};
|
|
107
|
+
status: {
|
|
108
|
+
type: import("@lssm/lib.schema").EnumType<[string, string, string, string, string, string]>;
|
|
109
|
+
isOptional: false;
|
|
110
|
+
};
|
|
111
|
+
sentAt: {
|
|
112
|
+
type: import("@lssm/lib.schema").FieldType<Date, string>;
|
|
113
|
+
isOptional: true;
|
|
114
|
+
};
|
|
115
|
+
}>, undefined>;
|
|
116
|
+
export declare const BlockReplyByPolicyCommand: import("@lssm/lib.contracts-spec").OperationSpec<import("@lssm/lib.schema").SchemaModel<{
|
|
117
|
+
draftId: {
|
|
118
|
+
type: import("@lssm/lib.schema").FieldType<string, string>;
|
|
119
|
+
isOptional: false;
|
|
120
|
+
};
|
|
121
|
+
policyRef: {
|
|
122
|
+
type: import("@lssm/lib.schema").FieldType<string, string>;
|
|
123
|
+
isOptional: false;
|
|
124
|
+
};
|
|
125
|
+
reason: {
|
|
126
|
+
type: import("@lssm/lib.schema").FieldType<string, string>;
|
|
127
|
+
isOptional: false;
|
|
128
|
+
};
|
|
129
|
+
}>, import("@lssm/lib.schema").SchemaModel<{
|
|
130
|
+
id: {
|
|
131
|
+
type: import("@lssm/lib.schema").FieldType<string, string>;
|
|
132
|
+
isOptional: false;
|
|
133
|
+
};
|
|
134
|
+
threadId: {
|
|
135
|
+
type: import("@lssm/lib.schema").FieldType<string, string>;
|
|
136
|
+
isOptional: false;
|
|
137
|
+
};
|
|
138
|
+
messageId: {
|
|
139
|
+
type: import("@lssm/lib.schema").FieldType<string, string>;
|
|
140
|
+
isOptional: true;
|
|
141
|
+
};
|
|
142
|
+
body: {
|
|
143
|
+
type: import("@lssm/lib.schema").FieldType<string, string>;
|
|
144
|
+
isOptional: false;
|
|
145
|
+
};
|
|
146
|
+
status: {
|
|
147
|
+
type: import("@lssm/lib.schema").EnumType<[string, string, string, string, string, string]>;
|
|
148
|
+
isOptional: false;
|
|
149
|
+
defaultValue: string;
|
|
150
|
+
};
|
|
151
|
+
generatedBy: {
|
|
152
|
+
type: import("@lssm/lib.schema").FieldType<string, string>;
|
|
153
|
+
isOptional: true;
|
|
154
|
+
};
|
|
155
|
+
modelName: {
|
|
156
|
+
type: import("@lssm/lib.schema").FieldType<string, string>;
|
|
157
|
+
isOptional: true;
|
|
158
|
+
};
|
|
159
|
+
promptVersion: {
|
|
160
|
+
type: import("@lssm/lib.schema").FieldType<string, string>;
|
|
161
|
+
isOptional: true;
|
|
162
|
+
};
|
|
163
|
+
policyVersion: {
|
|
164
|
+
type: import("@lssm/lib.schema").FieldType<string, string>;
|
|
165
|
+
isOptional: true;
|
|
166
|
+
};
|
|
167
|
+
reviewedBy: {
|
|
168
|
+
type: import("@lssm/lib.schema").FieldType<string, string>;
|
|
169
|
+
isOptional: true;
|
|
170
|
+
};
|
|
171
|
+
reviewedAt: {
|
|
172
|
+
type: import("@lssm/lib.schema").FieldType<Date, string>;
|
|
173
|
+
isOptional: true;
|
|
174
|
+
};
|
|
175
|
+
metadata: {
|
|
176
|
+
type: import("@lssm/lib.schema").FieldType<Record<string, unknown>, Record<string, unknown>>;
|
|
177
|
+
isOptional: true;
|
|
178
|
+
};
|
|
179
|
+
createdAt: {
|
|
180
|
+
type: import("@lssm/lib.schema").FieldType<Date, string>;
|
|
181
|
+
isOptional: false;
|
|
182
|
+
};
|
|
183
|
+
updatedAt: {
|
|
184
|
+
type: import("@lssm/lib.schema").FieldType<Date, string>;
|
|
185
|
+
isOptional: false;
|
|
186
|
+
};
|
|
187
|
+
}>, undefined>;
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
// @bun
|
|
2
|
+
import{defineCommand as r}from"@lssm/lib.contracts-spec";import{defineSchemaModel as a,ScalarTypeEnum as i}from"@lssm/lib.schema";import{defineEnum as n}from"@lssm/lib.schema";var s=n("ChannelType",["email","sms","whatsapp","telegram","matrix","web_chat","voice","internal_chat","custom_adapter","future_bridge","unknown"]),c=n("ThreadStatus",["open","waiting_on_human","waiting_on_external_party","action_required","resolved","archived"]),d=n("MessageStatus",["received","normalized","classified","linked","triaged","replied","archived"]),p=n("ReplyStatus",["drafted","requires_review","approved","sent","failed","blocked_by_policy"]),y=n("HandoffStatus",["created","assigned","acknowledged","completed","reopened"]),l=n("SuggestionStatus",["generated","shown","accepted","edited","rejected","applied","expired"]),m=n("IntentCategory",["support","sales","bug_report","feature_request","billing","onboarding","coordination","general","spam","escalation"]),f=n("ActionSafetyMode",["read_only","draft_only","requires_review","policy_executable","blocked"]),x=n("FeedbackOutcome",["accepted","edited","rejected","unsafe","incomplete"]);import{defineSchemaModel as t,ScalarTypeEnum as e}from"@lssm/lib.schema";var g=t({name:"ChannelAccount",description:"A channel account belonging to a participant",fields:{id:{type:e.String_unsecure(),isOptional:!1},participantId:{type:e.String_unsecure(),isOptional:!1},channelType:{type:s,isOptional:!1},externalId:{type:e.String_unsecure(),isOptional:!1},displayName:{type:e.String_unsecure(),isOptional:!0},metadata:{type:e.JSONObject(),isOptional:!0},isPrimary:{type:e.Boolean(),isOptional:!1,defaultValue:!1},createdAt:{type:e.DateTime(),isOptional:!1}}}),S=t({name:"IdentityLink",description:"Proposed or confirmed relationship between participant identities",fields:{id:{type:e.String_unsecure(),isOptional:!1},participantId:{type:e.String_unsecure(),isOptional:!1},candidateParticipantId:{type:e.String_unsecure(),isOptional:!1},status:{type:l,isOptional:!1,defaultValue:"generated"},confidence:{type:e.Float_unsecure(),isOptional:!1},reasoning:{type:e.String_unsecure(),isOptional:!0},reviewedBy:{type:e.String_unsecure(),isOptional:!0},createdAt:{type:e.DateTime(),isOptional:!1}}}),D=t({name:"CommunicationParticipant",description:"A person or system that participates in conversations",fields:{id:{type:e.String_unsecure(),isOptional:!1},name:{type:e.String_unsecure(),isOptional:!0},email:{type:e.EmailAddress(),isOptional:!0},accounts:{type:g,isArray:!0,isOptional:!1},identityLinks:{type:S,isArray:!0,isOptional:!0},createdAt:{type:e.DateTime(),isOptional:!1},updatedAt:{type:e.DateTime(),isOptional:!1}}}),_=t({name:"Attachment",description:"A file or media attachment on a message",fields:{id:{type:e.String_unsecure(),isOptional:!1},messageId:{type:e.String_unsecure(),isOptional:!1},name:{type:e.String_unsecure(),isOptional:!1},mimeType:{type:e.String_unsecure(),isOptional:!0},sizeBytes:{type:e.Int_unsecure(),isOptional:!0},url:{type:e.URL(),isOptional:!0},metadata:{type:e.JSONObject(),isOptional:!0}}}),h=t({name:"ThreadLink",description:"Link between a thread and an external business object (V2: rich-reference objectRef replaces V1 objectType/objectId)",fields:{id:{type:e.String_unsecure(),isOptional:!1},threadId:{type:e.String_unsecure(),isOptional:!1},objectRef:{type:e.JSONObject(),isOptional:!1},relation:{type:e.String_unsecure(),isOptional:!0},confidence:{type:e.Float_unsecure(),isOptional:!0},createdAt:{type:e.DateTime(),isOptional:!1}}}),A=t({name:"MessageIntent",description:"Classified message or thread intent with confidence and evidence",fields:{id:{type:e.String_unsecure(),isOptional:!1},threadId:{type:e.String_unsecure(),isOptional:!1},messageId:{type:e.String_unsecure(),isOptional:!0},category:{type:m,isOptional:!1},confidence:{type:e.Float_unsecure(),isOptional:!1},reasoning:{type:e.String_unsecure(),isOptional:!0},evidenceMessageIds:{type:e.String_unsecure(),isArray:!0,isOptional:!0},createdAt:{type:e.DateTime(),isOptional:!1}}}),w=t({name:"CommunicationMessage",description:"A single message within a communication thread",fields:{id:{type:e.String_unsecure(),isOptional:!1},threadId:{type:e.String_unsecure(),isOptional:!1},channelType:{type:s,isOptional:!1},channelAccountId:{type:e.String_unsecure(),isOptional:!1},participantId:{type:e.String_unsecure(),isOptional:!0},externalMessageId:{type:e.String_unsecure(),isOptional:!0},body:{type:e.String_unsecure(),isOptional:!1},bodyNormalized:{type:e.String_unsecure(),isOptional:!0},status:{type:d,isOptional:!1,defaultValue:"received"},intent:{type:A,isOptional:!0},attachments:{type:_,isArray:!0,isOptional:!0},metadata:{type:e.JSONObject(),isOptional:!0},createdAt:{type:e.DateTime(),isOptional:!1},updatedAt:{type:e.DateTime(),isOptional:!1}}}),M=t({name:"CommunicationFormIntake",description:"Declarative source reference for a communication message mapped into an entity-bound form intake result",fields:{id:{type:e.String_unsecure(),isOptional:!1},messageId:{type:e.String_unsecure(),isOptional:!1},threadId:{type:e.String_unsecure(),isOptional:!1},channelType:{type:s,isOptional:!1},channelAccountId:{type:e.String_unsecure(),isOptional:!1},participantId:{type:e.String_unsecure(),isOptional:!0},entityKey:{type:e.String_unsecure(),isOptional:!1},projectionKind:{type:e.String_unsecure(),isOptional:!1},formKey:{type:e.String_unsecure(),isOptional:!0},formVersion:{type:e.String_unsecure(),isOptional:!0},completionProfileKey:{type:e.String_unsecure(),isOptional:!0},acceptedValues:{type:e.JSONObject(),isOptional:!1},completionDebt:{type:e.JSONObject(),isArray:!0,isOptional:!1},captureStatus:{type:e.String_unsecure(),isOptional:!1,defaultValue:"accepted"},completionStatus:{type:e.String_unsecure(),isOptional:!1},createdAt:{type:e.DateTime(),isOptional:!1}}}),E=t({name:"CommunicationThread",description:"A conversation thread spanning one or more channels",fields:{id:{type:e.String_unsecure(),isOptional:!1},title:{type:e.String_unsecure(),isOptional:!0},status:{type:c,isOptional:!1,defaultValue:"open"},participantIds:{type:e.String_unsecure(),isArray:!0,isOptional:!1},channelTypes:{type:s,isArray:!0,isOptional:!1},links:{type:h,isArray:!0,isOptional:!0},assignedTo:{type:e.String_unsecure(),isOptional:!0},priority:{type:e.String_unsecure(),isOptional:!0},tags:{type:e.String_unsecure(),isArray:!0,isOptional:!0},metadata:{type:e.JSONObject(),isOptional:!0},createdAt:{type:e.DateTime(),isOptional:!1},updatedAt:{type:e.DateTime(),isOptional:!1}}}),O=t({name:"CommunicationAction",description:"Structured action extracted from a conversation",fields:{id:{type:e.String_unsecure(),isOptional:!1},threadId:{type:e.String_unsecure(),isOptional:!1},title:{type:e.String_unsecure(),isOptional:!1},owner:{type:e.String_unsecure(),isOptional:!0},deadline:{type:e.DateTime(),isOptional:!0},blockers:{type:e.String_unsecure(),isArray:!0,isOptional:!0},sourceMessageIds:{type:e.String_unsecure(),isArray:!0,isOptional:!1},safetyMode:{type:f,isOptional:!1,defaultValue:"draft_only"}}}),u=t({name:"ReplyDraft",description:"An AI-generated or human-authored reply draft",fields:{id:{type:e.String_unsecure(),isOptional:!1},threadId:{type:e.String_unsecure(),isOptional:!1},messageId:{type:e.String_unsecure(),isOptional:!0},body:{type:e.String_unsecure(),isOptional:!1},status:{type:p,isOptional:!1,defaultValue:"drafted"},generatedBy:{type:e.String_unsecure(),isOptional:!0},modelName:{type:e.String_unsecure(),isOptional:!0},promptVersion:{type:e.String_unsecure(),isOptional:!0},policyVersion:{type:e.String_unsecure(),isOptional:!0},reviewedBy:{type:e.String_unsecure(),isOptional:!0},reviewedAt:{type:e.DateTime(),isOptional:!0},metadata:{type:e.JSONObject(),isOptional:!0},createdAt:{type:e.DateTime(),isOptional:!1},updatedAt:{type:e.DateTime(),isOptional:!1}}}),v=t({name:"HandoffPacket",description:"A structured handoff between owners, teams, or systems",fields:{id:{type:e.String_unsecure(),isOptional:!1},threadId:{type:e.String_unsecure(),isOptional:!1},status:{type:y,isOptional:!1,defaultValue:"created"},fromOwner:{type:e.String_unsecure(),isOptional:!1},toOwner:{type:e.String_unsecure(),isOptional:!1},summary:{type:e.String_unsecure(),isOptional:!1},keyFacts:{type:e.String_unsecure(),isArray:!0,isOptional:!0},openQuestions:{type:e.String_unsecure(),isArray:!0,isOptional:!0},requiredActions:{type:O,isArray:!0,isOptional:!0},evidenceLinks:{type:e.String_unsecure(),isArray:!0,isOptional:!0},createdAt:{type:e.DateTime(),isOptional:!1},updatedAt:{type:e.DateTime(),isOptional:!1}}}),C=t({name:"CommunicationSummary",description:"AI-generated summary of a thread or message range",fields:{id:{type:e.String_unsecure(),isOptional:!1},threadId:{type:e.String_unsecure(),isOptional:!1},messageIds:{type:e.String_unsecure(),isArray:!0,isOptional:!0},content:{type:e.String_unsecure(),isOptional:!1},facts:{type:e.JSONObject(),isArray:!0,isOptional:!0},actions:{type:O,isArray:!0,isOptional:!0},decisions:{type:e.JSONObject(),isArray:!0,isOptional:!0},risks:{type:e.JSONObject(),isArray:!0,isOptional:!0},modelName:{type:e.String_unsecure(),isOptional:!0},generatedAt:{type:e.DateTime(),isOptional:!1}}}),R=t({name:"AgentSuggestion",description:"An AI-generated suggestion attached to a thread or message",fields:{id:{type:e.String_unsecure(),isOptional:!1},threadId:{type:e.String_unsecure(),isOptional:!1},messageId:{type:e.String_unsecure(),isOptional:!0},suggestionType:{type:e.String_unsecure(),isOptional:!1},content:{type:e.String_unsecure(),isOptional:!1},status:{type:l,isOptional:!1,defaultValue:"generated"},modelName:{type:e.String_unsecure(),isOptional:!0},confidence:{type:e.Float_unsecure(),isOptional:!0},policyVersion:{type:e.String_unsecure(),isOptional:!0},createdAt:{type:e.DateTime(),isOptional:!1},updatedAt:{type:e.DateTime(),isOptional:!1}}});var o=["platform.communication-os"],B=r({meta:{key:"communication.decision.extract",version:"1.0.0",stability:"experimental",owners:[...o],tags:["communication","decision","extract"],description:"Extract decisions and open questions from a thread",goal:"Make buried decisions reviewable with source references",context:"Read-only/draft-only operation for summaries and handoffs"},io:{input:a({name:"ExtractDecisionsInput",fields:{threadId:{type:i.String_unsecure(),isOptional:!1}}}),output:a({name:"ExtractDecisionsOutput",fields:{decisions:{type:i.JSONObject(),isArray:!0,isOptional:!1}}})},policy:{auth:"user"}}),F=r({meta:{key:"communication.risk.extract",version:"1.0.0",stability:"experimental",owners:[...o],tags:["communication","risk","blocker"],description:"Extract risks and blockers from a thread",goal:"Surface blockers, policy risks, and unresolved dependencies",context:"Read-only/draft-only operation for triage and escalation"},io:{input:a({name:"ExtractRisksInput",fields:{threadId:{type:i.String_unsecure(),isOptional:!1}}}),output:a({name:"ExtractRisksOutput",fields:{risks:{type:i.JSONObject(),isArray:!0,isOptional:!1}}})},policy:{auth:"user"}}),L=r({meta:{key:"communication.reply.draft",version:"1.0.0",stability:"experimental",owners:[...o],tags:["communication","reply","draft"],description:"Draft a reply using thread context and policy",goal:"Generate a safe, context-aware reply draft",context:"Draft-only operation; policy may require review or block the draft"},io:{input:a({name:"DraftReplyInput",fields:{threadId:{type:i.String_unsecure(),isOptional:!1},messageId:{type:i.String_unsecure(),isOptional:!0},instruction:{type:i.String_unsecure(),isOptional:!0}}}),output:u},policy:{auth:"user"}}),q=r({meta:{key:"communication.reply.send",version:"1.0.0",stability:"experimental",owners:[...o],tags:["communication","reply","send"],description:"Send an approved reply through its channel",goal:"Deliver a reply only when policy allows",context:"Policy-executable operation; every sent reply must be auditable"},io:{input:a({name:"SendReplyInput",fields:{draftId:{type:i.String_unsecure(),isOptional:!1}}}),output:a({name:"SendReplyOutput",fields:{draftId:{type:i.String_unsecure(),isOptional:!1},status:{type:p,isOptional:!1},sentAt:{type:i.DateTime(),isOptional:!0}}})},policy:{auth:"user"}}),H=r({meta:{key:"communication.reply.blockByPolicy",version:"1.0.0",stability:"experimental",owners:[...o],tags:["communication","reply","policy","blocked"],description:"Record that a reply was blocked by policy",goal:"Keep blocked reply decisions explicit and auditable",context:"Used by reply policy gates before any outbound side effect"},io:{input:a({name:"BlockReplyByPolicyInput",fields:{draftId:{type:i.String_unsecure(),isOptional:!1},policyRef:{type:i.String_unsecure(),isOptional:!1},reason:{type:i.String_unsecure(),isOptional:!1}}}),output:u},policy:{auth:"admin"}});export{H as BlockReplyByPolicyCommand,L as DraftReplyCommand,B as ExtractDecisionsCommand,F as ExtractRisksCommand,q as SendReplyCommand};
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
// @bun
|
|
2
|
+
import{z as o}from"zod";var g="1.0.0",y="1.0.0",h={id:"communication-os.agent-omnichannel.v1",title:"CommunicationOS agent omnichannel contracts",body:"Provider-neutral agent profiles and lifecycle links bind applications, runs, tasks, help requests, background results, routes, preferences, policies, and evidence through opaque references. They grant no provider access or effect authority.",kind:"reference",route:"/docs/communication-os/agent-omnichannel-v1",visibility:"public"},n=o.string().trim().min(1),m=o.string().datetime({offset:!0}),a=o.string().regex(/^sha256:[a-f0-9]{64}$/),u=o.object({ref:n,digest:a}).strict(),c=u.extend({revision:o.number().int().positive()}).strict(),d=o.object({tenantRef:n,workspaceRef:n.optional(),spaceRef:n.optional(),subjectRef:n}).strict(),C=o.object({schemaVersion:o.literal(g),profileRef:n,revision:o.number().int().positive(),agentRef:n,applicationRef:n,scope:d,routeBindings:o.array(c),connectionRefs:o.array(n),preferenceSet:c,policyRefs:o.array(n).min(1),evidenceRefs:o.array(n).min(1),createdAt:m,updatedAt:m,profileDigest:a}).strict().superRefine((e,t)=>{for(let s of["connectionRefs","policyRefs","evidenceRefs"])if(new Set(e[s]).size!==e[s].length)t.addIssue({code:o.ZodIssueCode.custom,path:[s],message:`${s} must be unique`});let i=e.routeBindings.map((s)=>s.ref);if(new Set(i).size!==i.length)t.addIssue({code:o.ZodIssueCode.custom,path:["routeBindings"],message:"route bindings must be unique"})}),V=o.object({schemaVersion:o.literal(y),linkRef:n,profile:c,agentRef:n,applicationRef:n,scope:d,runRef:n.optional(),taskRef:n.optional(),helpRequestRef:n.optional(),approvalRequestRef:n.optional(),backgroundResultRef:n.optional(),canonicalConversation:u.optional(),session:c.optional(),correlationRef:n,evidenceRefs:o.array(n).min(1)}).strict().superRefine((e,t)=>{if(new Set(e.evidenceRefs).size!==e.evidenceRefs.length)t.addIssue({code:o.ZodIssueCode.custom,path:["evidenceRefs"],message:"evidenceRefs must be unique"});if(!e.runRef&&!e.taskRef&&!e.helpRequestRef&&!e.approvalRequestRef&&!e.backgroundResultRef)t.addIssue({code:o.ZodIssueCode.custom,path:["runRef"],message:"at least one run, task, help request, approval request, or background result ref is required"})});function l(e,t){return e.tenantRef===t.tenantRef&&e.workspaceRef===t.workspaceRef&&e.spaceRef===t.spaceRef&&e.subjectRef===t.subjectRef}function v(e){let t=[];for(let i of["agentRef","applicationRef"])if(e.profile[i]!==e.lifecycleLink[i])t.push(`Lifecycle ${i} does not match the agent profile`);if(e.lifecycleLink.profile.ref!==e.profile.profileRef||e.lifecycleLink.profile.revision!==e.profile.revision||e.lifecycleLink.profile.digest!==e.profile.profileDigest)t.push("Lifecycle profile binding does not match the agent profile");if(!l(e.profile.scope,e.lifecycleLink.scope))t.push("Lifecycle scope does not match the agent profile");return t}function A(e){let{intent:t,progress:i}=e,s=[];if(i.deliveryRef!==t.deliveryRef||i.intent.ref!==t.deliveryRef||i.intent.digest!==t.deliveryDigest)s.push("Progress delivery does not match the intent");if(!l(i.scope,t.scope))s.push("Progress scope does not match the intent");if(i.recipientRef!==t.recipientRefs[0])s.push("Progress recipient does not match the intent");let r=t.requestedRoutes.find((f)=>f.ref===i.route.ref);if(!r||r.revision!==i.route.revision||r.digest!==i.route.digest)s.push("Progress route was not requested by the intent");if(Date.parse(i.occurredAt)<Date.parse(t.createdAt)||Date.parse(i.occurredAt)>Date.parse(t.expiresAt))s.push("Progress occurred outside the intent validity window");return s}async function k(e){let t=new TextEncoder().encode(p(e)),i=new Uint8Array(t.byteLength);i.set(t);let s=await crypto.subtle.digest("SHA-256",i.buffer),r=Array.from(new Uint8Array(s),(f)=>f.toString(16).padStart(2,"0")).join("");return a.parse(`sha256:${r}`)}function p(e){if(Array.isArray(e))return`[${e.map(p).join(",")}]`;if(e&&typeof e==="object")return`{${Object.entries(e).sort(([t],[i])=>t.localeCompare(i)).map(([t,i])=>`${JSON.stringify(t)}:${p(i)}`).join(",")}}`;return JSON.stringify(e)}export{k as digestCommunicationArtifactV1};
|
|
@@ -0,0 +1,46 @@
|
|
|
1
|
+
import { z } from 'zod';
|
|
2
|
+
import { CommunicationScopeBindingV1Schema } from './agent-communication.js';
|
|
3
|
+
export declare const COMMUNICATION_CANONICAL_AGENT_CONVERSATION_V1: 'communication.canonical-agent-conversation.v1';
|
|
4
|
+
/** Durable conversation identity shared by every authorized surface. */
|
|
5
|
+
export declare const CommunicationCanonicalAgentConversationV1Schema: z.ZodObject<{
|
|
6
|
+
schemaVersion: z.ZodLiteral<"communication.canonical-agent-conversation.v1">;
|
|
7
|
+
conversationRef: z.ZodString;
|
|
8
|
+
conversationDigest: z.ZodString;
|
|
9
|
+
revision: z.ZodNumber;
|
|
10
|
+
scope: z.ZodObject<{
|
|
11
|
+
tenantRef: z.ZodString;
|
|
12
|
+
workspaceRef: z.ZodOptional<z.ZodString>;
|
|
13
|
+
spaceRef: z.ZodOptional<z.ZodString>;
|
|
14
|
+
subjectRef: z.ZodString;
|
|
15
|
+
}, z.core.$strict>;
|
|
16
|
+
roomRef: z.ZodString;
|
|
17
|
+
session: z.ZodObject<{
|
|
18
|
+
ref: z.ZodString;
|
|
19
|
+
digest: z.ZodString;
|
|
20
|
+
revision: z.ZodNumber;
|
|
21
|
+
}, z.core.$strict>;
|
|
22
|
+
origin: z.ZodEnum<{
|
|
23
|
+
background: "background";
|
|
24
|
+
branch: "branch";
|
|
25
|
+
interactive: "interactive";
|
|
26
|
+
recovery: "recovery";
|
|
27
|
+
replay: "replay";
|
|
28
|
+
scheduled: "scheduled";
|
|
29
|
+
}>;
|
|
30
|
+
parentConversation: z.ZodOptional<z.ZodObject<{
|
|
31
|
+
ref: z.ZodString;
|
|
32
|
+
digest: z.ZodString;
|
|
33
|
+
}, z.core.$strict>>;
|
|
34
|
+
participantRefs: z.ZodArray<z.ZodString>;
|
|
35
|
+
channelIdentityRefs: z.ZodArray<z.ZodString>;
|
|
36
|
+
createdAt: z.ZodString;
|
|
37
|
+
updatedAt: z.ZodString;
|
|
38
|
+
effectAuthority: z.ZodLiteral<"none">;
|
|
39
|
+
}, z.core.$strict>;
|
|
40
|
+
export type CommunicationCanonicalAgentConversationV1 = z.infer<typeof CommunicationCanonicalAgentConversationV1Schema>;
|
|
41
|
+
export declare function digestCommunicationCanonicalAgentConversationV1(conversation: Omit<CommunicationCanonicalAgentConversationV1, 'conversationDigest'>): Promise<`sha256:${string}`>;
|
|
42
|
+
export declare function verifyCommunicationCanonicalAgentConversationV1(conversation: CommunicationCanonicalAgentConversationV1): Promise<boolean>;
|
|
43
|
+
export declare function validateCanonicalConversationScopeV1(input: {
|
|
44
|
+
conversation: CommunicationCanonicalAgentConversationV1;
|
|
45
|
+
scope: z.infer<typeof CommunicationScopeBindingV1Schema>;
|
|
46
|
+
}): string[];
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
// @bun
|
|
2
|
+
import{z as r}from"zod";import{z as i}from"zod";var h="1.0.0",R="1.0.0",S={id:"communication-os.agent-omnichannel.v1",title:"CommunicationOS agent omnichannel contracts",body:"Provider-neutral agent profiles and lifecycle links bind applications, runs, tasks, help requests, background results, routes, preferences, policies, and evidence through opaque references. They grant no provider access or effect authority.",kind:"reference",route:"/docs/communication-os/agent-omnichannel-v1",visibility:"public"},o=i.string().trim().min(1),C=i.string().datetime({offset:!0}),c=i.string().regex(/^sha256:[a-f0-9]{64}$/),f=i.object({ref:o,digest:c}).strict(),a=f.extend({revision:i.number().int().positive()}).strict(),p=i.object({tenantRef:o,workspaceRef:o.optional(),spaceRef:o.optional(),subjectRef:o}).strict(),b=i.object({schemaVersion:i.literal(h),profileRef:o,revision:i.number().int().positive(),agentRef:o,applicationRef:o,scope:p,routeBindings:i.array(a),connectionRefs:i.array(o),preferenceSet:a,policyRefs:i.array(o).min(1),evidenceRefs:i.array(o).min(1),createdAt:C,updatedAt:C,profileDigest:c}).strict().superRefine((e,n)=>{for(let s of["connectionRefs","policyRefs","evidenceRefs"])if(new Set(e[s]).size!==e[s].length)n.addIssue({code:i.ZodIssueCode.custom,path:[s],message:`${s} must be unique`});let t=e.routeBindings.map((s)=>s.ref);if(new Set(t).size!==t.length)n.addIssue({code:i.ZodIssueCode.custom,path:["routeBindings"],message:"route bindings must be unique"})}),I=i.object({schemaVersion:i.literal(R),linkRef:o,profile:a,agentRef:o,applicationRef:o,scope:p,runRef:o.optional(),taskRef:o.optional(),helpRequestRef:o.optional(),approvalRequestRef:o.optional(),backgroundResultRef:o.optional(),canonicalConversation:f.optional(),session:a.optional(),correlationRef:o,evidenceRefs:i.array(o).min(1)}).strict().superRefine((e,n)=>{if(new Set(e.evidenceRefs).size!==e.evidenceRefs.length)n.addIssue({code:i.ZodIssueCode.custom,path:["evidenceRefs"],message:"evidenceRefs must be unique"});if(!e.runRef&&!e.taskRef&&!e.helpRequestRef&&!e.approvalRequestRef&&!e.backgroundResultRef)n.addIssue({code:i.ZodIssueCode.custom,path:["runRef"],message:"at least one run, task, help request, approval request, or background result ref is required"})});function u(e,n){return e.tenantRef===n.tenantRef&&e.workspaceRef===n.workspaceRef&&e.spaceRef===n.spaceRef&&e.subjectRef===n.subjectRef}function k(e){let n=[];for(let t of["agentRef","applicationRef"])if(e.profile[t]!==e.lifecycleLink[t])n.push(`Lifecycle ${t} does not match the agent profile`);if(e.lifecycleLink.profile.ref!==e.profile.profileRef||e.lifecycleLink.profile.revision!==e.profile.revision||e.lifecycleLink.profile.digest!==e.profile.profileDigest)n.push("Lifecycle profile binding does not match the agent profile");if(!u(e.profile.scope,e.lifecycleLink.scope))n.push("Lifecycle scope does not match the agent profile");return n}function x(e){let{intent:n,progress:t}=e,s=[];if(t.deliveryRef!==n.deliveryRef||t.intent.ref!==n.deliveryRef||t.intent.digest!==n.deliveryDigest)s.push("Progress delivery does not match the intent");if(!u(t.scope,n.scope))s.push("Progress scope does not match the intent");if(t.recipientRef!==n.recipientRefs[0])s.push("Progress recipient does not match the intent");let m=n.requestedRoutes.find((l)=>l.ref===t.route.ref);if(!m||m.revision!==t.route.revision||m.digest!==t.route.digest)s.push("Progress route was not requested by the intent");if(Date.parse(t.occurredAt)<Date.parse(n.createdAt)||Date.parse(t.occurredAt)>Date.parse(n.expiresAt))s.push("Progress occurred outside the intent validity window");return s}async function y(e){let n=new TextEncoder().encode(g(e)),t=new Uint8Array(n.byteLength);t.set(n);let s=await crypto.subtle.digest("SHA-256",t.buffer),m=Array.from(new Uint8Array(s),(l)=>l.toString(16).padStart(2,"0")).join("");return c.parse(`sha256:${m}`)}function g(e){if(Array.isArray(e))return`[${e.map(g).join(",")}]`;if(e&&typeof e==="object")return`{${Object.entries(e).sort(([n],[t])=>n.localeCompare(t)).map(([n,t])=>`${JSON.stringify(n)}:${g(t)}`).join(",")}}`;return JSON.stringify(e)}var A="communication.canonical-agent-conversation.v1",d=r.string().trim().min(1),w=r.object({schemaVersion:r.literal(A),conversationRef:d,conversationDigest:c,revision:r.number().int().positive(),scope:p,roomRef:d,session:a,origin:r.enum(["interactive","scheduled","background","recovery","replay","branch"]),parentConversation:f.optional(),participantRefs:r.array(d).min(1),channelIdentityRefs:r.array(d),createdAt:r.string().datetime({offset:!0}),updatedAt:r.string().datetime({offset:!0}),effectAuthority:r.literal("none")}).strict().superRefine((e,n)=>{for(let t of["participantRefs","channelIdentityRefs"])if(new Set(e[t]).size!==e[t].length)n.addIssue({code:r.ZodIssueCode.custom,path:[t],message:`${t} must be unique`});if(e.origin==="branch"!==Boolean(e.parentConversation))n.addIssue({code:r.ZodIssueCode.custom,path:["parentConversation"],message:"parentConversation is required only for branch origin"});if(Date.parse(e.updatedAt)<Date.parse(e.createdAt))n.addIssue({code:r.ZodIssueCode.custom,path:["updatedAt"],message:"updatedAt cannot precede createdAt"})});async function V(e){return y(e)}async function P(e){let{conversationDigest:n,...t}=e;return n===await V(t)}function E(e){return u(e.conversation.scope,e.scope)?[]:["Canonical conversation scope does not match"]}export{A as COMMUNICATION_CANONICAL_AGENT_CONVERSATION_V1,w as CommunicationCanonicalAgentConversationV1Schema,V as digestCommunicationCanonicalAgentConversationV1,E as validateCanonicalConversationScopeV1,P as verifyCommunicationCanonicalAgentConversationV1};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|