@vauban-org/agent-sdk 0.17.1 → 0.17.3

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 (135) hide show
  1. package/dist/adapters/registry/postgres.d.ts.map +1 -1
  2. package/dist/adapters/registry/postgres.js +6 -5
  3. package/dist/adapters/registry/postgres.js.map +1 -1
  4. package/dist/boot/init-sdk.d.ts +20 -0
  5. package/dist/boot/init-sdk.d.ts.map +1 -1
  6. package/dist/boot/init-sdk.js +10 -1
  7. package/dist/boot/init-sdk.js.map +1 -1
  8. package/dist/clients/pipelines.d.ts.map +1 -1
  9. package/dist/clients/pipelines.js +2 -2
  10. package/dist/clients/pipelines.js.map +1 -1
  11. package/dist/events/catalogue.d.ts +349 -0
  12. package/dist/events/catalogue.d.ts.map +1 -0
  13. package/dist/events/catalogue.js +54 -0
  14. package/dist/events/catalogue.js.map +1 -0
  15. package/dist/events/index.d.ts +21 -0
  16. package/dist/events/index.d.ts.map +1 -0
  17. package/dist/events/index.js +21 -0
  18. package/dist/events/index.js.map +1 -0
  19. package/dist/events/schemas/agent.completed.v1.d.ts +21 -0
  20. package/dist/events/schemas/agent.completed.v1.d.ts.map +1 -0
  21. package/dist/events/schemas/agent.completed.v1.js +11 -0
  22. package/dist/events/schemas/agent.completed.v1.js.map +1 -0
  23. package/dist/events/schemas/agent.failed.v1.d.ts +18 -0
  24. package/dist/events/schemas/agent.failed.v1.d.ts.map +1 -0
  25. package/dist/events/schemas/agent.failed.v1.js +10 -0
  26. package/dist/events/schemas/agent.failed.v1.js.map +1 -0
  27. package/dist/events/schemas/agent.hitl_requested.v1.d.ts +15 -0
  28. package/dist/events/schemas/agent.hitl_requested.v1.d.ts.map +1 -0
  29. package/dist/events/schemas/agent.hitl_requested.v1.js +9 -0
  30. package/dist/events/schemas/agent.hitl_requested.v1.js.map +1 -0
  31. package/dist/events/schemas/agent.hitl_resolved.v1.d.ts +15 -0
  32. package/dist/events/schemas/agent.hitl_resolved.v1.d.ts.map +1 -0
  33. package/dist/events/schemas/agent.hitl_resolved.v1.js +9 -0
  34. package/dist/events/schemas/agent.hitl_resolved.v1.js.map +1 -0
  35. package/dist/events/schemas/agent.started.v1.d.ts +18 -0
  36. package/dist/events/schemas/agent.started.v1.d.ts.map +1 -0
  37. package/dist/events/schemas/agent.started.v1.js +10 -0
  38. package/dist/events/schemas/agent.started.v1.js.map +1 -0
  39. package/dist/events/schemas/brain.skill.extracted.v1.d.ts +15 -0
  40. package/dist/events/schemas/brain.skill.extracted.v1.d.ts.map +1 -0
  41. package/dist/events/schemas/brain.skill.extracted.v1.js +9 -0
  42. package/dist/events/schemas/brain.skill.extracted.v1.js.map +1 -0
  43. package/dist/events/schemas/cc.cost.anomaly_detected.v1.d.ts +18 -0
  44. package/dist/events/schemas/cc.cost.anomaly_detected.v1.d.ts.map +1 -0
  45. package/dist/events/schemas/cc.cost.anomaly_detected.v1.js +10 -0
  46. package/dist/events/schemas/cc.cost.anomaly_detected.v1.js.map +1 -0
  47. package/dist/events/schemas/cc.cost.recorded.v1.d.ts +21 -0
  48. package/dist/events/schemas/cc.cost.recorded.v1.d.ts.map +1 -0
  49. package/dist/events/schemas/cc.cost.recorded.v1.js +11 -0
  50. package/dist/events/schemas/cc.cost.recorded.v1.js.map +1 -0
  51. package/dist/events/schemas/citadel.sprint.closed.v1.d.ts +15 -0
  52. package/dist/events/schemas/citadel.sprint.closed.v1.d.ts.map +1 -0
  53. package/dist/events/schemas/citadel.sprint.closed.v1.js +9 -0
  54. package/dist/events/schemas/citadel.sprint.closed.v1.js.map +1 -0
  55. package/dist/events/schemas/forge.lead.qualified.v1.d.ts +15 -0
  56. package/dist/events/schemas/forge.lead.qualified.v1.d.ts.map +1 -0
  57. package/dist/events/schemas/forge.lead.qualified.v1.js +9 -0
  58. package/dist/events/schemas/forge.lead.qualified.v1.js.map +1 -0
  59. package/dist/events/schemas/forge.outreach.sent.v1.d.ts +15 -0
  60. package/dist/events/schemas/forge.outreach.sent.v1.d.ts.map +1 -0
  61. package/dist/events/schemas/forge.outreach.sent.v1.js +9 -0
  62. package/dist/events/schemas/forge.outreach.sent.v1.js.map +1 -0
  63. package/dist/events/schemas/forge.policy.triggered.v1.d.ts +12 -0
  64. package/dist/events/schemas/forge.policy.triggered.v1.d.ts.map +1 -0
  65. package/dist/events/schemas/forge.policy.triggered.v1.js +8 -0
  66. package/dist/events/schemas/forge.policy.triggered.v1.js.map +1 -0
  67. package/dist/events/schemas/glacis.identity.verified.v1.d.ts +12 -0
  68. package/dist/events/schemas/glacis.identity.verified.v1.d.ts.map +1 -0
  69. package/dist/events/schemas/glacis.identity.verified.v1.js +8 -0
  70. package/dist/events/schemas/glacis.identity.verified.v1.js.map +1 -0
  71. package/dist/events/schemas/incident.detected.v1.d.ts +15 -0
  72. package/dist/events/schemas/incident.detected.v1.d.ts.map +1 -0
  73. package/dist/events/schemas/incident.detected.v1.js +9 -0
  74. package/dist/events/schemas/incident.detected.v1.js.map +1 -0
  75. package/dist/events/schemas/incident.slo_burn.v1.d.ts +15 -0
  76. package/dist/events/schemas/incident.slo_burn.v1.d.ts.map +1 -0
  77. package/dist/events/schemas/incident.slo_burn.v1.js +9 -0
  78. package/dist/events/schemas/incident.slo_burn.v1.js.map +1 -0
  79. package/dist/events/schemas/tenant.budget.exceeded.v1.d.ts +18 -0
  80. package/dist/events/schemas/tenant.budget.exceeded.v1.d.ts.map +1 -0
  81. package/dist/events/schemas/tenant.budget.exceeded.v1.js +10 -0
  82. package/dist/events/schemas/tenant.budget.exceeded.v1.js.map +1 -0
  83. package/dist/events/schemas/tenant.provisioned.v1.d.ts +15 -0
  84. package/dist/events/schemas/tenant.provisioned.v1.d.ts.map +1 -0
  85. package/dist/events/schemas/tenant.provisioned.v1.js +9 -0
  86. package/dist/events/schemas/tenant.provisioned.v1.js.map +1 -0
  87. package/dist/events/schemas/vauban.vault.rebalance_proposed.v1.d.ts +15 -0
  88. package/dist/events/schemas/vauban.vault.rebalance_proposed.v1.d.ts.map +1 -0
  89. package/dist/events/schemas/vauban.vault.rebalance_proposed.v1.js +9 -0
  90. package/dist/events/schemas/vauban.vault.rebalance_proposed.v1.js.map +1 -0
  91. package/dist/events/schemas/vauban.vault.rebalanced.v1.d.ts +12 -0
  92. package/dist/events/schemas/vauban.vault.rebalanced.v1.d.ts.map +1 -0
  93. package/dist/events/schemas/vauban.vault.rebalanced.v1.js +8 -0
  94. package/dist/events/schemas/vauban.vault.rebalanced.v1.js.map +1 -0
  95. package/dist/index.d.ts +4 -2
  96. package/dist/index.d.ts.map +1 -1
  97. package/dist/index.js +4 -1
  98. package/dist/index.js.map +1 -1
  99. package/dist/ports/index.d.ts +1 -0
  100. package/dist/ports/index.d.ts.map +1 -1
  101. package/dist/ports/messaging.contract.test.js +1 -1
  102. package/dist/ports/messaging.contract.test.js.map +1 -1
  103. package/dist/ports/price.d.ts +21 -0
  104. package/dist/ports/price.d.ts.map +1 -0
  105. package/dist/ports/price.js +10 -0
  106. package/dist/ports/price.js.map +1 -0
  107. package/package.json +18 -17
  108. package/src/adapters/registry/postgres.ts +7 -5
  109. package/src/boot/init-sdk.ts +36 -1
  110. package/src/clients/pipelines.ts +8 -7
  111. package/src/events/catalogue.ts +120 -0
  112. package/src/events/index.ts +20 -0
  113. package/src/events/schemas/agent.completed.v1.ts +11 -0
  114. package/src/events/schemas/agent.failed.v1.ts +10 -0
  115. package/src/events/schemas/agent.hitl_requested.v1.ts +9 -0
  116. package/src/events/schemas/agent.hitl_resolved.v1.ts +9 -0
  117. package/src/events/schemas/agent.started.v1.ts +10 -0
  118. package/src/events/schemas/brain.skill.extracted.v1.ts +9 -0
  119. package/src/events/schemas/cc.cost.anomaly_detected.v1.ts +10 -0
  120. package/src/events/schemas/cc.cost.recorded.v1.ts +11 -0
  121. package/src/events/schemas/citadel.sprint.closed.v1.ts +9 -0
  122. package/src/events/schemas/forge.lead.qualified.v1.ts +9 -0
  123. package/src/events/schemas/forge.outreach.sent.v1.ts +9 -0
  124. package/src/events/schemas/forge.policy.triggered.v1.ts +8 -0
  125. package/src/events/schemas/glacis.identity.verified.v1.ts +8 -0
  126. package/src/events/schemas/incident.detected.v1.ts +9 -0
  127. package/src/events/schemas/incident.slo_burn.v1.ts +9 -0
  128. package/src/events/schemas/tenant.budget.exceeded.v1.ts +10 -0
  129. package/src/events/schemas/tenant.provisioned.v1.ts +9 -0
  130. package/src/events/schemas/vauban.vault.rebalance_proposed.v1.ts +9 -0
  131. package/src/events/schemas/vauban.vault.rebalanced.v1.ts +8 -0
  132. package/src/index.ts +16 -1
  133. package/src/ports/index.ts +2 -0
  134. package/src/ports/messaging.contract.test.ts +1 -1
  135. package/src/ports/price.ts +22 -0
@@ -0,0 +1,120 @@
1
+ import { z } from "zod";
2
+ import { AgentStartedV1 } from "./schemas/agent.started.v1.js";
3
+ import { AgentCompletedV1 } from "./schemas/agent.completed.v1.js";
4
+ import { AgentFailedV1 } from "./schemas/agent.failed.v1.js";
5
+ import { AgentHitlRequestedV1 } from "./schemas/agent.hitl_requested.v1.js";
6
+ import { AgentHitlResolvedV1 } from "./schemas/agent.hitl_resolved.v1.js";
7
+ import { IncidentSloBurnV1 } from "./schemas/incident.slo_burn.v1.js";
8
+ import { IncidentDetectedV1 } from "./schemas/incident.detected.v1.js";
9
+ import { ForgeLeadQualifiedV1 } from "./schemas/forge.lead.qualified.v1.js";
10
+ import { ForgeOutreachSentV1 } from "./schemas/forge.outreach.sent.v1.js";
11
+ import { ForgePolicyTriggeredV1 } from "./schemas/forge.policy.triggered.v1.js";
12
+ import { VaubanVaultRebalanceProposedV1 } from "./schemas/vauban.vault.rebalance_proposed.v1.js";
13
+ import { VaubanVaultRebalancedV1 } from "./schemas/vauban.vault.rebalanced.v1.js";
14
+ import { GlacisIdentityVerifiedV1 } from "./schemas/glacis.identity.verified.v1.js";
15
+ import { CitadelSprintClosedV1 } from "./schemas/citadel.sprint.closed.v1.js";
16
+ import { BrainSkillExtractedV1 } from "./schemas/brain.skill.extracted.v1.js";
17
+ import { CcCostRecordedV1 } from "./schemas/cc.cost.recorded.v1.js";
18
+ import { CcCostAnomalyDetectedV1 } from "./schemas/cc.cost.anomaly_detected.v1.js";
19
+ import { TenantProvisionedV1 } from "./schemas/tenant.provisioned.v1.js";
20
+ import { TenantBudgetExceededV1 } from "./schemas/tenant.budget.exceeded.v1.js";
21
+
22
+ export const EventSchemas = {
23
+ "agent.started": AgentStartedV1,
24
+ "agent.completed": AgentCompletedV1,
25
+ "agent.failed": AgentFailedV1,
26
+ "agent.hitl_requested": AgentHitlRequestedV1,
27
+ "agent.hitl_resolved": AgentHitlResolvedV1,
28
+ "incident.slo_burn": IncidentSloBurnV1,
29
+ "incident.detected": IncidentDetectedV1,
30
+ "forge.lead.qualified": ForgeLeadQualifiedV1,
31
+ "forge.outreach.sent": ForgeOutreachSentV1,
32
+ "forge.policy.triggered": ForgePolicyTriggeredV1,
33
+ "vauban.vault.rebalance_proposed": VaubanVaultRebalanceProposedV1,
34
+ "vauban.vault.rebalanced": VaubanVaultRebalancedV1,
35
+ "glacis.identity.verified": GlacisIdentityVerifiedV1,
36
+ "citadel.sprint.closed": CitadelSprintClosedV1,
37
+ "brain.skill.extracted": BrainSkillExtractedV1,
38
+ "cc.cost.recorded": CcCostRecordedV1,
39
+ "cc.cost.anomaly_detected": CcCostAnomalyDetectedV1,
40
+ "tenant.provisioned": TenantProvisionedV1,
41
+ "tenant.budget.exceeded": TenantBudgetExceededV1,
42
+ } as const;
43
+
44
+ export type EventType =
45
+ | { type: "agent.started"; payload: z.infer<typeof AgentStartedV1> }
46
+ | { type: "agent.completed"; payload: z.infer<typeof AgentCompletedV1> }
47
+ | { type: "agent.failed"; payload: z.infer<typeof AgentFailedV1> }
48
+ | {
49
+ type: "agent.hitl_requested";
50
+ payload: z.infer<typeof AgentHitlRequestedV1>;
51
+ }
52
+ | {
53
+ type: "agent.hitl_resolved";
54
+ payload: z.infer<typeof AgentHitlResolvedV1>;
55
+ }
56
+ | { type: "incident.slo_burn"; payload: z.infer<typeof IncidentSloBurnV1> }
57
+ | { type: "incident.detected"; payload: z.infer<typeof IncidentDetectedV1> }
58
+ | {
59
+ type: "forge.lead.qualified";
60
+ payload: z.infer<typeof ForgeLeadQualifiedV1>;
61
+ }
62
+ | {
63
+ type: "forge.outreach.sent";
64
+ payload: z.infer<typeof ForgeOutreachSentV1>;
65
+ }
66
+ | {
67
+ type: "forge.policy.triggered";
68
+ payload: z.infer<typeof ForgePolicyTriggeredV1>;
69
+ }
70
+ | {
71
+ type: "vauban.vault.rebalance_proposed";
72
+ payload: z.infer<typeof VaubanVaultRebalanceProposedV1>;
73
+ }
74
+ | {
75
+ type: "vauban.vault.rebalanced";
76
+ payload: z.infer<typeof VaubanVaultRebalancedV1>;
77
+ }
78
+ | {
79
+ type: "glacis.identity.verified";
80
+ payload: z.infer<typeof GlacisIdentityVerifiedV1>;
81
+ }
82
+ | {
83
+ type: "citadel.sprint.closed";
84
+ payload: z.infer<typeof CitadelSprintClosedV1>;
85
+ }
86
+ | {
87
+ type: "brain.skill.extracted";
88
+ payload: z.infer<typeof BrainSkillExtractedV1>;
89
+ }
90
+ | { type: "cc.cost.recorded"; payload: z.infer<typeof CcCostRecordedV1> }
91
+ | {
92
+ type: "cc.cost.anomaly_detected";
93
+ payload: z.infer<typeof CcCostAnomalyDetectedV1>;
94
+ }
95
+ | { type: "tenant.provisioned"; payload: z.infer<typeof TenantProvisionedV1> }
96
+ | {
97
+ type: "tenant.budget.exceeded";
98
+ payload: z.infer<typeof TenantBudgetExceededV1>;
99
+ };
100
+
101
+ export type EventTypeName = keyof typeof EventSchemas;
102
+
103
+ export function resolveSchema(
104
+ type: string
105
+ ): z.ZodObject<z.ZodRawShape> | undefined {
106
+ return (EventSchemas as Record<string, z.ZodObject<z.ZodRawShape>>)[type];
107
+ }
108
+
109
+ export function validateEvent(
110
+ type: string,
111
+ payload: unknown
112
+ ): { valid: boolean; error?: string } {
113
+ const schema = resolveSchema(type);
114
+ if (!schema) {
115
+ return { valid: false, error: `Unknown event type: ${type}` };
116
+ }
117
+ const result = schema.safeParse(payload);
118
+ if (result.success) return { valid: true };
119
+ return { valid: false, error: result.error.message };
120
+ }
@@ -0,0 +1,20 @@
1
+ export * from "./catalogue.js";
2
+ export { AgentStartedV1 } from "./schemas/agent.started.v1.js";
3
+ export { AgentCompletedV1 } from "./schemas/agent.completed.v1.js";
4
+ export { AgentFailedV1 } from "./schemas/agent.failed.v1.js";
5
+ export { AgentHitlRequestedV1 } from "./schemas/agent.hitl_requested.v1.js";
6
+ export { AgentHitlResolvedV1 } from "./schemas/agent.hitl_resolved.v1.js";
7
+ export { IncidentSloBurnV1 } from "./schemas/incident.slo_burn.v1.js";
8
+ export { IncidentDetectedV1 } from "./schemas/incident.detected.v1.js";
9
+ export { ForgeLeadQualifiedV1 } from "./schemas/forge.lead.qualified.v1.js";
10
+ export { ForgeOutreachSentV1 } from "./schemas/forge.outreach.sent.v1.js";
11
+ export { ForgePolicyTriggeredV1 } from "./schemas/forge.policy.triggered.v1.js";
12
+ export { VaubanVaultRebalanceProposedV1 } from "./schemas/vauban.vault.rebalance_proposed.v1.js";
13
+ export { VaubanVaultRebalancedV1 } from "./schemas/vauban.vault.rebalanced.v1.js";
14
+ export { GlacisIdentityVerifiedV1 } from "./schemas/glacis.identity.verified.v1.js";
15
+ export { CitadelSprintClosedV1 } from "./schemas/citadel.sprint.closed.v1.js";
16
+ export { BrainSkillExtractedV1 } from "./schemas/brain.skill.extracted.v1.js";
17
+ export { CcCostRecordedV1 } from "./schemas/cc.cost.recorded.v1.js";
18
+ export { CcCostAnomalyDetectedV1 } from "./schemas/cc.cost.anomaly_detected.v1.js";
19
+ export { TenantProvisionedV1 } from "./schemas/tenant.provisioned.v1.js";
20
+ export { TenantBudgetExceededV1 } from "./schemas/tenant.budget.exceeded.v1.js";
@@ -0,0 +1,11 @@
1
+ import { z } from "zod";
2
+
3
+ export const AgentCompletedV1 = z
4
+ .object({
5
+ agentName: z.string(),
6
+ runId: z.string().uuid(),
7
+ outputs: z.unknown(),
8
+ durationMs: z.number().int().positive(),
9
+ costUsd: z.number().nonnegative(),
10
+ })
11
+ .strict();
@@ -0,0 +1,10 @@
1
+ import { z } from "zod";
2
+
3
+ export const AgentFailedV1 = z
4
+ .object({
5
+ agentName: z.string(),
6
+ runId: z.string().uuid(),
7
+ error: z.string(),
8
+ retryCount: z.number().int().nonnegative(),
9
+ })
10
+ .strict();
@@ -0,0 +1,9 @@
1
+ import { z } from "zod";
2
+
3
+ export const AgentHitlRequestedV1 = z
4
+ .object({
5
+ approvalId: z.string().uuid(),
6
+ question: z.string(),
7
+ deadline: z.string().datetime(),
8
+ })
9
+ .strict();
@@ -0,0 +1,9 @@
1
+ import { z } from "zod";
2
+
3
+ export const AgentHitlResolvedV1 = z
4
+ .object({
5
+ approvalId: z.string().uuid(),
6
+ decision: z.enum(["approved", "rejected"]),
7
+ by: z.string(),
8
+ })
9
+ .strict();
@@ -0,0 +1,10 @@
1
+ import { z } from "zod";
2
+
3
+ export const AgentStartedV1 = z
4
+ .object({
5
+ agentName: z.string(),
6
+ runId: z.string().uuid(),
7
+ inputs: z.unknown(),
8
+ tenantId: z.string().uuid().optional(),
9
+ })
10
+ .strict();
@@ -0,0 +1,9 @@
1
+ import { z } from "zod";
2
+
3
+ export const BrainSkillExtractedV1 = z
4
+ .object({
5
+ skillId: z.string(),
6
+ agentSource: z.string(),
7
+ confidence: z.number().min(0).max(1),
8
+ })
9
+ .strict();
@@ -0,0 +1,10 @@
1
+ import { z } from "zod";
2
+
3
+ export const CcCostAnomalyDetectedV1 = z
4
+ .object({
5
+ agent: z.string(),
6
+ expected: z.number(),
7
+ actual: z.number(),
8
+ period: z.string(),
9
+ })
10
+ .strict();
@@ -0,0 +1,11 @@
1
+ import { z } from "zod";
2
+
3
+ export const CcCostRecordedV1 = z
4
+ .object({
5
+ agent: z.string(),
6
+ costUsd: z.number().nonnegative(),
7
+ tokens: z.number().int().nonnegative(),
8
+ model: z.string(),
9
+ tenantId: z.string().uuid().optional(),
10
+ })
11
+ .strict();
@@ -0,0 +1,9 @@
1
+ import { z } from "zod";
2
+
3
+ export const CitadelSprintClosedV1 = z
4
+ .object({
5
+ sprintId: z.string(),
6
+ completed: z.number().int().nonnegative(),
7
+ carryOver: z.number().int().nonnegative(),
8
+ })
9
+ .strict();
@@ -0,0 +1,9 @@
1
+ import { z } from "zod";
2
+
3
+ export const ForgeLeadQualifiedV1 = z
4
+ .object({
5
+ leadId: z.string().uuid(),
6
+ score: z.number().min(0).max(100),
7
+ source: z.enum(["inbound", "outbound", "referral"]),
8
+ })
9
+ .strict();
@@ -0,0 +1,9 @@
1
+ import { z } from "zod";
2
+
3
+ export const ForgeOutreachSentV1 = z
4
+ .object({
5
+ leadId: z.string().uuid(),
6
+ channel: z.enum(["email", "linkedin", "x", "telegram"]),
7
+ content: z.string(),
8
+ })
9
+ .strict();
@@ -0,0 +1,8 @@
1
+ import { z } from "zod";
2
+
3
+ export const ForgePolicyTriggeredV1 = z
4
+ .object({
5
+ policyId: z.string(),
6
+ context: z.record(z.unknown()),
7
+ })
8
+ .strict();
@@ -0,0 +1,8 @@
1
+ import { z } from "zod";
2
+
3
+ export const GlacisIdentityVerifiedV1 = z
4
+ .object({
5
+ userId: z.string().uuid(),
6
+ method: z.enum(["zk_passport", "zk_email", "world_id"]),
7
+ })
8
+ .strict();
@@ -0,0 +1,9 @@
1
+ import { z } from "zod";
2
+
3
+ export const IncidentDetectedV1 = z
4
+ .object({
5
+ source: z.string(),
6
+ severity: z.enum(["low", "medium", "high", "critical"]),
7
+ summary: z.string(),
8
+ })
9
+ .strict();
@@ -0,0 +1,9 @@
1
+ import { z } from "zod";
2
+
3
+ export const IncidentSloBurnV1 = z
4
+ .object({
5
+ slo: z.string(),
6
+ burnRate: z.number(),
7
+ severity: z.enum(["low", "medium", "high", "critical"]),
8
+ })
9
+ .strict();
@@ -0,0 +1,10 @@
1
+ import { z } from "zod";
2
+
3
+ export const TenantBudgetExceededV1 = z
4
+ .object({
5
+ tenantId: z.string().uuid(),
6
+ period: z.string(),
7
+ amountUsd: z.number(),
8
+ limitUsd: z.number(),
9
+ })
10
+ .strict();
@@ -0,0 +1,9 @@
1
+ import { z } from "zod";
2
+
3
+ export const TenantProvisionedV1 = z
4
+ .object({
5
+ tenantId: z.string().uuid(),
6
+ plan: z.enum(["starter", "team", "pro", "enterprise"]),
7
+ virtualKey: z.string(),
8
+ })
9
+ .strict();
@@ -0,0 +1,9 @@
1
+ import { z } from "zod";
2
+
3
+ export const VaubanVaultRebalanceProposedV1 = z
4
+ .object({
5
+ vaultId: z.string(),
6
+ currentRatio: z.number(),
7
+ targetRatio: z.number(),
8
+ })
9
+ .strict();
@@ -0,0 +1,8 @@
1
+ import { z } from "zod";
2
+
3
+ export const VaubanVaultRebalancedV1 = z
4
+ .object({
5
+ vaultId: z.string(),
6
+ txHash: z.string(),
7
+ })
8
+ .strict();
package/src/index.ts CHANGED
@@ -183,9 +183,15 @@ export type {
183
183
  ChatMessage,
184
184
  ChatUsage,
185
185
  StreamDelta,
186
+ // Price feed port (plan v6 §3.4)
187
+ PricePort,
188
+ PriceEntry,
186
189
  } from "./ports/index.js";
187
190
  export { noopLogger, InvalidTargetError } from "./ports/index.js";
188
191
 
192
+ // 8f. EventBusPort + CloudEvent (plan v6 §3.3 — sprint-618)
193
+ export type { EventBusPort, CloudEvent } from "./ports/event-bus.js";
194
+
189
195
  // 8b. LLM adapters — BYOM concrete implementations
190
196
  export { LiteLLMAdapter } from "./adapters/llm/litellm.js";
191
197
  export type { LiteLLMAdapterConfig } from "./adapters/llm/litellm.js";
@@ -337,7 +343,8 @@ export type {
337
343
  export * from "./outcomes/index.js";
338
344
 
339
345
  // 14. Proof module (SDK v0.5.2 — Sprint-521 Bloc 1)
340
- export * from "./proof/index.js";
346
+ // Note: proof/index.js re-exports from @vauban-org/proof-core (optional peerDep).
347
+ // Import via subpath @vauban-org/agent-sdk/proof — do NOT wildcard here.
341
348
 
342
349
  // 15. Runs streaming + health (SDK v0.5.3 — sprint-523)
343
350
  export * from "./runs/index.js";
@@ -700,6 +707,14 @@ export {
700
707
  publishAllSignals,
701
708
  } from "./constitution/index.js";
702
709
 
710
+ // 40. Events catalogue — 19 versioned Zod schemas (sprint-619:quick-4, plan v6 §4.2-4.3)
711
+ export {
712
+ EventSchemas,
713
+ resolveSchema,
714
+ validateEvent,
715
+ } from "./events/catalogue.js";
716
+ export type { EventType, EventTypeName } from "./events/catalogue.js";
717
+
703
718
  // 39. Shared agent types — promoted from Forge (Vague 1.B.1)
704
719
  export type {
705
720
  EscalationLevel,
@@ -46,3 +46,5 @@ export type {
46
46
  ChatResponse,
47
47
  StreamDelta,
48
48
  } from "./llm-provider.js";
49
+
50
+ export type { PricePort, PriceEntry } from "./price.js";
@@ -128,7 +128,7 @@ describe("TelegramChannel", () => {
128
128
  await channel.sendAlert("critical", "Down", "All gone");
129
129
  expect(vi.mocked(fetch)).toHaveBeenCalledOnce();
130
130
  const [url, init] = vi.mocked(fetch).mock.calls[0] as [string, RequestInit];
131
- expect(url).toContain("/bot tok/sendMessage");
131
+ expect(url).toContain("/bottok/sendMessage");
132
132
  const body = JSON.parse(init.body as string) as Record<string, string>;
133
133
  expect(body["chat_id"]).toBe("42");
134
134
  expect(body["text"]).toContain("🚨");
@@ -0,0 +1,22 @@
1
+ /**
2
+ * PricePort — asset price feed contract.
3
+ *
4
+ * Host injects a concrete adapter (e.g., BastionPriceAdapter → Pragma)
5
+ * so agents never depend on a specific price oracle or API.
6
+ *
7
+ * Design: mirrors BrainPort pattern — interface-only, no impl in SDK.
8
+ */
9
+
10
+ export interface PriceEntry {
11
+ asset: string;
12
+ priceUsd: number;
13
+ source: string;
14
+ fetchedAt: string; // ISO
15
+ }
16
+
17
+ export interface PricePort {
18
+ /** Get current price in USD. Returns null if unavailable or stale. */
19
+ getPrice(asset: string): Promise<number | null>;
20
+ /** Get prices for multiple assets in one round-trip when possible. */
21
+ getPrices(assets: string[]): Promise<Record<string, number | null>>;
22
+ }