loopengine 0.1.87 → 0.1.88

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.
@@ -15,9 +15,14 @@ export type ReplyDecision = {
15
15
  } | {
16
16
  decision: 'continue';
17
17
  };
18
- export type DecisionRequest = {
18
+ export type DecisionRequest =
19
+ /** `changeShown`: the person was just shown a proposed change to the
20
+ * arguments, waiting for their approval (our own fixed fact, not text
21
+ * anyone else wrote). */
22
+ {
19
23
  kind: 'approval';
20
24
  tool: string;
25
+ changeShown?: boolean;
21
26
  } | {
22
27
  kind: 'question';
23
28
  question: string;
@@ -18,7 +18,7 @@ function recordTool(kind) {
18
18
  }
19
19
  export function decisionPrompt(request) {
20
20
  const about = request.kind === 'approval'
21
- ? `An AI agent is waiting for approval to run the tool \`${request.tool}\`.`
21
+ ? `An AI agent is waiting for approval to run the tool \`${request.tool}\`.${request.changeShown ? ' The person was just shown a proposed change to its arguments, waiting for their approval: a plain yes or ok approves that change.' : ''}`
22
22
  : `An AI agent asked this question and is waiting for the answer: ${JSON.stringify(request.question)}${request.options?.length ? `\nOptions it offered: ${request.options.map((o) => JSON.stringify(o)).join(', ')}` : ''}`;
23
23
  const rules = request.kind === 'approval'
24
24
  ? [
@@ -54,7 +54,7 @@ export async function handleInboundMessage(message, deps) {
54
54
  }
55
55
  const modelCall = deps.createModelCall();
56
56
  const request = link.kind === 'approval'
57
- ? { kind: 'approval', tool: item.tool }
57
+ ? { kind: 'approval', tool: item.tool, changeShown: Boolean(link.proposedArgs) }
58
58
  : {
59
59
  kind: 'question',
60
60
  question: typeof item.args.question === 'string' ? item.args.question : JSON.stringify(item.args),
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "loopengine",
3
- "version": "0.1.87",
3
+ "version": "0.1.88",
4
4
  "type": "module",
5
5
  "description": "Runtime for tool-using AI agents with a transparent ReAct loop.",
6
6
  "license": "MIT",