@kya-os/contracts 1.7.26 → 1.7.31

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.
Files changed (50) hide show
  1. package/dist/agent-deployment-utils.d.ts +20 -0
  2. package/dist/agent-deployment-utils.js +37 -0
  3. package/dist/agent-deployment.d.ts +19 -19
  4. package/dist/agent-deployment.js +2 -1
  5. package/dist/agentshield-api/admin-schemas.d.ts +2 -2
  6. package/dist/agentshield-api/schemas.d.ts +462 -462
  7. package/dist/audit/index.d.ts +24 -24
  8. package/dist/cli.d.ts +44 -44
  9. package/dist/compute-binding.d.ts +6 -6
  10. package/dist/compute.d.ts +27 -8
  11. package/dist/compute.js +6 -0
  12. package/dist/config/identity.d.ts +98 -98
  13. package/dist/consent/schemas.d.ts +72 -72
  14. package/dist/dashboard-config/schemas.d.ts +2191 -2191
  15. package/dist/delegation/constraints.d.ts +32 -32
  16. package/dist/delegation/schemas.d.ts +610 -610
  17. package/dist/deploy/schemas.d.ts +129 -129
  18. package/dist/gateway/agents.d.ts +21 -0
  19. package/dist/gateway/agents.js +12 -0
  20. package/dist/gateway/cron.d.ts +33 -0
  21. package/dist/gateway/cron.js +16 -0
  22. package/dist/gateway/index.d.ts +20 -0
  23. package/dist/gateway/index.js +37 -0
  24. package/dist/gateway/sessions.d.ts +30 -0
  25. package/dist/gateway/sessions.js +15 -0
  26. package/dist/gateway/skills.d.ts +445 -0
  27. package/dist/gateway/skills.js +47 -0
  28. package/dist/gateway/usage.d.ts +43 -0
  29. package/dist/gateway/usage.js +18 -0
  30. package/dist/handshake.d.ts +42 -42
  31. package/dist/index.d.ts +1 -0
  32. package/dist/index.js +2 -0
  33. package/dist/molti/admin-ws.d.ts +116 -116
  34. package/dist/molti/schemas.d.ts +98 -98
  35. package/dist/pairing/index.d.ts +44 -0
  36. package/dist/pairing/index.js +11 -0
  37. package/dist/policy/schemas.d.ts +553 -553
  38. package/dist/proof/proof-record.d.ts +48 -48
  39. package/dist/proof/signing-spec.d.ts +8 -8
  40. package/dist/proof.d.ts +68 -68
  41. package/dist/registry.d.ts +24 -24
  42. package/dist/reputation/api.d.ts +156 -156
  43. package/dist/reputation/credentials.d.ts +48 -48
  44. package/dist/reputation/schemas.d.ts +48 -48
  45. package/dist/test.d.ts +22 -22
  46. package/dist/tlkrc/rotation.d.ts +12 -12
  47. package/dist/tool-protection/index.d.ts +22 -22
  48. package/dist/verifier.d.ts +17 -17
  49. package/dist/well-known/index.d.ts +72 -72
  50. package/package.json +10 -2
@@ -40,3 +40,23 @@ export declare function didToSlug(did: string): string;
40
40
  * @throws {Error} If `did` is empty or does not start with "did:"
41
41
  */
42
42
  export declare function didToFlyApp(did: string): string;
43
+ /**
44
+ * Derive a readable, DNS-safe Fly app name from an agent name + DID.
45
+ *
46
+ * Format: "kya-{name[:19]}-{first 6 hex chars of SHA-256 of DID}"
47
+ * Example: ("researcher", "did:key:z6Mk...") → "kya-researcher-a3f2b1"
48
+ *
49
+ * Constraints:
50
+ * "kya-" (4) + name[:19] (≤19) + "-" (1) + hash[:6] (6) = ≤30 chars
51
+ * Fly app name hard limit: 30 chars ✓
52
+ *
53
+ * Uniqueness: 6 hex chars = 24 bits → birthday collision at ~4,096 agents
54
+ * sharing the exact same human name. Safe for production scale.
55
+ *
56
+ * Node.js only — same crypto constraint as didToSlug.
57
+ *
58
+ * @param name - Human-readable agent name from the deploy request
59
+ * @param did - The agent DID string (must start with "did:")
60
+ * @throws {Error} If DID is invalid or name sanitizes to empty string
61
+ */
62
+ export declare function nameToFlySlug(name: string, did: string): string;
@@ -14,6 +14,7 @@
14
14
  Object.defineProperty(exports, "__esModule", { value: true });
15
15
  exports.didToSlug = didToSlug;
16
16
  exports.didToFlyApp = didToFlyApp;
17
+ exports.nameToFlySlug = nameToFlySlug;
17
18
  const crypto_1 = require("crypto");
18
19
  /**
19
20
  * Derive a short, deterministic, DNS-safe slug from an agent DID.
@@ -53,3 +54,39 @@ function didToSlug(did) {
53
54
  function didToFlyApp(did) {
54
55
  return didToSlug(did);
55
56
  }
57
+ /**
58
+ * Derive a readable, DNS-safe Fly app name from an agent name + DID.
59
+ *
60
+ * Format: "kya-{name[:19]}-{first 6 hex chars of SHA-256 of DID}"
61
+ * Example: ("researcher", "did:key:z6Mk...") → "kya-researcher-a3f2b1"
62
+ *
63
+ * Constraints:
64
+ * "kya-" (4) + name[:19] (≤19) + "-" (1) + hash[:6] (6) = ≤30 chars
65
+ * Fly app name hard limit: 30 chars ✓
66
+ *
67
+ * Uniqueness: 6 hex chars = 24 bits → birthday collision at ~4,096 agents
68
+ * sharing the exact same human name. Safe for production scale.
69
+ *
70
+ * Node.js only — same crypto constraint as didToSlug.
71
+ *
72
+ * @param name - Human-readable agent name from the deploy request
73
+ * @param did - The agent DID string (must start with "did:")
74
+ * @throws {Error} If DID is invalid or name sanitizes to empty string
75
+ */
76
+ function nameToFlySlug(name, did) {
77
+ if (!did || typeof did !== "string" || !did.startsWith("did:")) {
78
+ throw new Error('nameToFlySlug: expected a valid DID string starting with "did:"');
79
+ }
80
+ const hash = (0, crypto_1.createHash)("sha256").update(did).digest("hex").substring(0, 6);
81
+ const slug = name
82
+ .toLowerCase()
83
+ .replace(/[^a-z0-9-]/g, "-") // non-alphanumeric → hyphen
84
+ .replace(/-{2,}/g, "-") // collapse consecutive hyphens
85
+ .replace(/^-+|-+$/g, "") // strip leading/trailing hyphens
86
+ .substring(0, 19)
87
+ .replace(/-+$/, ""); // strip trailing hyphens after truncation
88
+ if (!slug) {
89
+ throw new Error("nameToFlySlug: name sanitized to empty string");
90
+ }
91
+ return `kya-${slug}-${hash}`;
92
+ }
@@ -119,15 +119,15 @@ export declare const ManagedDeployStepSchema: z.ZodObject<{
119
119
  startedAt: z.ZodOptional<z.ZodString>;
120
120
  completedAt: z.ZodOptional<z.ZodString>;
121
121
  }, "strip", z.ZodTypeAny, {
122
- status: "pending" | "in_progress" | "completed" | "failed" | "skipped";
123
122
  name: string;
123
+ status: "pending" | "in_progress" | "completed" | "failed" | "skipped";
124
124
  id: "identity_create" | "project_create" | "kta_register" | "fly_provision" | "compute_boot" | "health_check";
125
125
  message?: string | undefined;
126
126
  startedAt?: string | undefined;
127
127
  completedAt?: string | undefined;
128
128
  }, {
129
- status: "pending" | "in_progress" | "completed" | "failed" | "skipped";
130
129
  name: string;
130
+ status: "pending" | "in_progress" | "completed" | "failed" | "skipped";
131
131
  id: "identity_create" | "project_create" | "kta_register" | "fly_provision" | "compute_boot" | "health_check";
132
132
  message?: string | undefined;
133
133
  startedAt?: string | undefined;
@@ -146,15 +146,15 @@ export declare const ManagedDeployProgressSchema: z.ZodObject<{
146
146
  startedAt: z.ZodOptional<z.ZodString>;
147
147
  completedAt: z.ZodOptional<z.ZodString>;
148
148
  }, "strip", z.ZodTypeAny, {
149
- status: "pending" | "in_progress" | "completed" | "failed" | "skipped";
150
149
  name: string;
150
+ status: "pending" | "in_progress" | "completed" | "failed" | "skipped";
151
151
  id: "identity_create" | "project_create" | "kta_register" | "fly_provision" | "compute_boot" | "health_check";
152
152
  message?: string | undefined;
153
153
  startedAt?: string | undefined;
154
154
  completedAt?: string | undefined;
155
155
  }, {
156
- status: "pending" | "in_progress" | "completed" | "failed" | "skipped";
157
156
  name: string;
157
+ status: "pending" | "in_progress" | "completed" | "failed" | "skipped";
158
158
  id: "identity_create" | "project_create" | "kta_register" | "fly_provision" | "compute_boot" | "health_check";
159
159
  message?: string | undefined;
160
160
  startedAt?: string | undefined;
@@ -166,8 +166,8 @@ export declare const ManagedDeployProgressSchema: z.ZodObject<{
166
166
  }, "strip", z.ZodTypeAny, {
167
167
  deploymentId: string;
168
168
  steps: {
169
- status: "pending" | "in_progress" | "completed" | "failed" | "skipped";
170
169
  name: string;
170
+ status: "pending" | "in_progress" | "completed" | "failed" | "skipped";
171
171
  id: "identity_create" | "project_create" | "kta_register" | "fly_provision" | "compute_boot" | "health_check";
172
172
  message?: string | undefined;
173
173
  startedAt?: string | undefined;
@@ -179,8 +179,8 @@ export declare const ManagedDeployProgressSchema: z.ZodObject<{
179
179
  }, {
180
180
  deploymentId: string;
181
181
  steps: {
182
- status: "pending" | "in_progress" | "completed" | "failed" | "skipped";
183
182
  name: string;
183
+ status: "pending" | "in_progress" | "completed" | "failed" | "skipped";
184
184
  id: "identity_create" | "project_create" | "kta_register" | "fly_provision" | "compute_boot" | "health_check";
185
185
  message?: string | undefined;
186
186
  startedAt?: string | undefined;
@@ -366,15 +366,15 @@ export declare const ManagedSSEProgressEventSchema: z.ZodObject<{
366
366
  startedAt: z.ZodOptional<z.ZodString>;
367
367
  completedAt: z.ZodOptional<z.ZodString>;
368
368
  }, "strip", z.ZodTypeAny, {
369
- status: "pending" | "in_progress" | "completed" | "failed" | "skipped";
370
369
  name: string;
370
+ status: "pending" | "in_progress" | "completed" | "failed" | "skipped";
371
371
  id: "identity_create" | "project_create" | "kta_register" | "fly_provision" | "compute_boot" | "health_check";
372
372
  message?: string | undefined;
373
373
  startedAt?: string | undefined;
374
374
  completedAt?: string | undefined;
375
375
  }, {
376
- status: "pending" | "in_progress" | "completed" | "failed" | "skipped";
377
376
  name: string;
377
+ status: "pending" | "in_progress" | "completed" | "failed" | "skipped";
378
378
  id: "identity_create" | "project_create" | "kta_register" | "fly_provision" | "compute_boot" | "health_check";
379
379
  message?: string | undefined;
380
380
  startedAt?: string | undefined;
@@ -386,8 +386,8 @@ export declare const ManagedSSEProgressEventSchema: z.ZodObject<{
386
386
  }, "strip", z.ZodTypeAny, {
387
387
  deploymentId: string;
388
388
  steps: {
389
- status: "pending" | "in_progress" | "completed" | "failed" | "skipped";
390
389
  name: string;
390
+ status: "pending" | "in_progress" | "completed" | "failed" | "skipped";
391
391
  id: "identity_create" | "project_create" | "kta_register" | "fly_provision" | "compute_boot" | "health_check";
392
392
  message?: string | undefined;
393
393
  startedAt?: string | undefined;
@@ -399,8 +399,8 @@ export declare const ManagedSSEProgressEventSchema: z.ZodObject<{
399
399
  }, {
400
400
  deploymentId: string;
401
401
  steps: {
402
- status: "pending" | "in_progress" | "completed" | "failed" | "skipped";
403
402
  name: string;
403
+ status: "pending" | "in_progress" | "completed" | "failed" | "skipped";
404
404
  id: "identity_create" | "project_create" | "kta_register" | "fly_provision" | "compute_boot" | "health_check";
405
405
  message?: string | undefined;
406
406
  startedAt?: string | undefined;
@@ -415,8 +415,8 @@ export declare const ManagedSSEProgressEventSchema: z.ZodObject<{
415
415
  data: {
416
416
  deploymentId: string;
417
417
  steps: {
418
- status: "pending" | "in_progress" | "completed" | "failed" | "skipped";
419
418
  name: string;
419
+ status: "pending" | "in_progress" | "completed" | "failed" | "skipped";
420
420
  id: "identity_create" | "project_create" | "kta_register" | "fly_provision" | "compute_boot" | "health_check";
421
421
  message?: string | undefined;
422
422
  startedAt?: string | undefined;
@@ -431,8 +431,8 @@ export declare const ManagedSSEProgressEventSchema: z.ZodObject<{
431
431
  data: {
432
432
  deploymentId: string;
433
433
  steps: {
434
- status: "pending" | "in_progress" | "completed" | "failed" | "skipped";
435
434
  name: string;
435
+ status: "pending" | "in_progress" | "completed" | "failed" | "skipped";
436
436
  id: "identity_create" | "project_create" | "kta_register" | "fly_provision" | "compute_boot" | "health_check";
437
437
  message?: string | undefined;
438
438
  startedAt?: string | undefined;
@@ -550,15 +550,15 @@ export declare const ManagedSSEEventSchema: z.ZodDiscriminatedUnion<"type", [z.Z
550
550
  startedAt: z.ZodOptional<z.ZodString>;
551
551
  completedAt: z.ZodOptional<z.ZodString>;
552
552
  }, "strip", z.ZodTypeAny, {
553
- status: "pending" | "in_progress" | "completed" | "failed" | "skipped";
554
553
  name: string;
554
+ status: "pending" | "in_progress" | "completed" | "failed" | "skipped";
555
555
  id: "identity_create" | "project_create" | "kta_register" | "fly_provision" | "compute_boot" | "health_check";
556
556
  message?: string | undefined;
557
557
  startedAt?: string | undefined;
558
558
  completedAt?: string | undefined;
559
559
  }, {
560
- status: "pending" | "in_progress" | "completed" | "failed" | "skipped";
561
560
  name: string;
561
+ status: "pending" | "in_progress" | "completed" | "failed" | "skipped";
562
562
  id: "identity_create" | "project_create" | "kta_register" | "fly_provision" | "compute_boot" | "health_check";
563
563
  message?: string | undefined;
564
564
  startedAt?: string | undefined;
@@ -570,8 +570,8 @@ export declare const ManagedSSEEventSchema: z.ZodDiscriminatedUnion<"type", [z.Z
570
570
  }, "strip", z.ZodTypeAny, {
571
571
  deploymentId: string;
572
572
  steps: {
573
- status: "pending" | "in_progress" | "completed" | "failed" | "skipped";
574
573
  name: string;
574
+ status: "pending" | "in_progress" | "completed" | "failed" | "skipped";
575
575
  id: "identity_create" | "project_create" | "kta_register" | "fly_provision" | "compute_boot" | "health_check";
576
576
  message?: string | undefined;
577
577
  startedAt?: string | undefined;
@@ -583,8 +583,8 @@ export declare const ManagedSSEEventSchema: z.ZodDiscriminatedUnion<"type", [z.Z
583
583
  }, {
584
584
  deploymentId: string;
585
585
  steps: {
586
- status: "pending" | "in_progress" | "completed" | "failed" | "skipped";
587
586
  name: string;
587
+ status: "pending" | "in_progress" | "completed" | "failed" | "skipped";
588
588
  id: "identity_create" | "project_create" | "kta_register" | "fly_provision" | "compute_boot" | "health_check";
589
589
  message?: string | undefined;
590
590
  startedAt?: string | undefined;
@@ -599,8 +599,8 @@ export declare const ManagedSSEEventSchema: z.ZodDiscriminatedUnion<"type", [z.Z
599
599
  data: {
600
600
  deploymentId: string;
601
601
  steps: {
602
- status: "pending" | "in_progress" | "completed" | "failed" | "skipped";
603
602
  name: string;
603
+ status: "pending" | "in_progress" | "completed" | "failed" | "skipped";
604
604
  id: "identity_create" | "project_create" | "kta_register" | "fly_provision" | "compute_boot" | "health_check";
605
605
  message?: string | undefined;
606
606
  startedAt?: string | undefined;
@@ -615,8 +615,8 @@ export declare const ManagedSSEEventSchema: z.ZodDiscriminatedUnion<"type", [z.Z
615
615
  data: {
616
616
  deploymentId: string;
617
617
  steps: {
618
- status: "pending" | "in_progress" | "completed" | "failed" | "skipped";
619
618
  name: string;
619
+ status: "pending" | "in_progress" | "completed" | "failed" | "skipped";
620
620
  id: "identity_create" | "project_create" | "kta_register" | "fly_provision" | "compute_boot" | "health_check";
621
621
  message?: string | undefined;
622
622
  startedAt?: string | undefined;
@@ -720,4 +720,4 @@ export declare const ManagedSSEEventSchema: z.ZodDiscriminatedUnion<"type", [z.Z
720
720
  };
721
721
  }>]>;
722
722
  export type ManagedSSEEvent = z.infer<typeof ManagedSSEEventSchema>;
723
- export { didToSlug, didToFlyApp } from "./agent-deployment-utils.js";
723
+ export { didToSlug, didToFlyApp, nameToFlySlug } from "./agent-deployment-utils.js";
@@ -8,7 +8,7 @@
8
8
  * @package @kya-os/contracts/agent-deployment
9
9
  */
10
10
  Object.defineProperty(exports, "__esModule", { value: true });
11
- exports.didToFlyApp = exports.didToSlug = exports.ManagedSSEEventSchema = exports.ManagedSSEKeepaliveEventSchema = exports.ManagedSSEErrorEventSchema = exports.ManagedSSECompleteEventSchema = exports.ManagedSSEProgressEventSchema = exports.ManagedDeployResponseSchema = exports.ManagedDeploySuccessResponseSchema = exports.ManagedDeployErrorResponseSchema = exports.ManagedDeployErrorCodeSchema = exports.ManagedDeployProgressSchema = exports.ManagedDeployStepSchema = exports.ManagedDeployStepStatusSchema = exports.MANAGED_DEPLOY_STEP_NAMES = exports.ManagedDeployStepIdSchema = exports.ManagedDeployResultSchema = exports.ManagedDeployRequestSchema = exports.HostingModeSchema = exports.AgentStatusSchema = exports.FlyRegionSchema = exports.DidStringSchema = void 0;
11
+ exports.nameToFlySlug = exports.didToFlyApp = exports.didToSlug = exports.ManagedSSEEventSchema = exports.ManagedSSEKeepaliveEventSchema = exports.ManagedSSEErrorEventSchema = exports.ManagedSSECompleteEventSchema = exports.ManagedSSEProgressEventSchema = exports.ManagedDeployResponseSchema = exports.ManagedDeploySuccessResponseSchema = exports.ManagedDeployErrorResponseSchema = exports.ManagedDeployErrorCodeSchema = exports.ManagedDeployProgressSchema = exports.ManagedDeployStepSchema = exports.ManagedDeployStepStatusSchema = exports.MANAGED_DEPLOY_STEP_NAMES = exports.ManagedDeployStepIdSchema = exports.ManagedDeployResultSchema = exports.ManagedDeployRequestSchema = exports.HostingModeSchema = exports.AgentStatusSchema = exports.FlyRegionSchema = exports.DidStringSchema = void 0;
12
12
  const zod_1 = require("zod");
13
13
  // ============================================================================
14
14
  // Shared Schemas
@@ -267,3 +267,4 @@ exports.ManagedSSEEventSchema = zod_1.z.discriminatedUnion("type", [
267
267
  var agent_deployment_utils_js_1 = require("./agent-deployment-utils.js");
268
268
  Object.defineProperty(exports, "didToSlug", { enumerable: true, get: function () { return agent_deployment_utils_js_1.didToSlug; } });
269
269
  Object.defineProperty(exports, "didToFlyApp", { enumerable: true, get: function () { return agent_deployment_utils_js_1.didToFlyApp; } });
270
+ Object.defineProperty(exports, "nameToFlySlug", { enumerable: true, get: function () { return agent_deployment_utils_js_1.nameToFlySlug; } });
@@ -30,8 +30,8 @@ export declare const clearCacheResponseSchema: z.ZodObject<{
30
30
  cleared: z.ZodBoolean;
31
31
  }, "strip", z.ZodTypeAny, {
32
32
  message: string;
33
- agent_did: string;
34
33
  project_id: string | null;
34
+ agent_did: string;
35
35
  cache_key: string;
36
36
  old_cache_key: string | null;
37
37
  had_value: boolean;
@@ -39,8 +39,8 @@ export declare const clearCacheResponseSchema: z.ZodObject<{
39
39
  cleared: boolean;
40
40
  }, {
41
41
  message: string;
42
- agent_did: string;
43
42
  project_id: string | null;
43
+ agent_did: string;
44
44
  cache_key: string;
45
45
  old_cache_key: string | null;
46
46
  had_value: boolean;