@indexnetwork/protocol 4.5.0-rc.332.1 → 4.5.0-rc.333.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.
Files changed (43) hide show
  1. package/dist/chat/chat-streaming.types.d.ts +1 -1
  2. package/dist/chat/chat-streaming.types.d.ts.map +1 -1
  3. package/dist/chat/chat-streaming.types.js.map +1 -1
  4. package/dist/chat/chat.agent.d.ts +1 -1
  5. package/dist/chat/chat.agent.d.ts.map +1 -1
  6. package/dist/chat/chat.agent.js.map +1 -1
  7. package/dist/index.d.ts +3 -0
  8. package/dist/index.d.ts.map +1 -1
  9. package/dist/index.js +3 -0
  10. package/dist/index.js.map +1 -1
  11. package/dist/negotiation/negotiation.agent.d.ts +21 -0
  12. package/dist/negotiation/negotiation.agent.d.ts.map +1 -1
  13. package/dist/negotiation/negotiation.agent.js +79 -11
  14. package/dist/negotiation/negotiation.agent.js.map +1 -1
  15. package/dist/negotiation/negotiation.graph.d.ts +37 -24
  16. package/dist/negotiation/negotiation.graph.d.ts.map +1 -1
  17. package/dist/negotiation/negotiation.graph.js +68 -17
  18. package/dist/negotiation/negotiation.graph.js.map +1 -1
  19. package/dist/negotiation/negotiation.protocol.d.ts +287 -0
  20. package/dist/negotiation/negotiation.protocol.d.ts.map +1 -0
  21. package/dist/negotiation/negotiation.protocol.js +152 -0
  22. package/dist/negotiation/negotiation.protocol.js.map +1 -0
  23. package/dist/negotiation/negotiation.state.d.ts +21 -9
  24. package/dist/negotiation/negotiation.state.d.ts.map +1 -1
  25. package/dist/negotiation/negotiation.state.js +19 -4
  26. package/dist/negotiation/negotiation.state.js.map +1 -1
  27. package/dist/negotiation/negotiation.tools.d.ts.map +1 -1
  28. package/dist/negotiation/negotiation.tools.js +86 -31
  29. package/dist/negotiation/negotiation.tools.js.map +1 -1
  30. package/dist/opportunity/question.prompt.d.ts +1 -1
  31. package/dist/opportunity/question.prompt.d.ts.map +1 -1
  32. package/dist/opportunity/question.prompt.js.map +1 -1
  33. package/dist/shared/interfaces/agent-dispatcher.interface.d.ts +6 -0
  34. package/dist/shared/interfaces/agent-dispatcher.interface.d.ts.map +1 -1
  35. package/dist/shared/interfaces/agent-dispatcher.interface.js.map +1 -1
  36. package/dist/shared/schemas/discovery-question.schema.d.ts +8 -8
  37. package/dist/shared/schemas/discovery-question.schema.js +1 -1
  38. package/dist/shared/schemas/discovery-question.schema.js.map +1 -1
  39. package/dist/shared/schemas/negotiation-state.schema.d.ts +19 -3
  40. package/dist/shared/schemas/negotiation-state.schema.d.ts.map +1 -1
  41. package/dist/shared/schemas/negotiation-state.schema.js +15 -1
  42. package/dist/shared/schemas/negotiation-state.schema.js.map +1 -1
  43. package/package.json +1 -1
@@ -10,7 +10,7 @@ import type { ChatContextDigest } from "./chat-context.schema.js";
10
10
  export declare const NegotiationRoleSchema: z.ZodEnum<["agent", "patient", "peer"]>;
11
11
  export type NegotiationRole = z.infer<typeof NegotiationRoleSchema>;
12
12
  export declare const DiscoveryTurnSchema: z.ZodObject<{
13
- action: z.ZodEnum<["propose", "accept", "reject", "counter", "question"]>;
13
+ action: z.ZodEnum<["propose", "accept", "reject", "counter", "question", "outreach", "withdraw", "decline"]>;
14
14
  reasoning: z.ZodString;
15
15
  suggestedRoles: z.ZodObject<{
16
16
  ownUser: z.ZodEnum<["agent", "patient", "peer"]>;
@@ -24,14 +24,14 @@ export declare const DiscoveryTurnSchema: z.ZodObject<{
24
24
  }>;
25
25
  }, "strip", z.ZodTypeAny, {
26
26
  reasoning: string;
27
- action: "propose" | "accept" | "reject" | "counter" | "question";
27
+ action: "propose" | "accept" | "reject" | "counter" | "question" | "outreach" | "withdraw" | "decline";
28
28
  suggestedRoles: {
29
29
  ownUser: "agent" | "patient" | "peer";
30
30
  otherUser: "agent" | "patient" | "peer";
31
31
  };
32
32
  }, {
33
33
  reasoning: string;
34
- action: "propose" | "accept" | "reject" | "counter" | "question";
34
+ action: "propose" | "accept" | "reject" | "counter" | "question" | "outreach" | "withdraw" | "decline";
35
35
  suggestedRoles: {
36
36
  ownUser: "agent" | "patient" | "peer";
37
37
  otherUser: "agent" | "patient" | "peer";
@@ -75,7 +75,7 @@ export declare const DiscoveryNegotiationSchema: z.ZodObject<{
75
75
  counterpartyHint: z.ZodString;
76
76
  indexContext: z.ZodString;
77
77
  turns: z.ZodArray<z.ZodObject<{
78
- action: z.ZodEnum<["propose", "accept", "reject", "counter", "question"]>;
78
+ action: z.ZodEnum<["propose", "accept", "reject", "counter", "question", "outreach", "withdraw", "decline"]>;
79
79
  reasoning: z.ZodString;
80
80
  suggestedRoles: z.ZodObject<{
81
81
  ownUser: z.ZodEnum<["agent", "patient", "peer"]>;
@@ -89,14 +89,14 @@ export declare const DiscoveryNegotiationSchema: z.ZodObject<{
89
89
  }>;
90
90
  }, "strip", z.ZodTypeAny, {
91
91
  reasoning: string;
92
- action: "propose" | "accept" | "reject" | "counter" | "question";
92
+ action: "propose" | "accept" | "reject" | "counter" | "question" | "outreach" | "withdraw" | "decline";
93
93
  suggestedRoles: {
94
94
  ownUser: "agent" | "patient" | "peer";
95
95
  otherUser: "agent" | "patient" | "peer";
96
96
  };
97
97
  }, {
98
98
  reasoning: string;
99
- action: "propose" | "accept" | "reject" | "counter" | "question";
99
+ action: "propose" | "accept" | "reject" | "counter" | "question" | "outreach" | "withdraw" | "decline";
100
100
  suggestedRoles: {
101
101
  ownUser: "agent" | "patient" | "peer";
102
102
  otherUser: "agent" | "patient" | "peer";
@@ -148,7 +148,7 @@ export declare const DiscoveryNegotiationSchema: z.ZodObject<{
148
148
  indexContext: string;
149
149
  turns: {
150
150
  reasoning: string;
151
- action: "propose" | "accept" | "reject" | "counter" | "question";
151
+ action: "propose" | "accept" | "reject" | "counter" | "question" | "outreach" | "withdraw" | "decline";
152
152
  suggestedRoles: {
153
153
  ownUser: "agent" | "patient" | "peer";
154
154
  otherUser: "agent" | "patient" | "peer";
@@ -170,7 +170,7 @@ export declare const DiscoveryNegotiationSchema: z.ZodObject<{
170
170
  indexContext: string;
171
171
  turns: {
172
172
  reasoning: string;
173
- action: "propose" | "accept" | "reject" | "counter" | "question";
173
+ action: "propose" | "accept" | "reject" | "counter" | "question" | "outreach" | "withdraw" | "decline";
174
174
  suggestedRoles: {
175
175
  ownUser: "agent" | "patient" | "peer";
176
176
  otherUser: "agent" | "patient" | "peer";
@@ -8,7 +8,7 @@ import { z } from "zod";
8
8
  // ─── Primitives ───────────────────────────────────────────────────────────────
9
9
  export const NegotiationRoleSchema = z.enum(["agent", "patient", "peer"]);
10
10
  export const DiscoveryTurnSchema = z.object({
11
- action: z.enum(["propose", "accept", "reject", "counter", "question"]),
11
+ action: z.enum(["propose", "accept", "reject", "counter", "question", "outreach", "withdraw", "decline"]),
12
12
  reasoning: z.string(),
13
13
  suggestedRoles: z.object({
14
14
  ownUser: NegotiationRoleSchema,
@@ -1 +1 @@
1
- {"version":3,"file":"discovery-question.schema.js","sourceRoot":"/","sources":["shared/schemas/discovery-question.schema.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AACH,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAIxB,iFAAiF;AAEjF,MAAM,CAAC,MAAM,qBAAqB,GAAG,CAAC,CAAC,IAAI,CAAC,CAAC,OAAO,EAAE,SAAS,EAAE,MAAM,CAAC,CAAC,CAAC;AAG1E,MAAM,CAAC,MAAM,mBAAmB,GAAG,CAAC,CAAC,MAAM,CAAC;IAC1C,MAAM,EAAE,CAAC,CAAC,IAAI,CAAC,CAAC,SAAS,EAAE,QAAQ,EAAE,QAAQ,EAAE,SAAS,EAAE,UAAU,CAAC,CAAC;IACtE,SAAS,EAAE,CAAC,CAAC,MAAM,EAAE;IACrB,cAAc,EAAE,CAAC,CAAC,MAAM,CAAC;QACvB,OAAO,EAAE,qBAAqB;QAC9B,SAAS,EAAE,qBAAqB;KACjC,CAAC;CACH,CAAC,CAAC;AAGH,MAAM,CAAC,MAAM,sBAAsB,GAAG,CAAC,CAAC,MAAM,CA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AAC,CAAC,MAAM,EAAE,CAAC,QAAQ,EAAE;IAC1B,QAAQ,EAAE,CAAC,CAAC,MAAM,EAAE,CAAC,QAAQ,EAAE;IAC/B,MAAM,EAAE,CAAC,CAAC,KAAK,CAAC,CAAC,CAAC,MAAM,EAAE,CAAC,CAAC,QAAQ,EAAE;IACtC,SAAS,EAAE,CAAC,CAAC,KAAK,CAAC,CAAC,CAAC,MAAM,EAAE,CAAC,CAAC,QAAQ,EAAE;CAC1C,CAAC,CAAC","sourcesContent":["/**\n * DiscoveryQuestionInput and nested types.\n * Leaf types have full Zod schemas. The composite DiscoveryQuestionInput is\n * a pure interface referencing cross-schema types (DiscoveryNegotiationDigest,\n * ChatContextDigest) to avoid Zod cross-schema runtime coupling.\n */\nimport { z } from \"zod\";\nimport type { DiscoveryNegotiationDigest } from \"./negotiation-digest.schema.js\";\nimport type { ChatContextDigest } from \"./chat-context.schema.js\";\n\n// ─── Primitives ───────────────────────────────────────────────────────────────\n\nexport const NegotiationRoleSchema = z.enum([\"agent\", \"patient\", \"peer\"]);\nexport type NegotiationRole = z.infer<typeof NegotiationRoleSchema>;\n\nexport const DiscoveryTurnSchema = z.object({\n action: z.enum([\"propose\", \"accept\", \"reject\", \"counter\", \"question\"]),\n reasoning: z.string(),\n suggestedRoles: z.object({\n ownUser: NegotiationRoleSchema,\n otherUser: NegotiationRoleSchema,\n }),\n});\nexport type DiscoveryTurn = z.infer<typeof DiscoveryTurnSchema>;\n\nexport const DiscoveryOutcomeSchema = z.object({\n hasOpportunity: z.boolean(),\n reasoning: z.string(),\n agreedRoles: z.array(z.object({\n userId: z.string(),\n role: NegotiationRoleSchema,\n })).optional(),\n reason: z.enum([\"turn_cap\", \"timeout\"]).optional(),\n});\nexport type DiscoveryOutcome = z.infer<typeof DiscoveryOutcomeSchema>;\n\nexport const DiscoveryNegotiationSchema = z.object({\n counterpartyId: z.string(),\n counterpartyHint: z.string(),\n indexContext: z.string(),\n turns: z.array(DiscoveryTurnSchema),\n outcome: DiscoveryOutcomeSchema,\n seedAssessmentScore: z.number().optional(),\n});\nexport type DiscoveryNegotiation = z.infer<typeof DiscoveryNegotiationSchema>;\n\nexport const DiscoverySummarySchema = z.object({\n totalCandidates: z.number(),\n opportunitiesFound: z.number(),\n noOpportunityCount: z.number(),\n timeoutCount: z.number(),\n roleDistribution: z.record(NegotiationRoleSchema, z.number()),\n});\nexport type DiscoverySummary = {\n totalCandidates: number;\n opportunitiesFound: number;\n noOpportunityCount: number;\n timeoutCount: number;\n roleDistribution: Partial<Record<NegotiationRole, number>>;\n};\n\nexport const DiscoverySourceProfileSchema = z.object({\n name: z.string().optional(),\n bio: z.string().optional(),\n location: z.string().optional(),\n skills: z.array(z.string()).optional(),\n interests: z.array(z.string()).optional(),\n});\nexport type DiscoverySourceProfile = z.infer<typeof DiscoverySourceProfileSchema>;\n\n// ─── Composite input (pure interface — references cross-schema types) ─────────\n\n/**\n * Full input to the question generator.\n * Defined as a pure interface so it can reference DiscoveryNegotiationDigest\n * and ChatContextDigest from sibling schemas without Zod runtime coupling.\n */\nexport interface DiscoveryQuestionInput {\n query: string;\n /** The seeker's global user_context paragraph (profile-replacing identity text). */\n userContext: string;\n negotiationDigests: DiscoveryNegotiationDigest[];\n summary: DiscoverySummary;\n chatContext?: ChatContextDigest;\n now: string;\n}"]}
1
+ {"version":3,"file":"discovery-question.schema.js","sourceRoot":"/","sources":["shared/schemas/discovery-question.schema.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AACH,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAIxB,iFAAiF;AAEjF,MAAM,CAAC,MAAM,qBAAqB,GAAG,CAAC,CAAC,IAAI,CAAC,CAAC,OAAO,EAAE,SAAS,EAAE,MAAM,CAAC,CAAC,CAAC;AAG1E,MAAM,CAAC,MAAM,mBAAmB,GAAG,CAAC,CAAC,MAAM,CAAC;IAC1C,MAAM,EAAE,CAAC,CAAC,IAAI,CAAC,CAAC,SAAS,EAAE,QAAQ,EAA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,MAAM,EAAE;IAC9B,YAAY,EAAE,CAAC,CAAC,MAAM,EAAE;IACxB,gBAAgB,EAAE,CAAC,CAAC,MAAM,CAAC,qBAAqB,EAAE,CAAC,CAAC,MAAM,EAAE,CAAC;CAC9D,CAAC,CAAC;AASH,MAAM,CAAC,MAAM,4BAA4B,GAAG,CAAC,CAAC,MAAM,CAAC;IACnD,IAAI,EAAE,CAAC,CAAC,MAAM,EAAE,CAAC,QAAQ,EAAE;IAC3B,GAAG,EAAE,CAAC,CAAC,MAAM,EAAE,CAAC,QAAQ,EAAE;IAC1B,QAAQ,EAAE,CAAC,CAAC,MAAM,EAAE,CAAC,QAAQ,EAAE;IAC/B,MAAM,EAAE,CAAC,CAAC,KAAK,CAAC,CAAC,CAAC,MAAM,EAAE,CAAC,CAAC,QAAQ,EAAE;IACtC,SAAS,EAAE,CAAC,CAAC,KAAK,CAAC,CAAC,CAAC,MAAM,EAAE,CAAC,CAAC,QAAQ,EAAE;CAC1C,CAAC,CAAC","sourcesContent":["/**\n * DiscoveryQuestionInput and nested types.\n * Leaf types have full Zod schemas. The composite DiscoveryQuestionInput is\n * a pure interface referencing cross-schema types (DiscoveryNegotiationDigest,\n * ChatContextDigest) to avoid Zod cross-schema runtime coupling.\n */\nimport { z } from \"zod\";\nimport type { DiscoveryNegotiationDigest } from \"./negotiation-digest.schema.js\";\nimport type { ChatContextDigest } from \"./chat-context.schema.js\";\n\n// ─── Primitives ───────────────────────────────────────────────────────────────\n\nexport const NegotiationRoleSchema = z.enum([\"agent\", \"patient\", \"peer\"]);\nexport type NegotiationRole = z.infer<typeof NegotiationRoleSchema>;\n\nexport const DiscoveryTurnSchema = z.object({\n action: z.enum([\"propose\", \"accept\", \"reject\", \"counter\", \"question\", \"outreach\", \"withdraw\", \"decline\"]),\n reasoning: z.string(),\n suggestedRoles: z.object({\n ownUser: NegotiationRoleSchema,\n otherUser: NegotiationRoleSchema,\n }),\n});\nexport type DiscoveryTurn = z.infer<typeof DiscoveryTurnSchema>;\n\nexport const DiscoveryOutcomeSchema = z.object({\n hasOpportunity: z.boolean(),\n reasoning: z.string(),\n agreedRoles: z.array(z.object({\n userId: z.string(),\n role: NegotiationRoleSchema,\n })).optional(),\n reason: z.enum([\"turn_cap\", \"timeout\"]).optional(),\n});\nexport type DiscoveryOutcome = z.infer<typeof DiscoveryOutcomeSchema>;\n\nexport const DiscoveryNegotiationSchema = z.object({\n counterpartyId: z.string(),\n counterpartyHint: z.string(),\n indexContext: z.string(),\n turns: z.array(DiscoveryTurnSchema),\n outcome: DiscoveryOutcomeSchema,\n seedAssessmentScore: z.number().optional(),\n});\nexport type DiscoveryNegotiation = z.infer<typeof DiscoveryNegotiationSchema>;\n\nexport const DiscoverySummarySchema = z.object({\n totalCandidates: z.number(),\n opportunitiesFound: z.number(),\n noOpportunityCount: z.number(),\n timeoutCount: z.number(),\n roleDistribution: z.record(NegotiationRoleSchema, z.number()),\n});\nexport type DiscoverySummary = {\n totalCandidates: number;\n opportunitiesFound: number;\n noOpportunityCount: number;\n timeoutCount: number;\n roleDistribution: Partial<Record<NegotiationRole, number>>;\n};\n\nexport const DiscoverySourceProfileSchema = z.object({\n name: z.string().optional(),\n bio: z.string().optional(),\n location: z.string().optional(),\n skills: z.array(z.string()).optional(),\n interests: z.array(z.string()).optional(),\n});\nexport type DiscoverySourceProfile = z.infer<typeof DiscoverySourceProfileSchema>;\n\n// ─── Composite input (pure interface — references cross-schema types) ─────────\n\n/**\n * Full input to the question generator.\n * Defined as a pure interface so it can reference DiscoveryNegotiationDigest\n * and ChatContextDigest from sibling schemas without Zod runtime coupling.\n */\nexport interface DiscoveryQuestionInput {\n query: string;\n /** The seeker's global user_context paragraph (profile-replacing identity text). */\n userContext: string;\n negotiationDigests: DiscoveryNegotiationDigest[];\n summary: DiscoverySummary;\n chatContext?: ChatContextDigest;\n now: string;\n}"]}
@@ -4,8 +4,24 @@
4
4
  * LangGraph Annotation.Root stays in the domain file.
5
5
  */
6
6
  import { z } from "zod";
7
+ /**
8
+ * Union of every negotiation turn action across protocol versions.
9
+ *
10
+ * v1 vocabulary: `propose | accept | reject | counter | question`.
11
+ * v2 (client-advocate seat rules) renames `propose`→`outreach` and splits
12
+ * `reject` into `withdraw` (initiator seat) / `decline` (counterparty seat).
13
+ * Which subset is valid for a given turn depends on the task's
14
+ * `protocolVersion` and the acting user's seat — see
15
+ * `negotiation/negotiation.protocol.ts` for the seat-scoped schemas.
16
+ */
17
+ export declare const NEGOTIATION_ACTIONS: readonly ["propose", "accept", "reject", "counter", "question", "outreach", "withdraw", "decline"];
18
+ export type NegotiationAction = (typeof NEGOTIATION_ACTIONS)[number];
19
+ /** Negotiation seat under the v2 client-advocate protocol. */
20
+ export type NegotiationSeat = "initiator" | "counterparty";
21
+ /** Negotiation protocol version stamped on task metadata. */
22
+ export type NegotiationProtocolVersion = "v1" | "v2";
7
23
  export declare const NegotiationTurnSchema: z.ZodObject<{
8
- action: z.ZodEnum<["propose", "accept", "reject", "counter", "question"]>;
24
+ action: z.ZodEnum<["propose", "accept", "reject", "counter", "question", "outreach", "withdraw", "decline"]>;
9
25
  assessment: z.ZodObject<{
10
26
  reasoning: z.ZodString;
11
27
  suggestedRoles: z.ZodObject<{
@@ -33,7 +49,7 @@ export declare const NegotiationTurnSchema: z.ZodObject<{
33
49
  }>;
34
50
  message: z.ZodOptional<z.ZodNullable<z.ZodString>>;
35
51
  }, "strip", z.ZodTypeAny, {
36
- action: "propose" | "accept" | "reject" | "counter" | "question";
52
+ action: "propose" | "accept" | "reject" | "counter" | "question" | "outreach" | "withdraw" | "decline";
37
53
  assessment: {
38
54
  reasoning: string;
39
55
  suggestedRoles: {
@@ -43,7 +59,7 @@ export declare const NegotiationTurnSchema: z.ZodObject<{
43
59
  };
44
60
  message?: string | null | undefined;
45
61
  }, {
46
- action: "propose" | "accept" | "reject" | "counter" | "question";
62
+ action: "propose" | "accept" | "reject" | "counter" | "question" | "outreach" | "withdraw" | "decline";
47
63
  assessment: {
48
64
  reasoning: string;
49
65
  suggestedRoles: {
@@ -1 +1 @@
1
- {"version":3,"file":"negotiation-state.schema.d.ts","sourceRoot":"/","sources":["shared/schemas/negotiation-state.schema.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AACH,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAIxB,eAAO,MAAM,qBAAqB;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;EAUhC,CAAC;AACH,MAAM,MAAM,eAAe,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,qBAAqB,CAAC,CAAC;AAEpE,eAAO,MAAM,wBAAwB;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;EASnC,CAAC;AACH,MAAM,MAAM,kBAAkB,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,wBAAwB,CAAC,CAAC;AAI1E,kDAAkD;AAClD,MAAM,WAAW,sBAAsB;IACrC,EAAE,EAAE,MAAM,CAAC;IACX,OAAO,EAAE,KAAK,CAAC;QAAE,EAAE,EAAE,MAAM,CAAC;QAAC,KAAK,EAAE,MAAM,CAAC;QAAC,WAAW,EAAE,MAAM,CAAC;QAAC,UAAU,EAAE,MAAM,CAAA;KAAE,CAAC,CAAC;IACvF,OAAO,EAAE;QAAE,IAAI,CAAC,EAAE,MAAM,CAAC;QAAC,GAAG,CAAC,EAAE,MAAM,CAAC;QAAC,QAAQ,CAAC,EAAE,MAAM,CAAC;QAAC,SAAS,CAAC,EAAE,MAAM,EAAE,CAAC;QAAC,MAAM,CAAC,EAAE,MAAM,EAAE,CAAA;KAAE,CAAC;CACtG;AAED,qDAAqD;AACrD,MAAM,WAAW,cAAc;IAC7B,SAAS,EAAE,MAAM,CAAC;IAClB,WAAW,EAAE,MAAM,CAAC;IACpB,MAAM,CAAC,EAAE,KAAK,CAAC;QAAE,MAAM,EAAE,MAAM,CAAC;QAAC,IAAI,EAAE,MAAM,CAAA;KAAE,CAAC,CAAC;CAClD"}
1
+ {"version":3,"file":"negotiation-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D;AACrD,MAAM,WAAW,cAAc;IAC7B,SAAS,EAAE,MAAM,CAAC;IAClB,WAAW,EAAE,MAAM,CAAC;IACpB,MAAM,CAAC,EAAE,KAAK,CAAC;QAAE,MAAM,EAAE,MAAM,CAAC;QAAC,IAAI,EAAE,MAAM,CAAA;KAAE,CAAC,CAAC;CAClD"}
@@ -5,8 +5,22 @@
5
5
  */
6
6
  import { z } from "zod";
7
7
  // ─── Zod schemas (available for runtime validation) ───────────────────────────
8
+ /**
9
+ * Union of every negotiation turn action across protocol versions.
10
+ *
11
+ * v1 vocabulary: `propose | accept | reject | counter | question`.
12
+ * v2 (client-advocate seat rules) renames `propose`→`outreach` and splits
13
+ * `reject` into `withdraw` (initiator seat) / `decline` (counterparty seat).
14
+ * Which subset is valid for a given turn depends on the task's
15
+ * `protocolVersion` and the acting user's seat — see
16
+ * `negotiation/negotiation.protocol.ts` for the seat-scoped schemas.
17
+ */
18
+ export const NEGOTIATION_ACTIONS = [
19
+ "propose", "accept", "reject", "counter", "question",
20
+ "outreach", "withdraw", "decline",
21
+ ];
8
22
  export const NegotiationTurnSchema = z.object({
9
- action: z.enum(["propose", "accept", "reject", "counter", "question"]),
23
+ action: z.enum(NEGOTIATION_ACTIONS),
10
24
  assessment: z.object({
11
25
  reasoning: z.string(),
12
26
  suggestedRoles: z.object({
@@ -1 +1 @@
1
- {"version":3,"file":"negotiation-state.schema.js","sourceRoot":"/","sources":["shared/schemas/negotiation-state.schema.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AACH,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAExB,iFAAiF;AAEjF,MAAM,CAAC,MAAM,qBAAqB,GAAG,CAAC,CAAC,MAAM,CAAC;IAC5C,MAAM,EAAE,CAAC,CAAC,IAAI,CAAC,CAAC,SAAS,EAAE,QAAQ,EAAE,QAAQ,EAAE,SAAS,EAAE,UAAU,CAAC,CAAC;IACtE,UAAU,EAAE,CAAC,CAAC,MAAM,CAAC;QACnB,SAAS,EAAE,CAAC,CAAC,MAAM,EAAE;QACrB,cAAc,EAAE,CAAC,CAAC,MAAM,CAAC;YACvB,OAAO,EAAE,CAAC,CAAC,IAAI,CAAC,CAAC,OAAO,EAAE,SAAS,EAAE,MAAM,CAAC,CAAC;YAC7C,SAAS,EAAE,CAAC,CAAC,IAAI,CAAC,CAAC,OAAO,EAAE,SAAS,EAAE,MAAM,CAAC,CAAC;SAChD,CAAC;KACH,CAAC;IACF,OAAO,EAAE,CAAC,CAAC,MAAM,EAAE,CAAC,QAAQ,EAAE,CAAC,QAAQ,EAAE;CAC1C,CAAC,CAAC;AAGH,MAAM,CAAC,MAAM,wBAAwB,GAAG,CAAC,CAAC,MAAM,CAAC;IAC/C,cAAc,EAAE,CAAC,CAAC,OAAO,EAAE;IAC3B,WAAW,EAAE,CAAC,CAAC,KAAK,CAAC,CAAC,CAAC,MAAM,CAAC;QAC5B,MAAM,EAAE,CAAC,CAAC,MAAM,EAAE;QAClB,IAAI,EAAE,CAAC,CAAC,IAAI,CAAC,CAAC,OAAO,EAAE,SAAS,EAAE,MAAM,CAAC,CAAC;KAC3C,CAAC,CAAC;IACH,SAAS,EAAE,CAAC,CAAC,MAAM,EAAE;IACrB,SAAS,EAAE,CAAC,CAAC,MAAM,EAAE;IACrB,MAAM,EAAE,CAAC,CAAC,IAAI,CAAC,CAAC,UAAU,EAAE,SAAS,CAAC,CAAC,CAAC,QAAQ,EAAE;CACnD,CAAC,CAAC","sourcesContent":["/**\n * Negotiation state DTOs extracted from negotiation/negotiation.state.ts for\n * consumption by shared interfaces. This shared module owns the DTO schemas;\n * LangGraph Annotation.Root stays in the domain file.\n */\nimport { z } from \"zod\";\n\n// ─── Zod schemas (available for runtime validation) ───────────────────────────\n\nexport const NegotiationTurnSchema = z.object({\n action: z.enum([\"propose\", \"accept\", \"reject\", \"counter\", \"question\"]),\n assessment: z.object({\n reasoning: z.string(),\n suggestedRoles: z.object({\n ownUser: z.enum([\"agent\", \"patient\", \"peer\"]),\n otherUser: z.enum([\"agent\", \"patient\", \"peer\"]),\n }),\n }),\n message: z.string().nullable().optional(),\n});\nexport type NegotiationTurn = z.infer<typeof NegotiationTurnSchema>;\n\nexport const NegotiationOutcomeSchema = z.object({\n hasOpportunity: z.boolean(),\n agreedRoles: z.array(z.object({\n userId: z.string(),\n role: z.enum([\"agent\", \"patient\", \"peer\"]),\n })),\n reasoning: z.string(),\n turnCount: z.number(),\n reason: z.enum([\"turn_cap\", \"timeout\"]).optional(),\n});\nexport type NegotiationOutcome = z.infer<typeof NegotiationOutcomeSchema>;\n\n// ─── Pure interfaces ──────────────────────────────────────────────────────────\n\n/** Context each agent receives about its user. */\nexport interface UserNegotiationContext {\n id: string;\n intents: Array<{ id: string; title: string; description: string; confidence: number }>;\n profile: { name?: string; bio?: string; location?: string; interests?: string[]; skills?: string[] };\n}\n\n/** Seed assessment from the evaluator pre-filter. */\nexport interface SeedAssessment {\n reasoning: string;\n valencyRole: string;\n actors?: Array<{ userId: string; role: string }>;\n}"]}
1
+ {"version":3,"file":"negotiation-state.schema.js","sourceRoot":"/","sources":["shared/schemas/negotiation-state.schema.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AACH,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAExB,iFAAiF;AAEjF;;;;;;;;;GASG;AACH,MAAM,CAAC,MAAM,mBAAmB,GAAG;IACjC,SAAS,EAAE,QAAQ,EAAE,QAAQ,EAAE,SAAS,EAAE,UAAU;IACpD,UAAU,EAAE,UAAU,EAAE,SAAS;CACzB,CAAC;AASX,MAAM,CAAC,MAAM,qBAAqB,GAAG,CAAC,CAAC,MAAM,CAAC;IAC5C,MAAM,EAAE,CAAC,CAAC,IAAI,CAAC,mBAAmB,CAAC;IACnC,UAAU,EAAE,CAAC,CAAC,MAAM,CAAC;QACnB,SAAS,EAAE,CAAC,CAAC,MAAM,EAAE;QACrB,cAAc,EAAE,CAAC,CAAC,MAAM,CAAC;YACvB,OAAO,EAAE,CAAC,CAAC,IAAI,CAAC,CAAC,OAAO,EAAE,SAAS,EAAE,MAAM,CAAC,CAAC;YAC7C,SAAS,EAAE,CAAC,CAAC,IAAI,CAAC,CAAC,OAAO,EAAE,SAAS,EAAE,MAAM,CAAC,CAAC;SAChD,CAAC;KACH,CAAC;IACF,OAAO,EAAE,CAAC,CAAC,MAAM,EAAE,CAAC,QAAQ,EAAE,CAAC,QAAQ,EAAE;CAC1C,CAAC,CAAC;AAGH,MAAM,CAAC,MAAM,wBAAwB,GAAG,CAAC,CAAC,MAAM,CAAC;IAC/C,cAAc,EAAE,CAAC,CAAC,OAAO,EAAE;IAC3B,WAAW,EAAE,CAAC,CAAC,KAAK,CAAC,CAAC,CAAC,MAAM,CAAC;QAC5B,MAAM,EAAE,CAAC,CAAC,MAAM,EAAE;QAClB,IAAI,EAAE,CAAC,CAAC,IAAI,CAAC,CAAC,OAAO,EAAE,SAAS,EAAE,MAAM,CAAC,CAAC;KAC3C,CAAC,CAAC;IACH,SAAS,EAAE,CAAC,CAAC,MAAM,EAAE;IACrB,SAAS,EAAE,CAAC,CAAC,MAAM,EAAE;IACrB,MAAM,EAAE,CAAC,CAAC,IAAI,CAAC,CAAC,UAAU,EAAE,SAAS,CAAC,CAAC,CAAC,QAAQ,EAAE;CACnD,CAAC,CAAC","sourcesContent":["/**\n * Negotiation state DTOs extracted from negotiation/negotiation.state.ts for\n * consumption by shared interfaces. This shared module owns the DTO schemas;\n * LangGraph Annotation.Root stays in the domain file.\n */\nimport { z } from \"zod\";\n\n// ─── Zod schemas (available for runtime validation) ───────────────────────────\n\n/**\n * Union of every negotiation turn action across protocol versions.\n *\n * v1 vocabulary: `propose | accept | reject | counter | question`.\n * v2 (client-advocate seat rules) renames `propose`→`outreach` and splits\n * `reject` into `withdraw` (initiator seat) / `decline` (counterparty seat).\n * Which subset is valid for a given turn depends on the task's\n * `protocolVersion` and the acting user's seat — see\n * `negotiation/negotiation.protocol.ts` for the seat-scoped schemas.\n */\nexport const NEGOTIATION_ACTIONS = [\n \"propose\", \"accept\", \"reject\", \"counter\", \"question\",\n \"outreach\", \"withdraw\", \"decline\",\n] as const;\nexport type NegotiationAction = (typeof NEGOTIATION_ACTIONS)[number];\n\n/** Negotiation seat under the v2 client-advocate protocol. */\nexport type NegotiationSeat = \"initiator\" | \"counterparty\";\n\n/** Negotiation protocol version stamped on task metadata. */\nexport type NegotiationProtocolVersion = \"v1\" | \"v2\";\n\nexport const NegotiationTurnSchema = z.object({\n action: z.enum(NEGOTIATION_ACTIONS),\n assessment: z.object({\n reasoning: z.string(),\n suggestedRoles: z.object({\n ownUser: z.enum([\"agent\", \"patient\", \"peer\"]),\n otherUser: z.enum([\"agent\", \"patient\", \"peer\"]),\n }),\n }),\n message: z.string().nullable().optional(),\n});\nexport type NegotiationTurn = z.infer<typeof NegotiationTurnSchema>;\n\nexport const NegotiationOutcomeSchema = z.object({\n hasOpportunity: z.boolean(),\n agreedRoles: z.array(z.object({\n userId: z.string(),\n role: z.enum([\"agent\", \"patient\", \"peer\"]),\n })),\n reasoning: z.string(),\n turnCount: z.number(),\n reason: z.enum([\"turn_cap\", \"timeout\"]).optional(),\n});\nexport type NegotiationOutcome = z.infer<typeof NegotiationOutcomeSchema>;\n\n// ─── Pure interfaces ──────────────────────────────────────────────────────────\n\n/** Context each agent receives about its user. */\nexport interface UserNegotiationContext {\n id: string;\n intents: Array<{ id: string; title: string; description: string; confidence: number }>;\n profile: { name?: string; bio?: string; location?: string; interests?: string[]; skills?: string[] };\n}\n\n/** Seed assessment from the evaluator pre-filter. */\nexport interface SeedAssessment {\n reasoning: string;\n valencyRole: string;\n actors?: Array<{ userId: string; role: string }>;\n}"]}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@indexnetwork/protocol",
3
- "version": "4.5.0-rc.332.1",
3
+ "version": "4.5.0-rc.333.1",
4
4
  "type": "module",
5
5
  "main": "./dist/index.js",
6
6
  "types": "./dist/index.d.ts",