@indexnetwork/protocol 66.0.0-rc.651.1 → 66.0.0-rc.653.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.
@@ -632,7 +632,8 @@ export declare class Intents {
632
632
  *
633
633
  * Fold recovery answers into the draft, then apply creation admission. A
634
634
  * ready result authorizes final review; needs_revision returns admission
635
- * feedback and a dynamic recovery form.
635
+ * feedback and a dynamic recovery form. Turn 2, or any call that includes
636
+ * answers, is measured and admitted.
636
637
  * @returns The admitted draft or repairable feedback and recovery fields.
637
638
  * @throws On model failure; the host must expose a retryable failure.
638
639
  *
@@ -60,7 +60,8 @@ export class Intents {
60
60
  *
61
61
  * Fold recovery answers into the draft, then apply creation admission. A
62
62
  * ready result authorizes final review; needs_revision returns admission
63
- * feedback and a dynamic recovery form.
63
+ * feedback and a dynamic recovery form. Turn 2, or any call that includes
64
+ * answers, is measured and admitted.
64
65
  * @returns The admitted draft or repairable feedback and recovery fields.
65
66
  * @throws On model failure; the host must expose a retryable failure.
66
67
  *
@@ -9,6 +9,8 @@ export interface PrepareAnswer {
9
9
  export interface PrepareInput {
10
10
  payload: string;
11
11
  answers?: PrepareAnswer[];
12
+ /** 1 asks again when admission fails. 2, or any supplied answer, admits the draft. */
13
+ turn?: number;
12
14
  }
13
15
  export interface RecoveryFieldOption {
14
16
  label: string;
@@ -58,11 +58,13 @@ export class IntentPreparer {
58
58
  ]);
59
59
  payload = payloadSchema.parse(result).payload;
60
60
  }
61
+ // A second pass, or any call that already brought answers, is admitted. The first pass still asks.
62
+ const secondTurn = (input.turn ?? 1) >= 2 || answers.length > 0;
61
63
  // The form starts with verification: it only needs the draft, so a failed draft doesn't wait for it twice.
62
- const recovery = this.recoveryForm(payload, answers);
63
- recovery.catch(() => { }); // Unused when the draft is ready, or when verification throws first.
64
+ const recovery = secondTurn ? undefined : this.recoveryForm(payload, answers);
65
+ recovery?.catch(() => { }); // Unused when the draft is ready, or when verification throws first.
64
66
  const verdict = await this.verifier.invoke(payload, profileContext);
65
- const failure = admissionFailure(payload, verdict);
67
+ const failure = secondTurn ? undefined : admissionFailure(payload, verdict);
66
68
  if (!failure)
67
69
  return { status: "ready", payload, metadata: semanticMetadata(verdict) };
68
70
  return { status: "needs_revision", payload, feedback: failure.message, recovery: await recovery };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@indexnetwork/protocol",
3
- "version": "66.0.0-rc.651.1",
3
+ "version": "66.0.0-rc.653.1",
4
4
  "type": "module",
5
5
  "main": "./dist/index.js",
6
6
  "types": "./dist/index.d.ts",