pi-harness-runtime 1.1.447 → 1.1.450

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 (73) hide show
  1. package/AGENTS.md +82 -9
  2. package/CHANGELOG.md +45 -0
  3. package/README.md +74 -0
  4. package/harness/key-file-audit.ts +252 -42
  5. package/harness/startup-report.ts +32 -7
  6. package/index.ts +142 -22
  7. package/package.json +2 -1
  8. package/packages/agent-policy/package.json +1 -1
  9. package/packages/auth/package.json +1 -1
  10. package/packages/autonomous-runtime/package.json +1 -1
  11. package/packages/checkpoint/package.json +1 -1
  12. package/packages/clipboard/package.json +1 -1
  13. package/packages/codex-watcher/package.json +1 -1
  14. package/packages/config-capture/package.json +1 -1
  15. package/packages/contracts/package.json +1 -1
  16. package/packages/cookie-sanitizer/package.json +1 -1
  17. package/packages/evaluation-engine/package.json +1 -1
  18. package/packages/event-bus/package.json +1 -1
  19. package/packages/event-store/package.json +1 -1
  20. package/packages/experience-replay/package.json +1 -1
  21. package/packages/file-copy-helper/package.json +1 -1
  22. package/packages/intent-analyzer/package.json +1 -1
  23. package/packages/jev-judge/dist/auto-continue.d.ts +39 -1
  24. package/packages/jev-judge/dist/auto-continue.d.ts.map +1 -1
  25. package/packages/jev-judge/dist/auto-continue.js +91 -3
  26. package/packages/jev-judge/dist/auto-continue.js.map +1 -1
  27. package/packages/jev-judge/dist/autonomy-instruction.d.ts +52 -0
  28. package/packages/jev-judge/dist/autonomy-instruction.d.ts.map +1 -0
  29. package/packages/jev-judge/dist/autonomy-instruction.js +92 -0
  30. package/packages/jev-judge/dist/autonomy-instruction.js.map +1 -0
  31. package/packages/jev-judge/dist/index.d.ts +3 -1
  32. package/packages/jev-judge/dist/index.d.ts.map +1 -1
  33. package/packages/jev-judge/dist/index.js +2 -0
  34. package/packages/jev-judge/dist/index.js.map +1 -1
  35. package/packages/jev-judge/dist/question-risk.d.ts +8 -0
  36. package/packages/jev-judge/dist/question-risk.d.ts.map +1 -1
  37. package/packages/jev-judge/dist/question-risk.js +7 -0
  38. package/packages/jev-judge/dist/question-risk.js.map +1 -1
  39. package/packages/jev-judge/package.json +1 -1
  40. package/packages/jev-judge/src/auto-continue.ts +134 -5
  41. package/packages/jev-judge/src/autonomy-instruction.ts +140 -0
  42. package/packages/jev-judge/src/index.ts +16 -1
  43. package/packages/jev-judge/src/question-risk.ts +16 -0
  44. package/packages/knowledge-retrieval/package.json +1 -1
  45. package/packages/learning-engine/package.json +1 -1
  46. package/packages/logging/package.json +1 -1
  47. package/packages/memory-engine/package.json +1 -1
  48. package/packages/notification/dist/pending-question.d.ts +114 -3
  49. package/packages/notification/dist/pending-question.d.ts.map +1 -1
  50. package/packages/notification/dist/pending-question.js +277 -12
  51. package/packages/notification/dist/pending-question.js.map +1 -1
  52. package/packages/notification/package.json +1 -1
  53. package/packages/notification/src/pending-question.ts +389 -11
  54. package/packages/paperclip-integration/package.json +1 -1
  55. package/packages/performance-optimizer/package.json +1 -1
  56. package/packages/privilege-broker/package.json +1 -1
  57. package/packages/prompt-compiler/package.json +1 -1
  58. package/packages/providers/package.json +1 -1
  59. package/packages/qdrant-skills/package.json +1 -1
  60. package/packages/quota-manager/package.json +1 -1
  61. package/packages/relay/package.json +1 -1
  62. package/packages/skill-mcp-client/package.json +1 -1
  63. package/packages/skills/package.json +1 -1
  64. package/packages/todo-bd-sync/package.json +1 -1
  65. package/packages/token-estimation/package.json +1 -1
  66. package/packages/tooling-preference/package.json +1 -1
  67. package/packages/trajectory/package.json +1 -1
  68. package/packages/tui/package.json +1 -1
  69. package/packages/two-phase-review/package.json +1 -1
  70. package/packages/types/package.json +1 -1
  71. package/packages/webmcp-tester/package.json +1 -1
  72. package/packages/wiki/package.json +1 -1
  73. package/packages/write-review/package.json +1 -1
@@ -9,7 +9,7 @@
9
9
  */
10
10
 
11
11
  import { JevJudge } from "./index.js";
12
- import type { JevJudgeConfig, JevEvaluationResult } from "./types.js";
12
+ import type { JevJudgeConfig, JevEvaluationResult, JevQuestions } from "./types.js";
13
13
  import { logError } from "./file-logger.js";
14
14
 
15
15
  /**
@@ -39,6 +39,16 @@ export type DecisionOutcome =
39
39
  | "wait"
40
40
  | "proceed_with_caution";
41
41
 
42
+ /**
43
+ * The scope of an autonomous decision.
44
+ *
45
+ * A large or expensive job is not done in one step: the decision may limit
46
+ * itself to a canary that is verified before the work scales up. The type
47
+ * mirrors the one of the notification package - the scope travels from the
48
+ * decision to the pending question.
49
+ */
50
+ export type DecisionScope = "full_scope" | "canary_first" | "none";
51
+
42
52
  /**
43
53
  * The pending question Jev has to decide about.
44
54
  *
@@ -51,7 +61,13 @@ export interface PendingQuestionContext {
51
61
  /** The complete question text. */
52
62
  text: string;
53
63
  /** The detected kind of the question. */
54
- kind: "routine" | "approval" | "clarification" | "explicit";
64
+ kind: "routine" | "approval" | "choice" | "clarification" | "explicit";
65
+ /** The typed ask of the question. */
66
+ askType?: "approval" | "choice" | "clarification" | "explicit_authorization" | "routine";
67
+ /** The concrete alternatives of a choice question. */
68
+ alternatives?: string[];
69
+ /** The complete assistant message the question was detected in. */
70
+ contextText?: string;
55
71
  /** The exact action the agent proposes. */
56
72
  proposedAction?: string;
57
73
  /** What happens when the question is approved. */
@@ -122,6 +138,10 @@ export interface DecisionPolicyOptions {
122
138
  cautionThreshold?: number;
123
139
  /** The confidence of the proposed outcome. */
124
140
  confidence?: number;
141
+ /** The option the evaluation selected for a choice question. */
142
+ selectedOption?: string;
143
+ /** The scope the evaluation selected. */
144
+ scope?: DecisionScope;
125
145
  }
126
146
 
127
147
  /** The confidence an autonomous approval needs by default. */
@@ -144,6 +164,31 @@ export function isDecisionOutcome(value: unknown): value is DecisionOutcome {
144
164
  );
145
165
  }
146
166
 
167
+ /**
168
+ * Is the value a known scope?
169
+ *
170
+ * An unknown scope is ignored instead of being guessed: a decision without
171
+ * a scope keeps the default scope of the outcome.
172
+ */
173
+ export function isDecisionScope(value: unknown): value is DecisionScope {
174
+ return (
175
+ value === "full_scope" || value === "canary_first" || value === "none"
176
+ );
177
+ }
178
+
179
+ /**
180
+ * The index of the alternative a criterion name stands for.
181
+ *
182
+ * The criteria of the choice question are named "option_1", "option_2", ...
183
+ * so the picked name maps back to the alternative the agent offered. An
184
+ * unknown name (for example "none_of_these") has no alternative.
185
+ */
186
+ export function optionIndex(name: string): number {
187
+ const match = /^option_(\d+)$/.exec(name);
188
+ if (!match) return -1;
189
+ return Number.parseInt(match[1], 10) - 1;
190
+ }
191
+
147
192
  /**
148
193
  * Combine the threshold outcome with the structured outcome of the
149
194
  * evaluation.
@@ -198,6 +243,28 @@ export function applyDecisionPolicy(
198
243
  };
199
244
  }
200
245
 
246
+ // A choice is decidable, but only with a concrete answer: the decision
247
+ // has to name the option it picked, otherwise the agent would receive
248
+ // a "continue" that says nothing about the question it asked.
249
+ if (question?.kind === "choice") {
250
+ if (!options?.selectedOption) {
251
+ return {
252
+ outcome: "wait",
253
+ appliedRule: "choice-without-selected-option",
254
+ reason:
255
+ "The decision did not name the option it picked, so the question stays open.",
256
+ };
257
+ }
258
+
259
+ if (options.scope === "none") {
260
+ return {
261
+ outcome: "wait",
262
+ appliedRule: "choice-scope-none",
263
+ reason: "The decision chose no scope, so the question stays open.",
264
+ };
265
+ }
266
+ }
267
+
201
268
  if (question?.requiresExplicitAuthorization) {
202
269
  return {
203
270
  outcome: "wait",
@@ -300,6 +367,10 @@ export interface AutoContinueDecision {
300
367
  waitRecommendation?: number; // minutes to wait if action is "wait"
301
368
  /** The policy rule that changed the outcome, when one did. */
302
369
  policyApplied?: string;
370
+ /** The option the evaluation selected for a choice question. */
371
+ selectedOption?: string;
372
+ /** The scope the evaluation selected. */
373
+ scope?: DecisionScope;
303
374
  }
304
375
 
305
376
  /**
@@ -354,7 +425,7 @@ export class AutoContinueJudge {
354
425
  const state = this.buildState(taskState);
355
426
 
356
427
  try {
357
- const result = await this.jev.evaluate(state, {
428
+ const questions: JevQuestions<string> = {
358
429
  outcome: {
359
430
  type: "choice",
360
431
  instructions:
@@ -427,7 +498,40 @@ export class AutoContinueJudge {
427
498
  "5 - very complex, unknown territory",
428
499
  ],
429
500
  },
430
- });
501
+ };
502
+
503
+ // A choice is only decidable with the alternatives in front of the
504
+ // evaluation: the decision has to pick one of them, and it has to
505
+ // say how far the work goes with it.
506
+ const alternatives = (
507
+ taskState.context?.question?.alternatives ?? []
508
+ ).slice(0, MAX_LISTED_TASKS);
509
+ if (alternatives.length >= 2) {
510
+ const criteria: Record<string, string> = {};
511
+ alternatives.forEach((alternative, index) => {
512
+ criteria[`option_${index + 1}`] = alternative;
513
+ });
514
+ criteria["none_of_these"] = "none of the alternatives is the right one";
515
+ questions.selectedOption = {
516
+ type: "choice",
517
+ instructions:
518
+ "Which alternative does the agent implement? Pick exactly one of the named alternatives, or none of them.",
519
+ criteria,
520
+ };
521
+ questions.scope = {
522
+ type: "choice",
523
+ instructions: "How far does the work go with the selected alternative?",
524
+ options: ["full_scope", "canary_first", "none"],
525
+ optionDescriptions: {
526
+ full_scope: "the whole selected alternative is done in one go",
527
+ canary_first:
528
+ "a small canary (for example 100 records) is validated first, and the work only scales up after the canary is verified",
529
+ none: "nothing is done, the decision only names the preferred alternative",
530
+ },
531
+ };
532
+ }
533
+
534
+ const result = await this.jev.evaluate(state, questions);
431
535
 
432
536
  return this.applyPolicy(this.buildDecision(result, taskState), taskState);
433
537
  } catch (error) {
@@ -450,6 +554,8 @@ export class AutoContinueJudge {
450
554
  confidenceThreshold: this.config.proceedThreshold,
451
555
  cautionThreshold: this.config.cautionThreshold,
452
556
  confidence: decision.probability,
557
+ selectedOption: decision.selectedOption,
558
+ scope: decision.scope,
453
559
  });
454
560
 
455
561
  decision.outcome = policy.outcome;
@@ -506,7 +612,7 @@ export class AutoContinueJudge {
506
612
  */
507
613
  private buildDecision(
508
614
  result: JevEvaluationResult,
509
- _taskState: TaskState
615
+ taskState: TaskState
510
616
  ): AutoContinueDecision {
511
617
  const shouldProceed = result.decisions.shouldProceed;
512
618
  const probability = shouldProceed.probability ?? 0.5;
@@ -536,6 +642,20 @@ export class AutoContinueJudge {
536
642
  ? outcomeChoice
537
643
  : undefined;
538
644
 
645
+ // The option the evaluation picked for a choice question. The name of
646
+ // the criterion is mapped back to the alternative the agent offered.
647
+ const alternatives = taskState.context?.question?.alternatives ?? [];
648
+ const selectedName = (
649
+ result.decisions.selectedOption?.response as { choice?: string } | undefined
650
+ )?.choice;
651
+ const selectedOption = selectedName
652
+ ? alternatives[optionIndex(selectedName)]
653
+ : undefined;
654
+ const scopeChoice = (
655
+ result.decisions.scope?.response as { choice?: string } | undefined
656
+ )?.choice;
657
+ const scope = isDecisionScope(scopeChoice) ? scopeChoice : undefined;
658
+
539
659
  // Determine action based on thresholds
540
660
  let action: AutoContinueDecision["action"];
541
661
  let confidence: AutoContinueDecision["confidence"];
@@ -603,6 +723,8 @@ export class AutoContinueJudge {
603
723
  estimatedImpact,
604
724
  confidence,
605
725
  waitRecommendation,
726
+ selectedOption,
727
+ scope,
606
728
  };
607
729
  }
608
730
 
@@ -704,7 +826,14 @@ export function buildDecisionState(taskState: TaskState): Record<string, unknown
704
826
  ? {
705
827
  request_id: question.requestId,
706
828
  kind: question.kind,
829
+ ask_type: question.askType ?? "unknown",
707
830
  text: question.text.slice(0, MAX_QUESTION_CHARS),
831
+ // The alternatives of a choice question: without them the
832
+ // decision cannot pick one.
833
+ alternatives: (question.alternatives ?? []).slice(0, MAX_LISTED_TASKS),
834
+ // The surrounding message: the question sentence often leaves
835
+ // out what the agent is really waiting for.
836
+ context_excerpt: (question.contextText ?? "").slice(0, MAX_QUESTION_CHARS),
708
837
  proposed_action: question.proposedAction ?? "unknown",
709
838
  consequence_of_approval: question.consequence ?? "unknown",
710
839
  // The risk facts are unknown when they were not determined: an
@@ -0,0 +1,140 @@
1
+ /**
2
+ * The harness-authored instruction of an autonomous decision.
3
+ *
4
+ * The agent asked a concrete question and nobody answered. A decision that
5
+ * only says "continue with the remaining tasks" does not answer that
6
+ * question: the agent still does not know which option was taken. The
7
+ * instruction therefore names the selected option, the scope and the
8
+ * reasoning of the decision.
9
+ *
10
+ * Two rules are absolute:
11
+ *
12
+ * 1. The instruction never impersonates the user. It is labelled as the
13
+ * decision of Jev, and it says that a reply of the user still wins.
14
+ * 2. The instruction is bounded by the deterministic policy. Only the
15
+ * outcome that the policy allowed reaches the agent.
16
+ */
17
+
18
+ import type { DecisionOutcome } from "./auto-continue.js";
19
+
20
+ /** The scope of an autonomous decision. */
21
+ export type { DecisionScope } from "./auto-continue.js";
22
+
23
+ /**
24
+ * The label of the instruction.
25
+ *
26
+ * It is the first thing the agent reads, so the origin of the decision is
27
+ * never in doubt.
28
+ */
29
+ export const AUTONOMY_INSTRUCTION_HEADER = "[Jev decision - not the user]";
30
+
31
+ export interface AutonomyInstructionInput {
32
+ /** The outcome the policy allowed. */
33
+ outcome: DecisionOutcome;
34
+ /** The question the agent asked. */
35
+ questionText?: string;
36
+ /** The option the decision selected. */
37
+ selectedOption?: string;
38
+ /** The scope the decision selected. */
39
+ scope?: "full_scope" | "canary_first" | "none";
40
+ /** The reasoning of the decision. */
41
+ reasoning?: string;
42
+ /** The risk level of the decision. */
43
+ riskLevel?: string;
44
+ /** How long the question waited. */
45
+ waitedMinutes?: number;
46
+ /** The deadline of the decision. */
47
+ deadlineMinutes?: number;
48
+ }
49
+
50
+ /** The label of an outcome. */
51
+ function outcomeLabel(outcome: DecisionOutcome): string {
52
+ const labels: Record<DecisionOutcome, string> = {
53
+ approve: "approved autonomously",
54
+ proceed_with_caution: "approved autonomously with caution",
55
+ reject: "rejected autonomously",
56
+ wait: "kept waiting",
57
+ };
58
+ return labels[outcome];
59
+ }
60
+
61
+ /** The constraint that belongs to the outcome. */
62
+ function outcomeConstraint(outcome: DecisionOutcome): string {
63
+ const constraints: Record<DecisionOutcome, string> = {
64
+ approve: "Continue with the remaining tasks under this decision.",
65
+ proceed_with_caution:
66
+ "Continue with the remaining tasks under this decision and report every significant step.",
67
+ reject: "Do not carry out the proposed action.",
68
+ wait: "Keep the question open.",
69
+ };
70
+ return constraints[outcome];
71
+ }
72
+
73
+ /** The constraint that belongs to the scope. */
74
+ function scopeConstraint(
75
+ scope: AutonomyInstructionInput["scope"],
76
+ ): string | undefined {
77
+ const constraints: Record<
78
+ NonNullable<AutonomyInstructionInput["scope"]>,
79
+ string
80
+ > = {
81
+ canary_first:
82
+ "Scope: canary_first - validate the decision on a small canary (for example 100 records), verify the result, and report before the work scales up.",
83
+ full_scope: "Scope: full_scope - the whole selected alternative.",
84
+ none: "Scope: none - nothing is executed, the decision only names the preferred alternative.",
85
+ };
86
+ if (!scope) return undefined;
87
+ return constraints[scope];
88
+ }
89
+
90
+ /**
91
+ * Build the instruction the agent receives after the timeout.
92
+ *
93
+ * The instruction names the decision, the selected option, the scope and
94
+ * the reasoning, and it never claims that the user answered.
95
+ */
96
+ export function buildAutonomyInstruction(
97
+ input: AutonomyInstructionInput,
98
+ ): string {
99
+ const waited =
100
+ typeof input.waitedMinutes === "number"
101
+ ? ` after ${Math.round(input.waitedMinutes)} minute(s) of waiting`
102
+ : "";
103
+ const deadline =
104
+ typeof input.deadlineMinutes === "number"
105
+ ? ` (decision deadline: ${input.deadlineMinutes} minute(s))`
106
+ : "";
107
+
108
+ const lines: string[] = [
109
+ `${AUTONOMY_INSTRUCTION_HEADER} The user did not answer${waited}, so Jev decided on its own${deadline}.`,
110
+ `Decision: ${outcomeLabel(input.outcome)}.`,
111
+ ];
112
+
113
+ if (input.questionText) {
114
+ lines.push(`Question: ${input.questionText}`);
115
+ }
116
+
117
+ if (input.selectedOption) {
118
+ lines.push(`Selected option: ${input.selectedOption}`);
119
+ }
120
+
121
+ const scopeLine = scopeConstraint(input.scope);
122
+ if (scopeLine) {
123
+ lines.push(scopeLine);
124
+ }
125
+
126
+ if (input.reasoning) {
127
+ lines.push(`Reasoning: ${input.reasoning}`);
128
+ }
129
+
130
+ if (input.riskLevel) {
131
+ lines.push(`Risk level: ${input.riskLevel}`);
132
+ }
133
+
134
+ lines.push(outcomeConstraint(input.outcome));
135
+ lines.push(
136
+ "This is Jev's decision, not an answer of the user. A reply of the user always wins.",
137
+ );
138
+
139
+ return lines.join("\n");
140
+ }
@@ -696,7 +696,22 @@ export { E2EJudge } from "./e2e-judge.js";
696
696
  export { FlakyDetector } from "./flaky-detector.js";
697
697
  export { DecisionEngine } from "./decision-engine.js";
698
698
  export { AutoContinueJudge, createTaskState } from "./auto-continue.js";
699
- export type { TaskState, AutoContinueDecision, AutoContinueConfig } from "./auto-continue.js";
699
+ export type {
700
+ TaskState,
701
+ AutoContinueDecision,
702
+ AutoContinueConfig,
703
+ DecisionScope,
704
+ DecisionOutcome,
705
+ DecisionContext,
706
+ PendingQuestionContext,
707
+ } from "./auto-continue.js";
708
+
709
+ // Export the instruction an autonomous decision sends to the agent
710
+ export {
711
+ buildAutonomyInstruction,
712
+ AUTONOMY_INSTRUCTION_HEADER,
713
+ } from "./autonomy-instruction.js";
714
+ export type { AutonomyInstructionInput } from "./autonomy-instruction.js";
700
715
 
701
716
  // Export the deterministic risk classifier of a pending question
702
717
  export { classifyQuestionRisk } from "./question-risk.js";
@@ -36,6 +36,14 @@ export interface QuestionRiskFacts {
36
36
  export interface QuestionRiskInput {
37
37
  /** The kind of the question ("routine", "approval", ...). */
38
38
  kind?: QuestionKindLike;
39
+ /**
40
+ * The typed ask of the question ("approval", "choice",
41
+ * "clarification", "explicit_authorization", "routine").
42
+ *
43
+ * An explicit authorization is a request that the message reserves for
44
+ * the human, so it never becomes an autonomous decision.
45
+ */
46
+ askType?: string;
39
47
  /** The complete question text. */
40
48
  text?: string;
41
49
  }
@@ -127,6 +135,14 @@ export function classifyQuestionRisk(
127
135
  // stays auto-approvable unless the wording names a risky action.
128
136
  let requiresExplicitAuthorization = kind === "explicit";
129
137
 
138
+ // A typed ask that reserves the decision for the human blocks it too.
139
+ // The typed ask is derived from the whole message, so the requirement
140
+ // the agent states itself is not lost.
141
+ if (input.askType === "explicit_authorization") {
142
+ requiresExplicitAuthorization = true;
143
+ signals.push("explicit-authorization");
144
+ }
145
+
130
146
  // A destructive action never gets an autonomous approval.
131
147
  if (destructive) {
132
148
  requiresExplicitAuthorization = true;
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@pi-harness/knowledge-retrieval",
3
- "version": "1.1.447",
3
+ "version": "1.1.450",
4
4
  "description": "Knowledge retrieval via TencentDB-Agent-Memory MCP (RFC-0105)",
5
5
  "type": "module",
6
6
  "main": "./dist/index.js",
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@pi-harness/learning-engine",
3
- "version": "1.1.447",
3
+ "version": "1.1.450",
4
4
  "description": "Learning engine for extracting lessons from runtime execution (RFC-0058)",
5
5
  "type": "module",
6
6
  "main": "./dist/index.js",
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@pi-harness/logging",
3
- "version": "1.1.447",
3
+ "version": "1.1.450",
4
4
  "type": "module",
5
5
  "description": "Centralized structured application logging with buffered Cloudflare R2 and webhook transports",
6
6
  "main": "./dist/index.js",
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@pi-harness/memory-engine",
3
- "version": "1.1.447",
3
+ "version": "1.1.450",
4
4
  "description": "Memory engine with OKF integration for durable knowledge management (RFC-0060)",
5
5
  "type": "module",
6
6
  "main": "./dist/index.js",
@@ -7,7 +7,21 @@
7
7
  /**
8
8
  * Question kinds
9
9
  */
10
- export type QuestionKind = "routine" | "approval" | "clarification" | "explicit";
10
+ export type QuestionKind = "routine" | "approval" | "choice" | "clarification" | "explicit";
11
+ /**
12
+ * The typed ask of a detected question.
13
+ *
14
+ * An ask is not the same thing as a question: a question is a sentence, an
15
+ * ask is what the agent wants. The distinction matters after the timeout:
16
+ * an ask of type "choice" can be decided autonomously (the decision names
17
+ * the chosen option), while an ask of type "clarification" or
18
+ * "explicit_authorization" waits for a human.
19
+ *
20
+ * A question the detector cannot interpret is NOT a routine ask: an
21
+ * unrecognized question is a clarification, because the harness does not
22
+ * know what the agent is waiting for and must not guess.
23
+ */
24
+ export type AskType = "approval" | "choice" | "clarification" | "explicit_authorization" | "routine";
11
25
  /**
12
26
  * Question states
13
27
  */
@@ -47,6 +61,18 @@ export interface PendingQuestion {
47
61
  questionText: string;
48
62
  /** Question kind */
49
63
  kind: QuestionKind;
64
+ /** The typed ask of the question. */
65
+ askType?: AskType;
66
+ /** The concrete alternatives of a choice question. */
67
+ alternatives?: string[];
68
+ /** The complete assistant message the question was detected in. */
69
+ contextText?: string;
70
+ /** The option Jev selected for a choice question. */
71
+ selectedOption?: string;
72
+ /** The scope Jev chose for the selected option. */
73
+ scope?: DecisionScope;
74
+ /** The safe reason code of the last state transition. */
75
+ closedReason?: string;
50
76
  /** Does the proposed action need an explicit human authorization? */
51
77
  requiresExplicitAuthorization?: boolean;
52
78
  /** Can the proposed action destroy or damage something? */
@@ -95,7 +121,62 @@ export interface DetectionResult {
95
121
  questionText?: string;
96
122
  kind?: QuestionKind;
97
123
  isRoutine?: boolean;
124
+ /** The typed ask of the detected question. */
125
+ askType?: AskType;
126
+ /** The concrete alternatives of a choice question. */
127
+ alternatives?: string[];
128
+ /** The complete assistant message the question was detected in. */
129
+ contextText?: string;
98
130
  }
131
+ /**
132
+ * The scope of an autonomous decision.
133
+ *
134
+ * A large or expensive job is not done in one step: the decision may
135
+ * limit itself to a canary that is verified before the work scales up.
136
+ */
137
+ export type DecisionScope = "full_scope" | "canary_first" | "none";
138
+ /**
139
+ * The structured resolution of an autonomous decision.
140
+ *
141
+ * It is the answer to the question the agent asked: the selected option,
142
+ * the scope and the reasoning. It is never a human answer.
143
+ */
144
+ export interface JevResolution {
145
+ /** The option Jev selected for a choice question. */
146
+ selectedOption?: string;
147
+ /** The scope Jev chose. */
148
+ scope?: DecisionScope;
149
+ /** The reasoning of the decision. */
150
+ reasoning?: string;
151
+ }
152
+ /**
153
+ * Does the message ask for an explicit human authorization?
154
+ *
155
+ * An ask of this kind is never decided autonomously: only the human may
156
+ * authorize it.
157
+ */
158
+ export declare function hasExplicitAuthorizationWording(text: string): boolean;
159
+ /**
160
+ * The typed ask of a question kind.
161
+ */
162
+ export declare function askTypeForKind(kind: QuestionKind): AskType;
163
+ /**
164
+ * The typed ask of a detected question.
165
+ *
166
+ * A choice keeps its type: the agent offers concrete alternatives, and a
167
+ * decision may pick one of them. Every other ask that the message
168
+ * explicitly reserves for the human is an explicit authorization.
169
+ */
170
+ export declare function computeAskType(kind: QuestionKind, explicitAuthorization: boolean): AskType;
171
+ /**
172
+ * Extract the alternatives of a choice question.
173
+ *
174
+ * The result is what the decision has to choose between, so it must be
175
+ * concrete: "the current staging state is intended" is an alternative,
176
+ * "is the current staging state intended?" is not. An empty or unusable
177
+ * half means the question is not a choice after all.
178
+ */
179
+ export declare function extractAlternatives(question: string): string[];
99
180
  /**
100
181
  * Jev evaluation result
101
182
  */
@@ -132,11 +213,19 @@ export declare class PendingQuestionController {
132
213
  private generateRequestId;
133
214
  /**
134
215
  * Detect if text contains a question requiring response
216
+ *
217
+ * The complete assistant message is kept as the context of the question:
218
+ * the sentence that carries the question often leaves out what the agent
219
+ * is really waiting for ("I need your OK before ..."). The risk facts and
220
+ * the decision are derived from the whole message, not from the sentence
221
+ * alone.
135
222
  */
136
- detectQuestion(text: string, _options?: {
223
+ detectQuestion(text: string, options?: {
137
224
  sessionId?: string;
138
225
  workspacePath?: string;
139
226
  jobId?: string;
227
+ /** The complete assistant message the question was detected in. */
228
+ contextText?: string;
140
229
  }): DetectionResult;
141
230
  /**
142
231
  * Check for approval patterns in text without question mark
@@ -164,6 +253,12 @@ export declare class PendingQuestionController {
164
253
  workspacePath: string;
165
254
  jobId?: string;
166
255
  kind: QuestionKind;
256
+ /** The typed ask of the question. */
257
+ askType?: AskType;
258
+ /** The concrete alternatives of a choice question. */
259
+ alternatives?: string[];
260
+ /** The complete assistant message the question was detected in. */
261
+ contextText?: string;
167
262
  /** The deterministic risk facts of the proposed action. */
168
263
  risk?: {
169
264
  requiresExplicitAuthorization?: boolean;
@@ -208,7 +303,23 @@ export declare class PendingQuestionController {
208
303
  * @returns true if the question was closed, false when it was stale or
209
304
  * already answered by a human.
210
305
  */
211
- resolveByJev(requestId: string, outcome: JevOutcome, reason?: string): boolean;
306
+ resolveByJev(requestId: string, outcome: JevOutcome, reason?: string, resolution?: JevResolution): boolean;
307
+ /**
308
+ * Expire the pending question when the decision deadline is reached.
309
+ *
310
+ * The deadline is a terminal path: the question is closed with the safe
311
+ * reason code, the buttons of that request become stale, and the wait
312
+ * state is cleared. A question that is left open here looks like a
313
+ * request that is still waiting - forever.
314
+ *
315
+ * @returns true if the question was expired, false when it was already
316
+ * answered by a human or closed by a decision.
317
+ */
318
+ expireByTimeout(requestId: string, reason?: string): boolean;
319
+ /**
320
+ * The state of the current question.
321
+ */
322
+ getState(): QuestionState | undefined;
212
323
  /**
213
324
  * Apply an approval action from a channel to the current question.
214
325
  *
@@ -1 +1 @@
1
- {"version":3,"file":"pending-question.d.ts","sourceRoot":"","sources":["../src/pending-question.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AAIH;;GAEG;AACH,MAAM,MAAM,YAAY,GACpB,SAAS,GACT,UAAU,GACV,eAAe,GACf,UAAU,CAAC;AAEf;;GAEG;AACH,MAAM,MAAM,aAAa,GACrB,SAAS,GACT,YAAY,GACZ,UAAU,GACV,WAAW,GACX,SAAS,CAAC;AAEd;;;;;GAKG;AACH,MAAM,MAAM,UAAU,GAClB,SAAS,GACT,QAAQ,GACR,MAAM,GACN,sBAAsB,CAAC;AAE3B,iCAAiC;AACjC,MAAM,MAAM,gBAAgB,GAAG,MAAM,GAAG,KAAK,GAAG,SAAS,CAAC;AAE1D,4CAA4C;AAC5C,MAAM,MAAM,iBAAiB,GAAG,UAAU,GAAG,MAAM,GAAG,IAAI,CAAC;AAE3D;;GAEG;AACH,MAAM,WAAW,oBAAoB;IACnC,SAAS,EAAE,OAAO,CAAC;IACnB,WAAW,CAAC,EAAE,IAAI,CAAC;IACnB,KAAK,CAAC,EAAE,MAAM,CAAC;CAChB;AAED;;GA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,SAAS,EAAE,MAAM,EACjB,OAAO,EAAE,UAAU,EACnB,MAAM,CAAC,EAAE,MAAM,GACd,OAAO,CAqCT;IAED;;;;;;OAMG;IACH,aAAa,CACX,MAAM,EAAE,MAAM,EACd,SAAS,EAAE,MAAM,EACjB,OAAO,EAAE,iBAAiB,GACzB;QAAE,OAAO,EAAE,OAAO,CAAC;QAAC,UAAU,CAAC,EAAE,KAAK,GAAG,IAAI,CAAC;QAAC,MAAM,CAAC,EAAE,MAAM,CAAA;KAAE,CAWlE;IAED;;;;;OAKG;IACH,YAAY,CAAC,SAAS,EAAE,MAAM,GAAG,OAAO,CAMvC;IAED;;OAEG;IACH,MAAM,CAAC,MAAM,GAAE,MAAoB,GAAG,IAAI,CAOzC;IAED;;OAEG;IACH,eAAe,IAAI,IAAI,CAUtB;IAED;;OAEG;IACH,WAAW,CAAC,SAAS,EAAE,MAAM,GAAG,eAAe,GAAG,SAAS,CAE1D;IAED;;OAEG;IACH,eAAe,IAAI,eAAe,EAAE,CAEnC;IAED;;OAEG;IACH,OAAO,CAAC,QAAQ,GAAE,MAAuB,GAAG,IAAI,CAO/C;IAED;;OAEG;IACH,UAAU,IAAI,OAAO,CAEpB;IAED;;OAEG;IACH,aAAa,IAAI,eAAe,CAAC,YAAY,CAAC,GAAG,SAAS,CAEzD;IAED;;OAEG;IACH,wBAAwB,IAAI,OAAO,CAElC;CACF;AAKD,wBAAgB,4BAA4B,IAAI,yBAAyB,CAKxE;AAED,wBAAgB,+BAA+B,CAAC,MAAM,CAAC,EAAE;IACvD,iBAAiB,CAAC,EAAE,MAAM,CAAC;IAC3B,UAAU,CAAC,EAAE,OAAO,CAAC;CACtB,GAAG,yBAAyB,CAG5B"}
1
+ {"version":3,"file":"pending-question.d.ts","sourceRoot":"","sources":["../src/pending-question.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AAIH;;GAEG;AACH,MAAM,MAAM,YAAY,GACpB,SAAS,GACT,UAAU,GACV,QAAQ,GACR,eAAe,GACf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