@arnilo/prism-coding-agent 0.3.1 → 0.3.2

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.
package/CHANGELOG.md CHANGED
@@ -1,5 +1,16 @@
1
1
  # Changelog
2
2
 
3
+ ## [0.3.2] - 2026-08-29 (plan 050)
4
+
5
+ ### Fixed
6
+ - **BUG-1 (Clay integration findings)**: `suspendAskUserDecision` now defaults an
7
+ omitted `allowCustom` to `false` at accept time (same normalization as the
8
+ `ask_user_decision` tool path), so the persisted suspension always carries a
9
+ boolean and resumes cleanly after a JSON checkpoint round-trip; `toolCallId`
10
+ is optional on the suspend request; a non-boolean `allowCustom` throws
11
+ `allowCustom must be a boolean` at accept time instead of failing at resume
12
+ time with `suspension.data missing ask_user_decision request`.
13
+
3
14
  ## [0.3.1] - 2026-08-29
4
15
 
5
16
  ### Changed
@@ -124,20 +124,31 @@ export interface SuspendAskUserDecisionOptions {
124
124
  }
125
125
  /** JSON Schema describing resume `input` (= AskUserDecisionAnswer). */
126
126
  export declare function askUserDecisionResumeSchema(request: Pick<AskUserDecisionSuspendData, "selectionMode" | "allowCustom" | "options">): JsonObject;
127
+ /**
128
+ * Normalize a suspend request into durable `AskUserDecisionSuspendData`.
129
+ * `allowCustom` follows the tool-path default: omitted/null becomes `false`
130
+ * (persisted data always carries a boolean); non-boolean values fail closed
131
+ * at accept time with an actionable message — never at resume time.
132
+ */
127
133
  export declare function toAskUserDecisionSuspendData(request: {
128
134
  readonly question: string;
129
135
  readonly options: readonly AskUserDecisionOption[];
130
136
  readonly selectionMode: AskUserDecisionSelectionMode;
131
- readonly allowCustom: boolean;
137
+ readonly allowCustom?: boolean;
132
138
  readonly toolCallId?: string;
133
139
  readonly sessionId?: string;
134
140
  readonly runId?: string;
135
141
  }): AskUserDecisionSuspendData;
136
142
  /**
137
143
  * Return from a workflow node to pause for a user decision (opt-in durable path).
144
+ * `allowCustom` defaults to `false` when omitted (same default as the
145
+ * `ask_user_decision` tool path); a non-boolean value throws at accept time.
138
146
  * Host resumes via `resumeWorkflow` + `createAskUserDecisionResumeValidator` / `validateAskUserDecisionResume`.
139
147
  */
140
- export declare function suspendAskUserDecision(request: AskUserDecisionSuspendData | Pick<AskUserDecisionRequest, "question" | "options" | "selectionMode" | "allowCustom" | "toolCallId" | "sessionId" | "runId">, options?: SuspendAskUserDecisionOptions): WorkflowSuspension<AskUserDecisionAnswer>;
148
+ export declare function suspendAskUserDecision(request: AskUserDecisionSuspendData | (Pick<AskUserDecisionRequest, "question" | "options" | "selectionMode" | "sessionId" | "runId"> & {
149
+ readonly allowCustom?: boolean;
150
+ readonly toolCallId?: string;
151
+ }), options?: SuspendAskUserDecisionOptions): WorkflowSuspension<AskUserDecisionAnswer>;
141
152
  /**
142
153
  * Validate resume input against the original decision request.
143
154
  * Shared by workflow `validateResume` and host-held agent resume adapters.
@@ -417,12 +417,18 @@ export function askUserDecisionResumeSchema(request) {
417
417
  anyOf: [{ required: ["selectedId"] }, { required: ["selectedIds"] }, { required: ["customText"] }],
418
418
  };
419
419
  }
420
+ /**
421
+ * Normalize a suspend request into durable `AskUserDecisionSuspendData`.
422
+ * `allowCustom` follows the tool-path default: omitted/null becomes `false`
423
+ * (persisted data always carries a boolean); non-boolean values fail closed
424
+ * at accept time with an actionable message — never at resume time.
425
+ */
420
426
  export function toAskUserDecisionSuspendData(request) {
421
427
  return {
422
428
  question: request.question,
423
429
  options: request.options,
424
430
  selectionMode: request.selectionMode,
425
- allowCustom: request.allowCustom,
431
+ allowCustom: parseAllowCustom(request.allowCustom),
426
432
  ...(request.toolCallId ? { toolCallId: request.toolCallId } : {}),
427
433
  ...(request.sessionId ? { sessionId: request.sessionId } : {}),
428
434
  ...(request.runId ? { runId: request.runId } : {}),
@@ -439,6 +445,8 @@ function isAskUserDecisionSuspendData(value) {
439
445
  }
440
446
  /**
441
447
  * Return from a workflow node to pause for a user decision (opt-in durable path).
448
+ * `allowCustom` defaults to `false` when omitted (same default as the
449
+ * `ask_user_decision` tool path); a non-boolean value throws at accept time.
442
450
  * Host resumes via `resumeWorkflow` + `createAskUserDecisionResumeValidator` / `validateAskUserDecisionResume`.
443
451
  */
444
452
  export function suspendAskUserDecision(request, options) {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@arnilo/prism-coding-agent",
3
- "version": "0.3.1",
3
+ "version": "0.3.2",
4
4
  "description": "Optional coding-agent tools (shell, read, write, edit, repo_list, repo_search, glob, delete, move, opt-in Git/check/ask-user-decision, and durable plan/checkpoint helpers) package for Prism.",
5
5
  "type": "module",
6
6
  "main": "./dist/index.js",
@@ -28,7 +28,7 @@
28
28
  "diff": "^9.0.0"
29
29
  },
30
30
  "peerDependencies": {
31
- "@arnilo/prism": "^0.3.1",
31
+ "@arnilo/prism": "^0.3.2",
32
32
  "@arnilo/prism-workflows": "^0.3.0"
33
33
  },
34
34
  "devDependencies": {