@indexnetwork/protocol 4.5.0-rc.339.1 → 4.5.0

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 (37) 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/negotiation/negotiation.graph.d.ts +26 -26
  8. package/dist/negotiation/negotiation.graph.d.ts.map +1 -1
  9. package/dist/negotiation/negotiation.graph.js +42 -21
  10. package/dist/negotiation/negotiation.graph.js.map +1 -1
  11. package/dist/negotiation/negotiation.screen.d.ts +5 -3
  12. package/dist/negotiation/negotiation.screen.d.ts.map +1 -1
  13. package/dist/negotiation/negotiation.screen.js +5 -3
  14. package/dist/negotiation/negotiation.screen.js.map +1 -1
  15. package/dist/negotiation/negotiation.state.d.ts +6 -6
  16. package/dist/negotiation/negotiation.state.js +1 -1
  17. package/dist/negotiation/negotiation.state.js.map +1 -1
  18. package/dist/negotiation/negotiation.summarizer.js +1 -1
  19. package/dist/negotiation/negotiation.summarizer.js.map +1 -1
  20. package/dist/opportunity/negotiation-context.loader.d.ts +5 -0
  21. package/dist/opportunity/negotiation-context.loader.d.ts.map +1 -1
  22. package/dist/opportunity/negotiation-context.loader.js +9 -0
  23. package/dist/opportunity/negotiation-context.loader.js.map +1 -1
  24. package/dist/opportunity/question.prompt.d.ts +1 -1
  25. package/dist/opportunity/question.prompt.d.ts.map +1 -1
  26. package/dist/opportunity/question.prompt.js +2 -0
  27. package/dist/opportunity/question.prompt.js.map +1 -1
  28. package/dist/shared/schemas/discovery-question.schema.d.ts +8 -8
  29. package/dist/shared/schemas/discovery-question.schema.js +1 -1
  30. package/dist/shared/schemas/discovery-question.schema.js.map +1 -1
  31. package/dist/shared/schemas/negotiation-digest.schema.d.ts +3 -3
  32. package/dist/shared/schemas/negotiation-digest.schema.js +1 -1
  33. package/dist/shared/schemas/negotiation-digest.schema.js.map +1 -1
  34. package/dist/shared/schemas/negotiation-state.schema.d.ts +3 -3
  35. package/dist/shared/schemas/negotiation-state.schema.js +1 -1
  36. package/dist/shared/schemas/negotiation-state.schema.js.map +1 -1
  37. package/package.json +1 -1
@@ -121,7 +121,7 @@ export declare const NegotiationOutcomeSchema: z.ZodObject<{
121
121
  }>, "many">;
122
122
  reasoning: z.ZodString;
123
123
  turnCount: z.ZodNumber;
124
- reason: z.ZodOptional<z.ZodEnum<["turn_cap", "timeout"]>>;
124
+ reason: z.ZodOptional<z.ZodEnum<["turn_cap", "timeout", "screened_out"]>>;
125
125
  }, "strip", z.ZodTypeAny, {
126
126
  reasoning: string;
127
127
  turnCount: number;
@@ -130,7 +130,7 @@ export declare const NegotiationOutcomeSchema: z.ZodObject<{
130
130
  role: "agent" | "patient" | "peer";
131
131
  }[];
132
132
  hasOpportunity: boolean;
133
- reason?: "timeout" | "turn_cap" | undefined;
133
+ reason?: "timeout" | "turn_cap" | "screened_out" | undefined;
134
134
  }, {
135
135
  reasoning: string;
136
136
  turnCount: number;
@@ -139,7 +139,7 @@ export declare const NegotiationOutcomeSchema: z.ZodObject<{
139
139
  role: "agent" | "patient" | "peer";
140
140
  }[];
141
141
  hasOpportunity: boolean;
142
- reason?: "timeout" | "turn_cap" | undefined;
142
+ reason?: "timeout" | "turn_cap" | "screened_out" | undefined;
143
143
  }>;
144
144
  export type NegotiationOutcome = z.infer<typeof NegotiationOutcomeSchema>;
145
145
  /** Context each agent receives about its user. */
@@ -52,6 +52,6 @@ export const NegotiationOutcomeSchema = z.object({
52
52
  })),
53
53
  reasoning: z.string(),
54
54
  turnCount: z.number(),
55
- reason: z.enum(["turn_cap", "timeout"]).optional(),
55
+ reason: z.enum(["turn_cap", "timeout", "screened_out"]).optional(),
56
56
  });
57
57
  //# sourceMappingURL=negotiation-state.schema.js.map
@@ -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;;;;;;;;;GASG;AACH,MAAM,CAAC,MAAM,mBAAmB,GAAG;IACjC,SAAS,EAAE,QAAQ,EAAE,QAAQ,EAAE,SAAS,EAAE,UAAU;IACpD,UAAU,EAAE,UAAU,EAAE,SAAS;IACjC,UAAU;CACF,CAAC;AASX;;;;;;GAMG;AACH,MAAM,CAAC,MAAM,oBAAoB,GAAG,CAAC,CAAC,MAAM,CAAC;IAC3C,iBAAiB,EAAE,CAAC,CAAC,MAAM,EAAE;IAC7B,aAAa,EAAE,CAAC,CAAC,MAAM,EAAE,CAAC,QAAQ,EAAE,CAAC,QAAQ,EAAE;CAChD,CAAC,CAAC;AAGH,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;IACzC,oDAAoD;IACpD,OAAO,EAAE,oBAAoB,CAAC,QAAQ,EAAE,CAAC,QAAQ,EAAE;CACpD,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 \"ask_user\",\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\n/**\n * Payload for the v2 `ask_user` action (P3.2): the negotiator pauses the\n * negotiation to consult its OWN client. `disclosureSubject` states what the\n * negotiator wants permission to share or needs to know; `draftQuestion` is\n * the negotiator's own phrasing, refined by the questioner's\n * `negotiation_inflight` preset before delivery.\n */\nexport const AskUserPayloadSchema = z.object({\n disclosureSubject: z.string(),\n draftQuestion: z.string().nullable().optional(),\n});\nexport type AskUserPayload = z.infer<typeof AskUserPayloadSchema>;\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 /** Present when action is `ask_user` (v2, P3.2). */\n askUser: AskUserPayloadSchema.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,E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AAM,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,EAAE,cAAc,CAAC,CAAC,CAAC,QAAQ,EAAE;CACnE,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 \"ask_user\",\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\n/**\n * Payload for the v2 `ask_user` action (P3.2): the negotiator pauses the\n * negotiation to consult its OWN client. `disclosureSubject` states what the\n * negotiator wants permission to share or needs to know; `draftQuestion` is\n * the negotiator's own phrasing, refined by the questioner's\n * `negotiation_inflight` preset before delivery.\n */\nexport const AskUserPayloadSchema = z.object({\n disclosureSubject: z.string(),\n draftQuestion: z.string().nullable().optional(),\n});\nexport type AskUserPayload = z.infer<typeof AskUserPayloadSchema>;\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 /** Present when action is `ask_user` (v2, P3.2). */\n askUser: AskUserPayloadSchema.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\", \"screened_out\"]).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.339.1",
3
+ "version": "4.5.0",
4
4
  "type": "module",
5
5
  "main": "./dist/index.js",
6
6
  "types": "./dist/index.d.ts",