@indexnetwork/protocol 11.0.2-rc.456.1 → 11.2.0-rc.458.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 (41) hide show
  1. package/CHANGELOG.md +10 -0
  2. package/dist/capabilities/negotiation.facade.d.ts +4 -1
  3. package/dist/capabilities/negotiation.facade.js +2 -1
  4. package/dist/capabilities/negotiation.questions.facade.d.ts +1 -1
  5. package/dist/capabilities/negotiation.questions.facade.js +1 -1
  6. package/dist/index.d.ts +8 -4
  7. package/dist/index.js +5 -1
  8. package/dist/mcp/mcp.authorization-policy.d.ts +10 -4
  9. package/dist/mcp/mcp.authorization-policy.js +64 -5
  10. package/dist/negotiation/application/negotiation.agent.d.ts +7 -1
  11. package/dist/negotiation/application/negotiation.agent.js +6 -4
  12. package/dist/negotiation/application/negotiation.detail-reader.js +3 -6
  13. package/dist/negotiation/application/negotiation.graph.d.ts +17 -29
  14. package/dist/negotiation/application/negotiation.graph.js +35 -49
  15. package/dist/negotiation/application/negotiation.tools.js +40 -43
  16. package/dist/negotiation/domain/index.d.ts +5 -0
  17. package/dist/negotiation/domain/index.js +4 -0
  18. package/dist/negotiation/domain/negotiation.consultation-policy.d.ts +2 -3
  19. package/dist/negotiation/domain/negotiation.expected-speaker.d.ts +19 -0
  20. package/dist/negotiation/domain/negotiation.expected-speaker.js +47 -0
  21. package/dist/negotiation/domain/negotiation.hermes-contract.d.ts +31 -0
  22. package/dist/negotiation/domain/negotiation.hermes-contract.js +72 -0
  23. package/dist/negotiation/domain/negotiation.protocol.d.ts +36 -66
  24. package/dist/negotiation/domain/negotiation.state.d.ts +10 -19
  25. package/dist/negotiation/domain/negotiation.turn-cap.d.ts +9 -0
  26. package/dist/negotiation/domain/negotiation.turn-cap.js +12 -0
  27. package/dist/negotiation/public/index.d.ts +4 -1
  28. package/dist/negotiation/public/index.js +3 -1
  29. package/dist/questions/application/question.input.d.ts +4 -8
  30. package/dist/questions/application/question.input.js +3 -8
  31. package/dist/questions/application/question.presets.js +10 -11
  32. package/dist/shared/agent/model-signal.d.ts +6 -1
  33. package/dist/shared/agent/model-signal.js +5 -2
  34. package/dist/shared/interfaces/agent-dispatcher.interface.d.ts +3 -0
  35. package/dist/shared/interfaces/database.interface.d.ts +1 -1
  36. package/dist/shared/interfaces/negotiation-events.interface.d.ts +12 -2
  37. package/dist/shared/schemas/mcp-auth.schema.d.ts +6 -0
  38. package/dist/shared/schemas/mcp-auth.schema.js +9 -0
  39. package/dist/shared/schemas/negotiation-state.schema.d.ts +17 -23
  40. package/dist/shared/schemas/negotiation-state.schema.js +13 -8
  41. package/package.json +1 -1
@@ -28,6 +28,8 @@ export const McpResolvedIdentitySchema = z.object({
28
28
  isSessionAuth: z.boolean().optional(),
29
29
  enrollmentCapable: z.boolean().optional(),
30
30
  isDeliveryAgent: z.boolean().optional(),
31
+ /** Host-authenticated marker for the dedicated full standalone Hermes audience. */
32
+ isHermesAgent: z.boolean().optional(),
31
33
  networkScopeId: z.string().min(1).nullable().optional(),
32
34
  }).strict().superRefine((identity, ctx) => {
33
35
  if (identity.isSessionAuth === true && identity.agentId) {
@@ -44,4 +46,11 @@ export const McpResolvedIdentitySchema = z.object({
44
46
  message: 'Delivery-agent designation requires an agent ID.',
45
47
  });
46
48
  }
49
+ if (identity.isHermesAgent === true && !identity.agentId) {
50
+ ctx.addIssue({
51
+ code: z.ZodIssueCode.custom,
52
+ path: ['isHermesAgent'],
53
+ message: 'Hermes-agent designation requires an agent ID.',
54
+ });
55
+ }
47
56
  });
@@ -20,22 +20,21 @@ export type NegotiationAction = (typeof NEGOTIATION_ACTIONS)[number];
20
20
  export type NegotiationSeat = "initiator" | "counterparty";
21
21
  /** Negotiation protocol version stamped on task metadata. */
22
22
  export type NegotiationProtocolVersion = "v1" | "v2";
23
+ /** Closed, content-free reasons that select server-owned consultation copy. */
24
+ export declare const NEGOTIATION_CONSULTATION_REASONS: readonly ["unresolved_owner_constraint", "consequential_disclosure_permission", "repeated_non_convergence", "insufficient_commitment_authority"];
25
+ export declare const NegotiationConsultationReasonSchema: z.ZodEnum<["unresolved_owner_constraint", "consequential_disclosure_permission", "repeated_non_convergence", "insufficient_commitment_authority"]>;
26
+ export type NegotiationConsultationReason = z.infer<typeof NegotiationConsultationReasonSchema>;
23
27
  /**
24
- * Payload for the v2 `ask_user` action (P3.2): the negotiator pauses the
25
- * negotiation to consult its OWN client. `disclosureSubject` states what the
26
- * negotiator wants permission to share or needs to know; `draftQuestion` is
27
- * the negotiator's own phrasing, refined by the questioner's
28
- * `negotiation_inflight` preset before delivery.
28
+ * Payload for a v2 `ask_user` action. Agents may choose only a closed reason;
29
+ * disclosure subjects and question wording are always rendered by fixed
30
+ * server templates and can never carry model-authored instructions.
29
31
  */
30
32
  export declare const AskUserPayloadSchema: z.ZodObject<{
31
- disclosureSubject: z.ZodString;
32
- draftQuestion: z.ZodOptional<z.ZodNullable<z.ZodString>>;
33
- }, "strip", z.ZodTypeAny, {
34
- disclosureSubject: string;
35
- draftQuestion?: string | null | undefined;
33
+ reason: z.ZodEnum<["unresolved_owner_constraint", "consequential_disclosure_permission", "repeated_non_convergence", "insufficient_commitment_authority"]>;
34
+ }, "strict", z.ZodTypeAny, {
35
+ reason: "unresolved_owner_constraint" | "consequential_disclosure_permission" | "repeated_non_convergence" | "insufficient_commitment_authority";
36
36
  }, {
37
- disclosureSubject: string;
38
- draftQuestion?: string | null | undefined;
37
+ reason: "unresolved_owner_constraint" | "consequential_disclosure_permission" | "repeated_non_convergence" | "insufficient_commitment_authority";
39
38
  }>;
40
39
  export type AskUserPayload = z.infer<typeof AskUserPayloadSchema>;
41
40
  export declare const NegotiationTurnSchema: z.ZodObject<{
@@ -68,14 +67,11 @@ export declare const NegotiationTurnSchema: z.ZodObject<{
68
67
  message: z.ZodOptional<z.ZodNullable<z.ZodString>>;
69
68
  /** Present when action is `ask_user` (v2, P3.2). */
70
69
  askUser: z.ZodOptional<z.ZodNullable<z.ZodObject<{
71
- disclosureSubject: z.ZodString;
72
- draftQuestion: z.ZodOptional<z.ZodNullable<z.ZodString>>;
73
- }, "strip", z.ZodTypeAny, {
74
- disclosureSubject: string;
75
- draftQuestion?: string | null | undefined;
70
+ reason: z.ZodEnum<["unresolved_owner_constraint", "consequential_disclosure_permission", "repeated_non_convergence", "insufficient_commitment_authority"]>;
71
+ }, "strict", z.ZodTypeAny, {
72
+ reason: "unresolved_owner_constraint" | "consequential_disclosure_permission" | "repeated_non_convergence" | "insufficient_commitment_authority";
76
73
  }, {
77
- disclosureSubject: string;
78
- draftQuestion?: string | null | undefined;
74
+ reason: "unresolved_owner_constraint" | "consequential_disclosure_permission" | "repeated_non_convergence" | "insufficient_commitment_authority";
79
75
  }>>>;
80
76
  }, "strip", z.ZodTypeAny, {
81
77
  action: "propose" | "accept" | "reject" | "counter" | "question" | "outreach" | "withdraw" | "decline" | "ask_user";
@@ -88,8 +84,7 @@ export declare const NegotiationTurnSchema: z.ZodObject<{
88
84
  };
89
85
  message?: string | null | undefined;
90
86
  askUser?: {
91
- disclosureSubject: string;
92
- draftQuestion?: string | null | undefined;
87
+ reason: "unresolved_owner_constraint" | "consequential_disclosure_permission" | "repeated_non_convergence" | "insufficient_commitment_authority";
93
88
  } | null | undefined;
94
89
  }, {
95
90
  action: "propose" | "accept" | "reject" | "counter" | "question" | "outreach" | "withdraw" | "decline" | "ask_user";
@@ -102,8 +97,7 @@ export declare const NegotiationTurnSchema: z.ZodObject<{
102
97
  };
103
98
  message?: string | null | undefined;
104
99
  askUser?: {
105
- disclosureSubject: string;
106
- draftQuestion?: string | null | undefined;
100
+ reason: "unresolved_owner_constraint" | "consequential_disclosure_permission" | "repeated_non_convergence" | "insufficient_commitment_authority";
107
101
  } | null | undefined;
108
102
  }>;
109
103
  export type NegotiationTurn = z.infer<typeof NegotiationTurnSchema>;
@@ -20,17 +20,22 @@ export const NEGOTIATION_ACTIONS = [
20
20
  "outreach", "withdraw", "decline",
21
21
  "ask_user",
22
22
  ];
23
+ /** Closed, content-free reasons that select server-owned consultation copy. */
24
+ export const NEGOTIATION_CONSULTATION_REASONS = [
25
+ "unresolved_owner_constraint",
26
+ "consequential_disclosure_permission",
27
+ "repeated_non_convergence",
28
+ "insufficient_commitment_authority",
29
+ ];
30
+ export const NegotiationConsultationReasonSchema = z.enum(NEGOTIATION_CONSULTATION_REASONS);
23
31
  /**
24
- * Payload for the v2 `ask_user` action (P3.2): the negotiator pauses the
25
- * negotiation to consult its OWN client. `disclosureSubject` states what the
26
- * negotiator wants permission to share or needs to know; `draftQuestion` is
27
- * the negotiator's own phrasing, refined by the questioner's
28
- * `negotiation_inflight` preset before delivery.
32
+ * Payload for a v2 `ask_user` action. Agents may choose only a closed reason;
33
+ * disclosure subjects and question wording are always rendered by fixed
34
+ * server templates and can never carry model-authored instructions.
29
35
  */
30
36
  export const AskUserPayloadSchema = z.object({
31
- disclosureSubject: z.string(),
32
- draftQuestion: z.string().nullable().optional(),
33
- });
37
+ reason: NegotiationConsultationReasonSchema,
38
+ }).strict();
34
39
  export const NegotiationTurnSchema = z.object({
35
40
  action: z.enum(NEGOTIATION_ACTIONS),
36
41
  assessment: z.object({
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@indexnetwork/protocol",
3
- "version": "11.0.2-rc.456.1",
3
+ "version": "11.2.0-rc.458.1",
4
4
  "type": "module",
5
5
  "main": "./dist/index.js",
6
6
  "types": "./dist/index.d.ts",