@kya-os/contracts 1.9.0 → 1.9.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/dist/agent-deployment-utils.d.ts +0 -1
- package/dist/agent-deployment-utils.js +0 -1
- package/dist/agent-deployment.d.ts +0 -1
- package/dist/agent-deployment.js +0 -1
- package/dist/agentshield-api/admin-schemas.d.ts +0 -1
- package/dist/agentshield-api/admin-schemas.js +0 -1
- package/dist/agentshield-api/admin-types.d.ts +0 -1
- package/dist/agentshield-api/admin-types.js +0 -1
- package/dist/agentshield-api/endpoints.d.ts +0 -1
- package/dist/agentshield-api/endpoints.js +0 -1
- package/dist/agentshield-api/index.d.ts +0 -1
- package/dist/agentshield-api/schemas.d.ts +186 -186
- package/dist/agentshield-api/types.d.ts +0 -1
- package/dist/audit/index.d.ts +21 -21
- package/dist/cli.d.ts +0 -1
- package/dist/cli.js +0 -1
- package/dist/compute-binding.d.ts +0 -1
- package/dist/compute-binding.js +0 -1
- package/dist/compute.d.ts +19 -19
- package/dist/config/base.d.ts +0 -1
- package/dist/config/base.js +0 -1
- package/dist/config/builder.d.ts +0 -1
- package/dist/config/builder.js +0 -1
- package/dist/config/client-messages.d.ts +0 -1
- package/dist/config/client-messages.js +0 -1
- package/dist/config/delegation.d.ts +0 -1
- package/dist/config/delegation.js +0 -1
- package/dist/config/identity.d.ts +0 -1
- package/dist/config/identity.js +0 -1
- package/dist/config/index.d.ts +0 -1
- package/dist/config/index.js +0 -1
- package/dist/config/proofing.d.ts +0 -1
- package/dist/config/proofing.js +0 -1
- package/dist/config/tool-context.d.ts +0 -1
- package/dist/config/tool-context.js +0 -1
- package/dist/config/tool-protection.d.ts +0 -1
- package/dist/consent/schemas.d.ts +0 -1
- package/dist/consent/schemas.js +0 -1
- package/dist/consent/types.d.ts +0 -1
- package/dist/consent/types.js +0 -1
- package/dist/dashboard-config/default-config.d.ts +0 -1
- package/dist/dashboard-config/index.d.ts +0 -1
- package/dist/dashboard-config/schemas.d.ts +2436 -2436
- package/dist/dashboard-config/types.d.ts +0 -1
- package/dist/delegation/constraints.d.ts +0 -1
- package/dist/delegation/constraints.js +0 -1
- package/dist/delegation/index.d.ts +0 -1
- package/dist/delegation/index.js +0 -1
- package/dist/delegation/schemas.d.ts +0 -1
- package/dist/delegation/schemas.js +0 -1
- package/dist/deploy/index.d.ts +0 -1
- package/dist/deploy/index.js +0 -1
- package/dist/deploy/schemas.d.ts +0 -1
- package/dist/deploy/schemas.js +0 -1
- package/dist/deploy/types.d.ts +0 -1
- package/dist/deploy/types.js +0 -1
- package/dist/did/index.d.ts +0 -1
- package/dist/did/index.js +0 -1
- package/dist/did/resolve-contract.d.ts +0 -1
- package/dist/did/resolve-contract.js +0 -1
- package/dist/did/schemas.d.ts +0 -1
- package/dist/did/schemas.js +0 -1
- package/dist/did/types.d.ts +0 -1
- package/dist/did/types.js +0 -1
- package/dist/env/constants.d.ts +0 -1
- package/dist/env/constants.js +0 -1
- package/dist/env/index.d.ts +0 -1
- package/dist/env/index.js +0 -1
- package/dist/gateway/agents.d.ts +0 -1
- package/dist/gateway/agents.js +0 -1
- package/dist/gateway/cron.d.ts +0 -1
- package/dist/gateway/cron.js +0 -1
- package/dist/gateway/index.d.ts +0 -1
- package/dist/gateway/index.js +0 -1
- package/dist/gateway/sessions.d.ts +0 -1
- package/dist/gateway/sessions.js +0 -1
- package/dist/gateway/skills.d.ts +0 -1
- package/dist/gateway/skills.js +0 -1
- package/dist/gateway/usage.d.ts +0 -1
- package/dist/gateway/usage.js +0 -1
- package/dist/handshake.d.ts +24 -24
- package/dist/identity/index.d.ts +0 -1
- package/dist/identity/index.js +0 -1
- package/dist/identity/schemas.d.ts +0 -1
- package/dist/identity/schemas.js +0 -1
- package/dist/index.d.ts +0 -1
- package/dist/molti/admin-ws.d.ts +0 -1
- package/dist/molti/admin-ws.js +0 -1
- package/dist/molti/index.d.ts +0 -1
- package/dist/molti/index.js +0 -1
- package/dist/molti/schemas.d.ts +0 -1
- package/dist/molti/schemas.js +0 -1
- package/dist/molti/types.d.ts +0 -1
- package/dist/molti/types.js +0 -1
- package/dist/pairing/index.d.ts +0 -1
- package/dist/pairing/index.js +0 -1
- package/dist/policy/index.d.ts +0 -1
- package/dist/policy/index.js +0 -1
- package/dist/policy/schemas.d.ts +0 -1
- package/dist/policy/schemas.js +0 -1
- package/dist/proof/proof-record.d.ts +0 -1
- package/dist/proof/proof-record.js +0 -1
- package/dist/proof/signing-spec.d.ts +0 -1
- package/dist/proof/signing-spec.js +0 -1
- package/dist/proof.d.ts +66 -66
- package/dist/registry.d.ts +0 -1
- package/dist/registry.js +0 -1
- package/dist/reputation/api.d.ts +0 -1
- package/dist/reputation/api.js +0 -1
- package/dist/reputation/constants.d.ts +0 -1
- package/dist/reputation/constants.js +0 -1
- package/dist/reputation/credentials.d.ts +0 -1
- package/dist/reputation/credentials.js +0 -1
- package/dist/reputation/index.d.ts +1 -1
- package/dist/reputation/index.js +2 -1
- package/dist/reputation/interactions.d.ts +146 -0
- package/dist/reputation/interactions.js +82 -0
- package/dist/reputation/schemas.d.ts +0 -1
- package/dist/reputation/schemas.js +0 -1
- package/dist/runtime/errors.d.ts +0 -1
- package/dist/runtime/errors.js +0 -1
- package/dist/runtime/index.d.ts +0 -1
- package/dist/test.d.ts +0 -1
- package/dist/test.js +0 -1
- package/dist/tlkrc/index.d.ts +0 -1
- package/dist/tlkrc/index.js +0 -1
- package/dist/tlkrc/rotation.d.ts +0 -1
- package/dist/tlkrc/rotation.js +0 -1
- package/dist/tool-protection/index.d.ts +36 -36
- package/dist/utils/validation.d.ts +0 -1
- package/dist/utils/validation.js +0 -1
- package/dist/vault/schemas.d.ts +2 -2
- package/dist/vc/index.d.ts +0 -1
- package/dist/vc/index.js +0 -1
- package/dist/vc/schemas.d.ts +0 -1
- package/dist/vc/schemas.js +0 -1
- package/dist/vc/statuslist.d.ts +0 -1
- package/dist/vc/statuslist.js +0 -1
- package/dist/verifier/index.d.ts +0 -1
- package/dist/verifier.d.ts +6 -6
- package/dist/well-known/index.d.ts +0 -1
- package/dist/well-known/index.js +0 -1
- package/package.json +1 -1
- package/dist/__fixtures__/index.d.ts +0 -8
- package/dist/__fixtures__/index.d.ts.map +0 -1
- package/dist/__fixtures__/index.js +0 -29
- package/dist/__fixtures__/index.js.map +0 -1
- package/dist/__fixtures__/proof/ed25519-fixtures.d.ts +0 -253
- package/dist/__fixtures__/proof/ed25519-fixtures.d.ts.map +0 -1
- package/dist/__fixtures__/proof/ed25519-fixtures.js +0 -247
- package/dist/__fixtures__/proof/ed25519-fixtures.js.map +0 -1
- package/dist/__fixtures__/proof/keys-and-payloads.json +0 -103
- package/dist/agent-deployment-utils.d.ts.map +0 -1
- package/dist/agent-deployment-utils.js.map +0 -1
- package/dist/agent-deployment.d.ts.map +0 -1
- package/dist/agent-deployment.js.map +0 -1
- package/dist/agentshield-api/admin-schemas.d.ts.map +0 -1
- package/dist/agentshield-api/admin-schemas.js.map +0 -1
- package/dist/agentshield-api/admin-types.d.ts.map +0 -1
- package/dist/agentshield-api/admin-types.js.map +0 -1
- package/dist/agentshield-api/endpoints.d.ts.map +0 -1
- package/dist/agentshield-api/endpoints.js.map +0 -1
- package/dist/agentshield-api/index.d.ts.map +0 -1
- package/dist/agentshield-api/index.js.map +0 -1
- package/dist/agentshield-api/schemas.d.ts.map +0 -1
- package/dist/agentshield-api/schemas.js.map +0 -1
- package/dist/agentshield-api/types.d.ts.map +0 -1
- package/dist/agentshield-api/types.js.map +0 -1
- package/dist/audit/index.d.ts.map +0 -1
- package/dist/audit/index.js.map +0 -1
- package/dist/cli.d.ts.map +0 -1
- package/dist/cli.js.map +0 -1
- package/dist/compute-binding.d.ts.map +0 -1
- package/dist/compute-binding.js.map +0 -1
- package/dist/compute.d.ts.map +0 -1
- package/dist/compute.js.map +0 -1
- package/dist/config/base.d.ts.map +0 -1
- package/dist/config/base.js.map +0 -1
- package/dist/config/builder.d.ts.map +0 -1
- package/dist/config/builder.js.map +0 -1
- package/dist/config/client-messages.d.ts.map +0 -1
- package/dist/config/client-messages.js.map +0 -1
- package/dist/config/delegation.d.ts.map +0 -1
- package/dist/config/delegation.js.map +0 -1
- package/dist/config/identity.d.ts.map +0 -1
- package/dist/config/identity.js.map +0 -1
- package/dist/config/index.d.ts.map +0 -1
- package/dist/config/index.js.map +0 -1
- package/dist/config/proofing.d.ts.map +0 -1
- package/dist/config/proofing.js.map +0 -1
- package/dist/config/tool-context.d.ts.map +0 -1
- package/dist/config/tool-context.js.map +0 -1
- package/dist/config/tool-protection.d.ts.map +0 -1
- package/dist/config/tool-protection.js.map +0 -1
- package/dist/consent/index.d.ts.map +0 -1
- package/dist/consent/index.js.map +0 -1
- package/dist/consent/schemas.d.ts.map +0 -1
- package/dist/consent/schemas.js.map +0 -1
- package/dist/consent/types.d.ts.map +0 -1
- package/dist/consent/types.js.map +0 -1
- package/dist/dashboard-config/default-config.d.ts.map +0 -1
- package/dist/dashboard-config/default-config.js.map +0 -1
- package/dist/dashboard-config/index.d.ts.map +0 -1
- package/dist/dashboard-config/index.js.map +0 -1
- package/dist/dashboard-config/schemas.d.ts.map +0 -1
- package/dist/dashboard-config/schemas.js.map +0 -1
- package/dist/dashboard-config/types.d.ts.map +0 -1
- package/dist/dashboard-config/types.js.map +0 -1
- package/dist/delegation/constraints.d.ts.map +0 -1
- package/dist/delegation/constraints.js.map +0 -1
- package/dist/delegation/index.d.ts.map +0 -1
- package/dist/delegation/index.js.map +0 -1
- package/dist/delegation/schemas.d.ts.map +0 -1
- package/dist/delegation/schemas.js.map +0 -1
- package/dist/deploy/index.d.ts.map +0 -1
- package/dist/deploy/index.js.map +0 -1
- package/dist/deploy/schemas.d.ts.map +0 -1
- package/dist/deploy/schemas.js.map +0 -1
- package/dist/deploy/types.d.ts.map +0 -1
- package/dist/deploy/types.js.map +0 -1
- package/dist/did/index.d.ts.map +0 -1
- package/dist/did/index.js.map +0 -1
- package/dist/did/resolve-contract.d.ts.map +0 -1
- package/dist/did/resolve-contract.js.map +0 -1
- package/dist/did/schemas.d.ts.map +0 -1
- package/dist/did/schemas.js.map +0 -1
- package/dist/did/types.d.ts.map +0 -1
- package/dist/did/types.js.map +0 -1
- package/dist/env/constants.d.ts.map +0 -1
- package/dist/env/constants.js.map +0 -1
- package/dist/env/index.d.ts.map +0 -1
- package/dist/env/index.js.map +0 -1
- package/dist/gateway/agents.d.ts.map +0 -1
- package/dist/gateway/agents.js.map +0 -1
- package/dist/gateway/cron.d.ts.map +0 -1
- package/dist/gateway/cron.js.map +0 -1
- package/dist/gateway/index.d.ts.map +0 -1
- package/dist/gateway/index.js.map +0 -1
- package/dist/gateway/sessions.d.ts.map +0 -1
- package/dist/gateway/sessions.js.map +0 -1
- package/dist/gateway/skills.d.ts.map +0 -1
- package/dist/gateway/skills.js.map +0 -1
- package/dist/gateway/usage.d.ts.map +0 -1
- package/dist/gateway/usage.js.map +0 -1
- package/dist/handshake.d.ts.map +0 -1
- package/dist/handshake.js.map +0 -1
- package/dist/identity/index.d.ts.map +0 -1
- package/dist/identity/index.js.map +0 -1
- package/dist/identity/schemas.d.ts.map +0 -1
- package/dist/identity/schemas.js.map +0 -1
- package/dist/index.d.ts.map +0 -1
- package/dist/index.js.map +0 -1
- package/dist/molti/admin-ws.d.ts.map +0 -1
- package/dist/molti/admin-ws.js.map +0 -1
- package/dist/molti/index.d.ts.map +0 -1
- package/dist/molti/index.js.map +0 -1
- package/dist/molti/schemas.d.ts.map +0 -1
- package/dist/molti/schemas.js.map +0 -1
- package/dist/molti/types.d.ts.map +0 -1
- package/dist/molti/types.js.map +0 -1
- package/dist/openclaw/index.d.ts +0 -20
- package/dist/openclaw/index.js +0 -28
- package/dist/openclaw/types.d.ts +0 -714
- package/dist/openclaw/types.js +0 -122
- package/dist/org-secret-definitions.d.ts +0 -18
- package/dist/org-secret-definitions.js +0 -72
- package/dist/pairing/index.d.ts.map +0 -1
- package/dist/pairing/index.js.map +0 -1
- package/dist/policy/index.d.ts.map +0 -1
- package/dist/policy/index.js.map +0 -1
- package/dist/policy/schemas.d.ts.map +0 -1
- package/dist/policy/schemas.js.map +0 -1
- package/dist/proof/index.d.ts.map +0 -1
- package/dist/proof/index.js.map +0 -1
- package/dist/proof/proof-record.d.ts.map +0 -1
- package/dist/proof/proof-record.js.map +0 -1
- package/dist/proof/signing-spec.d.ts.map +0 -1
- package/dist/proof/signing-spec.js.map +0 -1
- package/dist/proof.d.ts.map +0 -1
- package/dist/proof.js.map +0 -1
- package/dist/registry.d.ts.map +0 -1
- package/dist/registry.js.map +0 -1
- package/dist/reputation/api.d.ts.map +0 -1
- package/dist/reputation/api.js.map +0 -1
- package/dist/reputation/constants.d.ts.map +0 -1
- package/dist/reputation/constants.js.map +0 -1
- package/dist/reputation/credentials.d.ts.map +0 -1
- package/dist/reputation/credentials.js.map +0 -1
- package/dist/reputation/index.d.ts.map +0 -1
- package/dist/reputation/index.js.map +0 -1
- package/dist/reputation/schemas.d.ts.map +0 -1
- package/dist/reputation/schemas.js.map +0 -1
- package/dist/runtime/errors.d.ts.map +0 -1
- package/dist/runtime/errors.js.map +0 -1
- package/dist/runtime/headers.d.ts.map +0 -1
- package/dist/runtime/headers.js.map +0 -1
- package/dist/runtime/index.d.ts.map +0 -1
- package/dist/runtime/index.js.map +0 -1
- package/dist/test.d.ts.map +0 -1
- package/dist/test.js.map +0 -1
- package/dist/tlkrc/index.d.ts.map +0 -1
- package/dist/tlkrc/index.js.map +0 -1
- package/dist/tlkrc/rotation.d.ts.map +0 -1
- package/dist/tlkrc/rotation.js.map +0 -1
- package/dist/tool-protection/index.d.ts.map +0 -1
- package/dist/tool-protection/index.js.map +0 -1
- package/dist/utils/validation.d.ts.map +0 -1
- package/dist/utils/validation.js.map +0 -1
- package/dist/vc/index.d.ts.map +0 -1
- package/dist/vc/index.js.map +0 -1
- package/dist/vc/schemas.d.ts.map +0 -1
- package/dist/vc/schemas.js.map +0 -1
- package/dist/vc/statuslist.d.ts.map +0 -1
- package/dist/vc/statuslist.js.map +0 -1
- package/dist/verifier/index.d.ts.map +0 -1
- package/dist/verifier/index.js.map +0 -1
- package/dist/verifier.d.ts.map +0 -1
- package/dist/verifier.js.map +0 -1
- package/dist/well-known/index.d.ts.map +0 -1
- package/dist/well-known/index.js.map +0 -1
package/dist/proof.d.ts
CHANGED
|
@@ -40,31 +40,31 @@ export declare const ProofMetaSchema: z.ZodObject<{
|
|
|
40
40
|
delegationRef: z.ZodOptional<z.ZodString>;
|
|
41
41
|
clientDid: z.ZodOptional<z.ZodString>;
|
|
42
42
|
}, "strip", z.ZodTypeAny, {
|
|
43
|
+
did: string;
|
|
44
|
+
kid: string;
|
|
43
45
|
nonce: string;
|
|
44
46
|
audience: string;
|
|
45
47
|
sessionId: string;
|
|
46
|
-
|
|
47
|
-
kid: string;
|
|
48
|
+
ts: number;
|
|
48
49
|
requestHash: string;
|
|
49
50
|
responseHash: string;
|
|
50
|
-
ts: number;
|
|
51
51
|
clientDid?: string | undefined;
|
|
52
52
|
delegationRef?: string | undefined;
|
|
53
|
-
scopeId?: string | undefined;
|
|
54
53
|
outcome?: "allowed" | "denied" | "step_up_required" | "needs_authorization" | undefined;
|
|
54
|
+
scopeId?: string | undefined;
|
|
55
55
|
}, {
|
|
56
|
+
did: string;
|
|
57
|
+
kid: string;
|
|
56
58
|
nonce: string;
|
|
57
59
|
audience: string;
|
|
58
60
|
sessionId: string;
|
|
59
|
-
|
|
60
|
-
kid: string;
|
|
61
|
+
ts: number;
|
|
61
62
|
requestHash: string;
|
|
62
63
|
responseHash: string;
|
|
63
|
-
ts: number;
|
|
64
64
|
clientDid?: string | undefined;
|
|
65
65
|
delegationRef?: string | undefined;
|
|
66
|
-
scopeId?: string | undefined;
|
|
67
66
|
outcome?: "allowed" | "denied" | "step_up_required" | "needs_authorization" | undefined;
|
|
67
|
+
scopeId?: string | undefined;
|
|
68
68
|
}>;
|
|
69
69
|
export declare const DetachedProofSchema: z.ZodObject<{
|
|
70
70
|
jws: z.ZodString;
|
|
@@ -82,63 +82,63 @@ export declare const DetachedProofSchema: z.ZodObject<{
|
|
|
82
82
|
delegationRef: z.ZodOptional<z.ZodString>;
|
|
83
83
|
clientDid: z.ZodOptional<z.ZodString>;
|
|
84
84
|
}, "strip", z.ZodTypeAny, {
|
|
85
|
+
did: string;
|
|
86
|
+
kid: string;
|
|
85
87
|
nonce: string;
|
|
86
88
|
audience: string;
|
|
87
89
|
sessionId: string;
|
|
88
|
-
|
|
89
|
-
kid: string;
|
|
90
|
+
ts: number;
|
|
90
91
|
requestHash: string;
|
|
91
92
|
responseHash: string;
|
|
92
|
-
ts: number;
|
|
93
93
|
clientDid?: string | undefined;
|
|
94
94
|
delegationRef?: string | undefined;
|
|
95
|
-
scopeId?: string | undefined;
|
|
96
95
|
outcome?: "allowed" | "denied" | "step_up_required" | "needs_authorization" | undefined;
|
|
96
|
+
scopeId?: string | undefined;
|
|
97
97
|
}, {
|
|
98
|
+
did: string;
|
|
99
|
+
kid: string;
|
|
98
100
|
nonce: string;
|
|
99
101
|
audience: string;
|
|
100
102
|
sessionId: string;
|
|
101
|
-
|
|
102
|
-
kid: string;
|
|
103
|
+
ts: number;
|
|
103
104
|
requestHash: string;
|
|
104
105
|
responseHash: string;
|
|
105
|
-
ts: number;
|
|
106
106
|
clientDid?: string | undefined;
|
|
107
107
|
delegationRef?: string | undefined;
|
|
108
|
-
scopeId?: string | undefined;
|
|
109
108
|
outcome?: "allowed" | "denied" | "step_up_required" | "needs_authorization" | undefined;
|
|
109
|
+
scopeId?: string | undefined;
|
|
110
110
|
}>;
|
|
111
111
|
}, "strip", z.ZodTypeAny, {
|
|
112
112
|
jws: string;
|
|
113
113
|
meta: {
|
|
114
|
+
did: string;
|
|
115
|
+
kid: string;
|
|
114
116
|
nonce: string;
|
|
115
117
|
audience: string;
|
|
116
118
|
sessionId: string;
|
|
117
|
-
|
|
118
|
-
kid: string;
|
|
119
|
+
ts: number;
|
|
119
120
|
requestHash: string;
|
|
120
121
|
responseHash: string;
|
|
121
|
-
ts: number;
|
|
122
122
|
clientDid?: string | undefined;
|
|
123
123
|
delegationRef?: string | undefined;
|
|
124
|
-
scopeId?: string | undefined;
|
|
125
124
|
outcome?: "allowed" | "denied" | "step_up_required" | "needs_authorization" | undefined;
|
|
125
|
+
scopeId?: string | undefined;
|
|
126
126
|
};
|
|
127
127
|
}, {
|
|
128
128
|
jws: string;
|
|
129
129
|
meta: {
|
|
130
|
+
did: string;
|
|
131
|
+
kid: string;
|
|
130
132
|
nonce: string;
|
|
131
133
|
audience: string;
|
|
132
134
|
sessionId: string;
|
|
133
|
-
|
|
134
|
-
kid: string;
|
|
135
|
+
ts: number;
|
|
135
136
|
requestHash: string;
|
|
136
137
|
responseHash: string;
|
|
137
|
-
ts: number;
|
|
138
138
|
clientDid?: string | undefined;
|
|
139
139
|
delegationRef?: string | undefined;
|
|
140
|
-
scopeId?: string | undefined;
|
|
141
140
|
outcome?: "allowed" | "denied" | "step_up_required" | "needs_authorization" | undefined;
|
|
141
|
+
scopeId?: string | undefined;
|
|
142
142
|
};
|
|
143
143
|
}>;
|
|
144
144
|
export declare const CanonicalHashesSchema: z.ZodObject<{
|
|
@@ -164,25 +164,25 @@ export declare const AuditRecordSchema: z.ZodObject<{
|
|
|
164
164
|
scope: z.ZodString;
|
|
165
165
|
}, "strip", z.ZodTypeAny, {
|
|
166
166
|
version: "audit.v1";
|
|
167
|
-
audience: string;
|
|
168
167
|
did: string;
|
|
169
168
|
kid: string;
|
|
170
|
-
|
|
171
|
-
verified: "yes" | "no";
|
|
169
|
+
audience: string;
|
|
172
170
|
ts: number;
|
|
171
|
+
session: string;
|
|
173
172
|
reqHash: string;
|
|
174
173
|
resHash: string;
|
|
174
|
+
verified: "yes" | "no";
|
|
175
175
|
scope: string;
|
|
176
176
|
}, {
|
|
177
177
|
version: "audit.v1";
|
|
178
|
-
audience: string;
|
|
179
178
|
did: string;
|
|
180
179
|
kid: string;
|
|
181
|
-
|
|
182
|
-
verified: "yes" | "no";
|
|
180
|
+
audience: string;
|
|
183
181
|
ts: number;
|
|
182
|
+
session: string;
|
|
184
183
|
reqHash: string;
|
|
185
184
|
resHash: string;
|
|
185
|
+
verified: "yes" | "no";
|
|
186
186
|
scope: string;
|
|
187
187
|
}>;
|
|
188
188
|
export type ProofMeta = z.infer<typeof ProofMetaSchema>;
|
|
@@ -206,14 +206,14 @@ export declare const ToolCallContextSchema: z.ZodObject<{
|
|
|
206
206
|
scopeId: string;
|
|
207
207
|
tool: string;
|
|
208
208
|
args: Record<string, unknown>;
|
|
209
|
-
result?: unknown;
|
|
210
209
|
userId?: string | undefined;
|
|
210
|
+
result?: unknown;
|
|
211
211
|
}, {
|
|
212
212
|
scopeId: string;
|
|
213
213
|
tool: string;
|
|
214
214
|
args: Record<string, unknown>;
|
|
215
|
-
result?: unknown;
|
|
216
215
|
userId?: string | undefined;
|
|
216
|
+
result?: unknown;
|
|
217
217
|
}>;
|
|
218
218
|
/**
|
|
219
219
|
* Proof submission context for AgentShield API
|
|
@@ -230,14 +230,14 @@ export declare const ProofSubmissionContextSchema: z.ZodObject<{
|
|
|
230
230
|
scopeId: string;
|
|
231
231
|
tool: string;
|
|
232
232
|
args: Record<string, unknown>;
|
|
233
|
-
result?: unknown;
|
|
234
233
|
userId?: string | undefined;
|
|
234
|
+
result?: unknown;
|
|
235
235
|
}, {
|
|
236
236
|
scopeId: string;
|
|
237
237
|
tool: string;
|
|
238
238
|
args: Record<string, unknown>;
|
|
239
|
-
result?: unknown;
|
|
240
239
|
userId?: string | undefined;
|
|
240
|
+
result?: unknown;
|
|
241
241
|
}>, "many">;
|
|
242
242
|
mcpServerUrl: z.ZodOptional<z.ZodString>;
|
|
243
243
|
}, "strip", z.ZodTypeAny, {
|
|
@@ -245,8 +245,8 @@ export declare const ProofSubmissionContextSchema: z.ZodObject<{
|
|
|
245
245
|
scopeId: string;
|
|
246
246
|
tool: string;
|
|
247
247
|
args: Record<string, unknown>;
|
|
248
|
-
result?: unknown;
|
|
249
248
|
userId?: string | undefined;
|
|
249
|
+
result?: unknown;
|
|
250
250
|
}[];
|
|
251
251
|
mcpServerUrl?: string | undefined;
|
|
252
252
|
}, {
|
|
@@ -254,8 +254,8 @@ export declare const ProofSubmissionContextSchema: z.ZodObject<{
|
|
|
254
254
|
scopeId: string;
|
|
255
255
|
tool: string;
|
|
256
256
|
args: Record<string, unknown>;
|
|
257
|
-
result?: unknown;
|
|
258
257
|
userId?: string | undefined;
|
|
258
|
+
result?: unknown;
|
|
259
259
|
}[];
|
|
260
260
|
mcpServerUrl?: string | undefined;
|
|
261
261
|
}>;
|
|
@@ -281,63 +281,63 @@ export declare const ProofSubmissionRequestSchema: z.ZodObject<{
|
|
|
281
281
|
delegationRef: z.ZodOptional<z.ZodString>;
|
|
282
282
|
clientDid: z.ZodOptional<z.ZodString>;
|
|
283
283
|
}, "strip", z.ZodTypeAny, {
|
|
284
|
+
did: string;
|
|
285
|
+
kid: string;
|
|
284
286
|
nonce: string;
|
|
285
287
|
audience: string;
|
|
286
288
|
sessionId: string;
|
|
287
|
-
|
|
288
|
-
kid: string;
|
|
289
|
+
ts: number;
|
|
289
290
|
requestHash: string;
|
|
290
291
|
responseHash: string;
|
|
291
|
-
ts: number;
|
|
292
292
|
clientDid?: string | undefined;
|
|
293
293
|
delegationRef?: string | undefined;
|
|
294
|
-
scopeId?: string | undefined;
|
|
295
294
|
outcome?: "allowed" | "denied" | "step_up_required" | "needs_authorization" | undefined;
|
|
295
|
+
scopeId?: string | undefined;
|
|
296
296
|
}, {
|
|
297
|
+
did: string;
|
|
298
|
+
kid: string;
|
|
297
299
|
nonce: string;
|
|
298
300
|
audience: string;
|
|
299
301
|
sessionId: string;
|
|
300
|
-
|
|
301
|
-
kid: string;
|
|
302
|
+
ts: number;
|
|
302
303
|
requestHash: string;
|
|
303
304
|
responseHash: string;
|
|
304
|
-
ts: number;
|
|
305
305
|
clientDid?: string | undefined;
|
|
306
306
|
delegationRef?: string | undefined;
|
|
307
|
-
scopeId?: string | undefined;
|
|
308
307
|
outcome?: "allowed" | "denied" | "step_up_required" | "needs_authorization" | undefined;
|
|
308
|
+
scopeId?: string | undefined;
|
|
309
309
|
}>;
|
|
310
310
|
}, "strip", z.ZodTypeAny, {
|
|
311
311
|
jws: string;
|
|
312
312
|
meta: {
|
|
313
|
+
did: string;
|
|
314
|
+
kid: string;
|
|
313
315
|
nonce: string;
|
|
314
316
|
audience: string;
|
|
315
317
|
sessionId: string;
|
|
316
|
-
|
|
317
|
-
kid: string;
|
|
318
|
+
ts: number;
|
|
318
319
|
requestHash: string;
|
|
319
320
|
responseHash: string;
|
|
320
|
-
ts: number;
|
|
321
321
|
clientDid?: string | undefined;
|
|
322
322
|
delegationRef?: string | undefined;
|
|
323
|
-
scopeId?: string | undefined;
|
|
324
323
|
outcome?: "allowed" | "denied" | "step_up_required" | "needs_authorization" | undefined;
|
|
324
|
+
scopeId?: string | undefined;
|
|
325
325
|
};
|
|
326
326
|
}, {
|
|
327
327
|
jws: string;
|
|
328
328
|
meta: {
|
|
329
|
+
did: string;
|
|
330
|
+
kid: string;
|
|
329
331
|
nonce: string;
|
|
330
332
|
audience: string;
|
|
331
333
|
sessionId: string;
|
|
332
|
-
|
|
333
|
-
kid: string;
|
|
334
|
+
ts: number;
|
|
334
335
|
requestHash: string;
|
|
335
336
|
responseHash: string;
|
|
336
|
-
ts: number;
|
|
337
337
|
clientDid?: string | undefined;
|
|
338
338
|
delegationRef?: string | undefined;
|
|
339
|
-
scopeId?: string | undefined;
|
|
340
339
|
outcome?: "allowed" | "denied" | "step_up_required" | "needs_authorization" | undefined;
|
|
340
|
+
scopeId?: string | undefined;
|
|
341
341
|
};
|
|
342
342
|
}>, "many">;
|
|
343
343
|
context: z.ZodOptional<z.ZodObject<{
|
|
@@ -351,14 +351,14 @@ export declare const ProofSubmissionRequestSchema: z.ZodObject<{
|
|
|
351
351
|
scopeId: string;
|
|
352
352
|
tool: string;
|
|
353
353
|
args: Record<string, unknown>;
|
|
354
|
-
result?: unknown;
|
|
355
354
|
userId?: string | undefined;
|
|
355
|
+
result?: unknown;
|
|
356
356
|
}, {
|
|
357
357
|
scopeId: string;
|
|
358
358
|
tool: string;
|
|
359
359
|
args: Record<string, unknown>;
|
|
360
|
-
result?: unknown;
|
|
361
360
|
userId?: string | undefined;
|
|
361
|
+
result?: unknown;
|
|
362
362
|
}>, "many">;
|
|
363
363
|
mcpServerUrl: z.ZodOptional<z.ZodString>;
|
|
364
364
|
}, "strip", z.ZodTypeAny, {
|
|
@@ -366,8 +366,8 @@ export declare const ProofSubmissionRequestSchema: z.ZodObject<{
|
|
|
366
366
|
scopeId: string;
|
|
367
367
|
tool: string;
|
|
368
368
|
args: Record<string, unknown>;
|
|
369
|
-
result?: unknown;
|
|
370
369
|
userId?: string | undefined;
|
|
370
|
+
result?: unknown;
|
|
371
371
|
}[];
|
|
372
372
|
mcpServerUrl?: string | undefined;
|
|
373
373
|
}, {
|
|
@@ -375,8 +375,8 @@ export declare const ProofSubmissionRequestSchema: z.ZodObject<{
|
|
|
375
375
|
scopeId: string;
|
|
376
376
|
tool: string;
|
|
377
377
|
args: Record<string, unknown>;
|
|
378
|
-
result?: unknown;
|
|
379
378
|
userId?: string | undefined;
|
|
379
|
+
result?: unknown;
|
|
380
380
|
}[];
|
|
381
381
|
mcpServerUrl?: string | undefined;
|
|
382
382
|
}>>;
|
|
@@ -385,18 +385,18 @@ export declare const ProofSubmissionRequestSchema: z.ZodObject<{
|
|
|
385
385
|
proofs: {
|
|
386
386
|
jws: string;
|
|
387
387
|
meta: {
|
|
388
|
+
did: string;
|
|
389
|
+
kid: string;
|
|
388
390
|
nonce: string;
|
|
389
391
|
audience: string;
|
|
390
392
|
sessionId: string;
|
|
391
|
-
|
|
392
|
-
kid: string;
|
|
393
|
+
ts: number;
|
|
393
394
|
requestHash: string;
|
|
394
395
|
responseHash: string;
|
|
395
|
-
ts: number;
|
|
396
396
|
clientDid?: string | undefined;
|
|
397
397
|
delegationRef?: string | undefined;
|
|
398
|
-
scopeId?: string | undefined;
|
|
399
398
|
outcome?: "allowed" | "denied" | "step_up_required" | "needs_authorization" | undefined;
|
|
399
|
+
scopeId?: string | undefined;
|
|
400
400
|
};
|
|
401
401
|
}[];
|
|
402
402
|
delegation_id?: string | null | undefined;
|
|
@@ -405,8 +405,8 @@ export declare const ProofSubmissionRequestSchema: z.ZodObject<{
|
|
|
405
405
|
scopeId: string;
|
|
406
406
|
tool: string;
|
|
407
407
|
args: Record<string, unknown>;
|
|
408
|
-
result?: unknown;
|
|
409
408
|
userId?: string | undefined;
|
|
409
|
+
result?: unknown;
|
|
410
410
|
}[];
|
|
411
411
|
mcpServerUrl?: string | undefined;
|
|
412
412
|
} | undefined;
|
|
@@ -415,18 +415,18 @@ export declare const ProofSubmissionRequestSchema: z.ZodObject<{
|
|
|
415
415
|
proofs: {
|
|
416
416
|
jws: string;
|
|
417
417
|
meta: {
|
|
418
|
+
did: string;
|
|
419
|
+
kid: string;
|
|
418
420
|
nonce: string;
|
|
419
421
|
audience: string;
|
|
420
422
|
sessionId: string;
|
|
421
|
-
|
|
422
|
-
kid: string;
|
|
423
|
+
ts: number;
|
|
423
424
|
requestHash: string;
|
|
424
425
|
responseHash: string;
|
|
425
|
-
ts: number;
|
|
426
426
|
clientDid?: string | undefined;
|
|
427
427
|
delegationRef?: string | undefined;
|
|
428
|
-
scopeId?: string | undefined;
|
|
429
428
|
outcome?: "allowed" | "denied" | "step_up_required" | "needs_authorization" | undefined;
|
|
429
|
+
scopeId?: string | undefined;
|
|
430
430
|
};
|
|
431
431
|
}[];
|
|
432
432
|
delegation_id?: string | null | undefined;
|
|
@@ -435,8 +435,8 @@ export declare const ProofSubmissionRequestSchema: z.ZodObject<{
|
|
|
435
435
|
scopeId: string;
|
|
436
436
|
tool: string;
|
|
437
437
|
args: Record<string, unknown>;
|
|
438
|
-
result?: unknown;
|
|
439
438
|
userId?: string | undefined;
|
|
439
|
+
result?: unknown;
|
|
440
440
|
}[];
|
|
441
441
|
mcpServerUrl?: string | undefined;
|
|
442
442
|
} | undefined;
|
package/dist/registry.d.ts
CHANGED
|
@@ -340,4 +340,3 @@ export declare const DEFAULT_STORAGE_MODE: StorageMode;
|
|
|
340
340
|
export declare const STORAGE_MODE_ENV_VAR = "MCPI_STORAGE_MODE";
|
|
341
341
|
export declare const RECEIPT_SCHEMA_ID = "https://schema.modelcontextprotocol-identity.io/xmcp-i/registry/receipt.v1.0.0.json";
|
|
342
342
|
export declare const CONTENT_HASH_REGEX: RegExp;
|
|
343
|
-
//# sourceMappingURL=registry.d.ts.map
|
package/dist/registry.js
CHANGED
|
@@ -116,4 +116,3 @@ exports.STORAGE_MODE_ENV_VAR = "MCPI_STORAGE_MODE";
|
|
|
116
116
|
// Receipt schema constants
|
|
117
117
|
exports.RECEIPT_SCHEMA_ID = "https://schema.modelcontextprotocol-identity.io/xmcp-i/registry/receipt.v1.0.0.json";
|
|
118
118
|
exports.CONTENT_HASH_REGEX = /^sha256:[a-f0-9]{64}$/;
|
|
119
|
-
//# sourceMappingURL=registry.js.map
|
package/dist/reputation/api.d.ts
CHANGED
package/dist/reputation/api.js
CHANGED
|
@@ -1491,4 +1491,3 @@ export declare const DEFAULT_REPUTATION_CREDENTIAL_VALIDITY_MS: number;
|
|
|
1491
1491
|
* Recommended maximum age for reputation scores (24 hours)
|
|
1492
1492
|
*/
|
|
1493
1493
|
export declare const RECOMMENDED_REPUTATION_FRESHNESS_MS: number;
|
|
1494
|
-
//# sourceMappingURL=credentials.d.ts.map
|
package/dist/reputation/index.js
CHANGED
|
@@ -34,8 +34,9 @@ Object.defineProperty(exports, "__esModule", { value: true });
|
|
|
34
34
|
__exportStar(require("./schemas.js"), exports);
|
|
35
35
|
// API schemas
|
|
36
36
|
__exportStar(require("./api.js"), exports);
|
|
37
|
+
// Per-tool-call interaction attestation request (xmcp-i#413)
|
|
38
|
+
__exportStar(require("./interactions.js"), exports);
|
|
37
39
|
// Credential schemas (W3C VC)
|
|
38
40
|
__exportStar(require("./credentials.js"), exports);
|
|
39
41
|
// Constants and configuration
|
|
40
42
|
__exportStar(require("./constants.js"), exports);
|
|
41
|
-
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1,146 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Interaction Report Request Contract
|
|
3
|
+
*
|
|
4
|
+
* The per-tool-call attestation body that identity-aware runtimes POST to
|
|
5
|
+
* KTA's `POST /api/v1/agents/{did}/interactions` endpoint (xmcp-i#413). KTA
|
|
6
|
+
* verifies the embedded JWS against the agent's registered public key and
|
|
7
|
+
* folds the outcome into the Bayesian reputation engine.
|
|
8
|
+
*
|
|
9
|
+
* WHY this lives in @kya-os/contracts: per the repo's API-parity rule, the
|
|
10
|
+
* wire shape of any cross-service POST must be a shared, Zod-validated
|
|
11
|
+
* contract — never inlined at the call site. The producer here is
|
|
12
|
+
* `@kya-os/compute`'s attestation reporter; the consumer is the KTA route.
|
|
13
|
+
*
|
|
14
|
+
* PARITY CAVEAT: KTA's receiving schema lives in a different repository
|
|
15
|
+
* (Know-That-Ai/know-that-ai → `src/app/api/v1/agents/[did]/interactions/`)
|
|
16
|
+
* and cannot be imported or validated from here. This schema mirrors the body
|
|
17
|
+
* shape already accepted in production (the existing attestation flow), and
|
|
18
|
+
* MUST be kept in lock-step with that route when either side changes.
|
|
19
|
+
*
|
|
20
|
+
* Related Spec: MCP-I §5 (Reputation)
|
|
21
|
+
*/
|
|
22
|
+
import { z } from "zod";
|
|
23
|
+
/**
|
|
24
|
+
* Interaction classification. Open-ended on the wire (KTA may accept more
|
|
25
|
+
* types over time), but the per-tool-call attestation path emits exactly
|
|
26
|
+
* `"scope_executed"`. Modeled as a string with that documented default rather
|
|
27
|
+
* than a closed enum so adding a new KTA-side type does not require a
|
|
28
|
+
* contracts bump on the producer before the receiver is ready.
|
|
29
|
+
*/
|
|
30
|
+
export declare const INTERACTION_TYPE_SCOPE_EXECUTED: "scope_executed";
|
|
31
|
+
/**
|
|
32
|
+
* Coarse success/failure outcome KTA folds into the reputation score. The
|
|
33
|
+
* compute reporter collapses its finer 4-value status (success/error/denied/
|
|
34
|
+
* timeout) onto this two-value axis — anything that is not an unambiguous
|
|
35
|
+
* success counts as a failure for reputation purposes.
|
|
36
|
+
*/
|
|
37
|
+
export declare const InteractionOutcomeSchema: z.ZodEnum<["success", "failure"]>;
|
|
38
|
+
export type InteractionOutcome = z.infer<typeof InteractionOutcomeSchema>;
|
|
39
|
+
/**
|
|
40
|
+
* Evidentiary context carried alongside the signed attestation. `client_did`
|
|
41
|
+
* is optional because the agent may receive calls from un-attested clients
|
|
42
|
+
* during the rollout window; the attestation still has value without it.
|
|
43
|
+
*/
|
|
44
|
+
export declare const InteractionContextSchema: z.ZodObject<{
|
|
45
|
+
/** MCP session id from the originating tools/call. May be empty for headless flows. */
|
|
46
|
+
session_id: z.ZodString;
|
|
47
|
+
/** Calling client's DID, when known. Omitted (not null) when un-attested. */
|
|
48
|
+
client_did: z.ZodOptional<z.ZodString>;
|
|
49
|
+
/** Compact JWS attestation of the tool call, signed by the agent's key. */
|
|
50
|
+
attestation_jws: z.ZodString;
|
|
51
|
+
}, "strip", z.ZodTypeAny, {
|
|
52
|
+
session_id: string;
|
|
53
|
+
attestation_jws: string;
|
|
54
|
+
client_did?: string | undefined;
|
|
55
|
+
}, {
|
|
56
|
+
session_id: string;
|
|
57
|
+
attestation_jws: string;
|
|
58
|
+
client_did?: string | undefined;
|
|
59
|
+
}>;
|
|
60
|
+
export type InteractionContext = z.infer<typeof InteractionContextSchema>;
|
|
61
|
+
/**
|
|
62
|
+
* Interaction Report Request Schema
|
|
63
|
+
*
|
|
64
|
+
* Fire-and-forget body POSTed per tool call. Authenticated by the
|
|
65
|
+
* `x-api-key` header (not part of the body); idempotency is the caller's
|
|
66
|
+
* responsibility via `idempotency_key`.
|
|
67
|
+
*/
|
|
68
|
+
export declare const InteractionReportRequestSchema: z.ZodObject<{
|
|
69
|
+
/** Interaction classification — `"scope_executed"` for tool-call attestations. */
|
|
70
|
+
interaction_type: z.ZodString;
|
|
71
|
+
/** Reputation-facing outcome. */
|
|
72
|
+
outcome: z.ZodEnum<["success", "failure"]>;
|
|
73
|
+
/** Authorized scopes for the call, when a delegation context supplies them. */
|
|
74
|
+
scopes: z.ZodOptional<z.ZodArray<z.ZodString, "many">>;
|
|
75
|
+
/** ISO 8601 timestamp of the call, set when the attestation is signed. */
|
|
76
|
+
timestamp: z.ZodString;
|
|
77
|
+
/** Evidentiary context including the signed attestation. */
|
|
78
|
+
context: z.ZodObject<{
|
|
79
|
+
/** MCP session id from the originating tools/call. May be empty for headless flows. */
|
|
80
|
+
session_id: z.ZodString;
|
|
81
|
+
/** Calling client's DID, when known. Omitted (not null) when un-attested. */
|
|
82
|
+
client_did: z.ZodOptional<z.ZodString>;
|
|
83
|
+
/** Compact JWS attestation of the tool call, signed by the agent's key. */
|
|
84
|
+
attestation_jws: z.ZodString;
|
|
85
|
+
}, "strip", z.ZodTypeAny, {
|
|
86
|
+
session_id: string;
|
|
87
|
+
attestation_jws: string;
|
|
88
|
+
client_did?: string | undefined;
|
|
89
|
+
}, {
|
|
90
|
+
session_id: string;
|
|
91
|
+
attestation_jws: string;
|
|
92
|
+
client_did?: string | undefined;
|
|
93
|
+
}>;
|
|
94
|
+
/** Per-call key so a retried POST of the same call is deduped by KTA. */
|
|
95
|
+
idempotency_key: z.ZodString;
|
|
96
|
+
}, "strip", z.ZodTypeAny, {
|
|
97
|
+
timestamp: string;
|
|
98
|
+
outcome: "success" | "failure";
|
|
99
|
+
context: {
|
|
100
|
+
session_id: string;
|
|
101
|
+
attestation_jws: string;
|
|
102
|
+
client_did?: string | undefined;
|
|
103
|
+
};
|
|
104
|
+
interaction_type: string;
|
|
105
|
+
idempotency_key: string;
|
|
106
|
+
scopes?: string[] | undefined;
|
|
107
|
+
}, {
|
|
108
|
+
timestamp: string;
|
|
109
|
+
outcome: "success" | "failure";
|
|
110
|
+
context: {
|
|
111
|
+
session_id: string;
|
|
112
|
+
attestation_jws: string;
|
|
113
|
+
client_did?: string | undefined;
|
|
114
|
+
};
|
|
115
|
+
interaction_type: string;
|
|
116
|
+
idempotency_key: string;
|
|
117
|
+
scopes?: string[] | undefined;
|
|
118
|
+
}>;
|
|
119
|
+
export type InteractionReportRequest = z.infer<typeof InteractionReportRequestSchema>;
|
|
120
|
+
/**
|
|
121
|
+
* Validate an interaction report request. Mirrors the `validate*` helpers in
|
|
122
|
+
* `./api.ts` so call sites can branch on `.success` without importing zod.
|
|
123
|
+
*/
|
|
124
|
+
export declare function validateInteractionReportRequest(data: unknown): z.SafeParseReturnType<{
|
|
125
|
+
timestamp: string;
|
|
126
|
+
outcome: "success" | "failure";
|
|
127
|
+
context: {
|
|
128
|
+
session_id: string;
|
|
129
|
+
attestation_jws: string;
|
|
130
|
+
client_did?: string | undefined;
|
|
131
|
+
};
|
|
132
|
+
interaction_type: string;
|
|
133
|
+
idempotency_key: string;
|
|
134
|
+
scopes?: string[] | undefined;
|
|
135
|
+
}, {
|
|
136
|
+
timestamp: string;
|
|
137
|
+
outcome: "success" | "failure";
|
|
138
|
+
context: {
|
|
139
|
+
session_id: string;
|
|
140
|
+
attestation_jws: string;
|
|
141
|
+
client_did?: string | undefined;
|
|
142
|
+
};
|
|
143
|
+
interaction_type: string;
|
|
144
|
+
idempotency_key: string;
|
|
145
|
+
scopes?: string[] | undefined;
|
|
146
|
+
}>;
|
|
@@ -0,0 +1,82 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
/**
|
|
3
|
+
* Interaction Report Request Contract
|
|
4
|
+
*
|
|
5
|
+
* The per-tool-call attestation body that identity-aware runtimes POST to
|
|
6
|
+
* KTA's `POST /api/v1/agents/{did}/interactions` endpoint (xmcp-i#413). KTA
|
|
7
|
+
* verifies the embedded JWS against the agent's registered public key and
|
|
8
|
+
* folds the outcome into the Bayesian reputation engine.
|
|
9
|
+
*
|
|
10
|
+
* WHY this lives in @kya-os/contracts: per the repo's API-parity rule, the
|
|
11
|
+
* wire shape of any cross-service POST must be a shared, Zod-validated
|
|
12
|
+
* contract — never inlined at the call site. The producer here is
|
|
13
|
+
* `@kya-os/compute`'s attestation reporter; the consumer is the KTA route.
|
|
14
|
+
*
|
|
15
|
+
* PARITY CAVEAT: KTA's receiving schema lives in a different repository
|
|
16
|
+
* (Know-That-Ai/know-that-ai → `src/app/api/v1/agents/[did]/interactions/`)
|
|
17
|
+
* and cannot be imported or validated from here. This schema mirrors the body
|
|
18
|
+
* shape already accepted in production (the existing attestation flow), and
|
|
19
|
+
* MUST be kept in lock-step with that route when either side changes.
|
|
20
|
+
*
|
|
21
|
+
* Related Spec: MCP-I §5 (Reputation)
|
|
22
|
+
*/
|
|
23
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
24
|
+
exports.InteractionReportRequestSchema = exports.InteractionContextSchema = exports.InteractionOutcomeSchema = exports.INTERACTION_TYPE_SCOPE_EXECUTED = void 0;
|
|
25
|
+
exports.validateInteractionReportRequest = validateInteractionReportRequest;
|
|
26
|
+
const zod_1 = require("zod");
|
|
27
|
+
/**
|
|
28
|
+
* Interaction classification. Open-ended on the wire (KTA may accept more
|
|
29
|
+
* types over time), but the per-tool-call attestation path emits exactly
|
|
30
|
+
* `"scope_executed"`. Modeled as a string with that documented default rather
|
|
31
|
+
* than a closed enum so adding a new KTA-side type does not require a
|
|
32
|
+
* contracts bump on the producer before the receiver is ready.
|
|
33
|
+
*/
|
|
34
|
+
exports.INTERACTION_TYPE_SCOPE_EXECUTED = "scope_executed";
|
|
35
|
+
/**
|
|
36
|
+
* Coarse success/failure outcome KTA folds into the reputation score. The
|
|
37
|
+
* compute reporter collapses its finer 4-value status (success/error/denied/
|
|
38
|
+
* timeout) onto this two-value axis — anything that is not an unambiguous
|
|
39
|
+
* success counts as a failure for reputation purposes.
|
|
40
|
+
*/
|
|
41
|
+
exports.InteractionOutcomeSchema = zod_1.z.enum(["success", "failure"]);
|
|
42
|
+
/**
|
|
43
|
+
* Evidentiary context carried alongside the signed attestation. `client_did`
|
|
44
|
+
* is optional because the agent may receive calls from un-attested clients
|
|
45
|
+
* during the rollout window; the attestation still has value without it.
|
|
46
|
+
*/
|
|
47
|
+
exports.InteractionContextSchema = zod_1.z.object({
|
|
48
|
+
/** MCP session id from the originating tools/call. May be empty for headless flows. */
|
|
49
|
+
session_id: zod_1.z.string(),
|
|
50
|
+
/** Calling client's DID, when known. Omitted (not null) when un-attested. */
|
|
51
|
+
client_did: zod_1.z.string().optional(),
|
|
52
|
+
/** Compact JWS attestation of the tool call, signed by the agent's key. */
|
|
53
|
+
attestation_jws: zod_1.z.string(),
|
|
54
|
+
});
|
|
55
|
+
/**
|
|
56
|
+
* Interaction Report Request Schema
|
|
57
|
+
*
|
|
58
|
+
* Fire-and-forget body POSTed per tool call. Authenticated by the
|
|
59
|
+
* `x-api-key` header (not part of the body); idempotency is the caller's
|
|
60
|
+
* responsibility via `idempotency_key`.
|
|
61
|
+
*/
|
|
62
|
+
exports.InteractionReportRequestSchema = zod_1.z.object({
|
|
63
|
+
/** Interaction classification — `"scope_executed"` for tool-call attestations. */
|
|
64
|
+
interaction_type: zod_1.z.string(),
|
|
65
|
+
/** Reputation-facing outcome. */
|
|
66
|
+
outcome: exports.InteractionOutcomeSchema,
|
|
67
|
+
/** Authorized scopes for the call, when a delegation context supplies them. */
|
|
68
|
+
scopes: zod_1.z.array(zod_1.z.string()).optional(),
|
|
69
|
+
/** ISO 8601 timestamp of the call, set when the attestation is signed. */
|
|
70
|
+
timestamp: zod_1.z.string(),
|
|
71
|
+
/** Evidentiary context including the signed attestation. */
|
|
72
|
+
context: exports.InteractionContextSchema,
|
|
73
|
+
/** Per-call key so a retried POST of the same call is deduped by KTA. */
|
|
74
|
+
idempotency_key: zod_1.z.string(),
|
|
75
|
+
});
|
|
76
|
+
/**
|
|
77
|
+
* Validate an interaction report request. Mirrors the `validate*` helpers in
|
|
78
|
+
* `./api.ts` so call sites can branch on `.success` without importing zod.
|
|
79
|
+
*/
|
|
80
|
+
function validateInteractionReportRequest(data) {
|
|
81
|
+
return exports.InteractionReportRequestSchema.safeParse(data);
|
|
82
|
+
}
|