markform 0.1.12 → 0.1.13
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/dist/ai-sdk.d.mts +1 -1
- package/dist/ai-sdk.mjs +7 -5
- package/dist/{apply-WeeBXwXg.mjs → apply-D5FLd9Yp.mjs} +102 -44
- package/dist/bin.mjs +1 -1
- package/dist/{cli-R_mVVf4x.mjs → cli-BQO5bzfd.mjs} +5 -5
- package/dist/cli.mjs +1 -1
- package/dist/{coreTypes-Cw_cJsa5.d.mts → coreTypes-2Duxp-Wo.d.mts} +135 -1
- package/dist/{coreTypes-Z8SvQyoL.mjs → coreTypes-Big8sgih.mjs} +30 -9
- package/dist/index.d.mts +6 -3
- package/dist/index.mjs +4 -4
- package/dist/{session-BJe-hei3.mjs → session-7QJlUeNg.mjs} +1 -1
- package/dist/{session-DX-DvjRP.mjs → session-CrhOG4eH.mjs} +1 -1
- package/dist/{src-DMQCFp2l.mjs → src-DuA3kv-E.mjs} +11 -9
- package/docs/markform-apis.md +1 -0
- package/examples/rejection-test/rejection-test.session.yaml +23 -39
- package/examples/simple/simple-mock-filled.schema.json +64 -12
- package/examples/simple/simple-skipped-filled.schema.json +64 -12
- package/examples/simple/simple-with-skips.session.yaml +23 -23
- package/examples/simple/simple.schema.json +64 -12
- package/examples/simple/simple.session.yaml +23 -23
- package/package.json +1 -1
package/dist/ai-sdk.d.mts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
|
|
2
|
-
import { At as PatchSchema, Dt as ParsedForm, Ot as Patch, Q as Id, V as FieldResponse, dr as ValidatorRegistry, q as FormSchema, r as ApplyResult, rt as InspectResult } from "./coreTypes-
|
|
2
|
+
import { At as PatchSchema, Dt as ParsedForm, Ot as Patch, Q as Id, V as FieldResponse, dr as ValidatorRegistry, q as FormSchema, r as ApplyResult, rt as InspectResult } from "./coreTypes-2Duxp-Wo.mjs";
|
|
3
3
|
import { z } from "zod";
|
|
4
4
|
|
|
5
5
|
//#region src/integrations/toolTypes.d.ts
|
package/dist/ai-sdk.mjs
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
|
|
2
|
-
import { L as PatchSchema } from "./coreTypes-
|
|
3
|
-
import { d as serializeForm, i as inspect, t as applyPatches } from "./apply-
|
|
2
|
+
import { L as PatchSchema } from "./coreTypes-Big8sgih.mjs";
|
|
3
|
+
import { d as serializeForm, i as inspect, t as applyPatches } from "./apply-D5FLd9Yp.mjs";
|
|
4
4
|
import { z } from "zod";
|
|
5
5
|
|
|
6
6
|
//#region src/integrations/vercelAiSdkTools.ts
|
|
@@ -116,15 +116,17 @@ function createMarkformTools(options) {
|
|
|
116
116
|
}
|
|
117
117
|
},
|
|
118
118
|
markform_apply: {
|
|
119
|
-
description: "Apply patches to update form field values.
|
|
119
|
+
description: "Apply patches to update form field values. Valid patches are applied even if some fail. Single values are automatically coerced to arrays for list fields. Returns applied patches, warnings for coerced values, and rejected patches separately. Patch operations: set_string, set_number, set_string_list, set_single_select, set_multi_select, set_checkboxes, set_url, set_url_list, set_date, set_year, set_table, clear_field, skip_field, abort_field.",
|
|
120
120
|
inputSchema: ApplyInputSchema,
|
|
121
121
|
execute: ({ patches }) => {
|
|
122
122
|
const form = sessionStore.getForm();
|
|
123
123
|
const result = applyPatches(form, patches);
|
|
124
124
|
sessionStore.updateForm(form);
|
|
125
|
-
const
|
|
125
|
+
const warningNote = result.warnings.length > 0 ? ` (${result.warnings.length} coerced)` : "";
|
|
126
|
+
const remaining = result.issues.filter((i) => i.severity === "required").length;
|
|
127
|
+
const message = result.applyStatus === "applied" ? `Applied ${patches.length} patch(es)${warningNote}. ${result.isComplete ? "Form is now complete!" : `${remaining} required issue(s) remaining.`}` : result.applyStatus === "partial" ? `Applied ${result.appliedPatches.length}/${patches.length} patches${warningNote}. ${result.rejectedPatches.length} rejected.` : `All patches rejected. Check field IDs and value types.`;
|
|
126
128
|
return Promise.resolve({
|
|
127
|
-
success: result.applyStatus
|
|
129
|
+
success: result.applyStatus !== "rejected",
|
|
128
130
|
data: result,
|
|
129
131
|
message
|
|
130
132
|
});
|
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
import YAML from "yaml";
|
|
3
3
|
|
|
4
4
|
//#region src/errors.ts
|
|
5
|
-
const VERSION = "0.1.
|
|
5
|
+
const VERSION = "0.1.13";
|
|
6
6
|
/**
|
|
7
7
|
* Base error class for all markform errors.
|
|
8
8
|
* Consumers can catch this to handle any markform error.
|
|
@@ -373,6 +373,12 @@ const DEFAULT_MAX_PATCHES_PER_TURN = 20;
|
|
|
373
373
|
*/
|
|
374
374
|
const DEFAULT_MAX_ISSUES_PER_TURN = 10;
|
|
375
375
|
/**
|
|
376
|
+
* Default maximum AI SDK steps (tool call rounds) per harness turn.
|
|
377
|
+
* Matches AI SDK's ToolLoopAgent default of 20.
|
|
378
|
+
* @see https://ai-sdk.dev/docs/agents/loop-control
|
|
379
|
+
*/
|
|
380
|
+
const DEFAULT_MAX_STEPS_PER_TURN = 20;
|
|
381
|
+
/**
|
|
376
382
|
* Default maximum issues to show per turn in research mode.
|
|
377
383
|
* Lower than general fill to keep research responses focused.
|
|
378
384
|
*/
|
|
@@ -2625,29 +2631,80 @@ function coerceBooleanToCheckboxValue(value, mode) {
|
|
|
2625
2631
|
return value ? "done" : "todo";
|
|
2626
2632
|
}
|
|
2627
2633
|
/**
|
|
2628
|
-
*
|
|
2629
|
-
* Returns a new patch with normalized values, or the original if no normalization needed.
|
|
2634
|
+
* Create a patch warning for coercion.
|
|
2630
2635
|
*/
|
|
2631
|
-
function
|
|
2632
|
-
if (patch.op !== "set_checkboxes") return patch;
|
|
2633
|
-
const field = findField(form, patch.fieldId);
|
|
2634
|
-
if (field?.kind !== "checkboxes") return patch;
|
|
2635
|
-
if (!patch.value) return patch;
|
|
2636
|
-
let needsNormalization = false;
|
|
2637
|
-
for (const value of Object.values(patch.value)) if (typeof value === "boolean") {
|
|
2638
|
-
needsNormalization = true;
|
|
2639
|
-
break;
|
|
2640
|
-
}
|
|
2641
|
-
if (!needsNormalization) return patch;
|
|
2642
|
-
const normalizedValues = {};
|
|
2643
|
-
for (const [optId, value] of Object.entries(patch.value)) if (typeof value === "boolean") normalizedValues[optId] = coerceBooleanToCheckboxValue(value, field.checkboxMode);
|
|
2644
|
-
else normalizedValues[optId] = value;
|
|
2636
|
+
function createWarning(index, fieldId, coercion, message) {
|
|
2645
2637
|
return {
|
|
2646
|
-
|
|
2647
|
-
|
|
2638
|
+
patchIndex: index,
|
|
2639
|
+
fieldId,
|
|
2640
|
+
message,
|
|
2641
|
+
coercion
|
|
2648
2642
|
};
|
|
2649
2643
|
}
|
|
2650
2644
|
/**
|
|
2645
|
+
* Normalize a patch, coercing common type mismatches with warnings.
|
|
2646
|
+
*
|
|
2647
|
+
* Coercions performed:
|
|
2648
|
+
* - Single string → string_list array
|
|
2649
|
+
* - Single URL string → url_list array
|
|
2650
|
+
* - Single option ID → multi_select array
|
|
2651
|
+
* - Boolean → checkbox string
|
|
2652
|
+
*
|
|
2653
|
+
* Returns the normalized patch and any coercion warning.
|
|
2654
|
+
*/
|
|
2655
|
+
function normalizePatch(form, patch, index) {
|
|
2656
|
+
if (patch.op === "add_note" || patch.op === "remove_note") return { patch };
|
|
2657
|
+
const field = findField(form, patch.fieldId);
|
|
2658
|
+
if (!field) return { patch };
|
|
2659
|
+
if (patch.op === "set_string_list" && field.kind === "string_list") {
|
|
2660
|
+
if (typeof patch.value === "string") return {
|
|
2661
|
+
patch: {
|
|
2662
|
+
...patch,
|
|
2663
|
+
value: [patch.value]
|
|
2664
|
+
},
|
|
2665
|
+
warning: createWarning(index, field.id, "string_to_list", `Coerced single string to string_list`)
|
|
2666
|
+
};
|
|
2667
|
+
}
|
|
2668
|
+
if (patch.op === "set_url_list" && field.kind === "url_list") {
|
|
2669
|
+
if (typeof patch.value === "string") return {
|
|
2670
|
+
patch: {
|
|
2671
|
+
...patch,
|
|
2672
|
+
value: [patch.value]
|
|
2673
|
+
},
|
|
2674
|
+
warning: createWarning(index, field.id, "url_to_list", `Coerced single URL to url_list`)
|
|
2675
|
+
};
|
|
2676
|
+
}
|
|
2677
|
+
if (patch.op === "set_multi_select" && field.kind === "multi_select") {
|
|
2678
|
+
if (typeof patch.value === "string") return {
|
|
2679
|
+
patch: {
|
|
2680
|
+
...patch,
|
|
2681
|
+
value: [patch.value]
|
|
2682
|
+
},
|
|
2683
|
+
warning: createWarning(index, field.id, "option_to_array", `Coerced single option ID to multi_select array`)
|
|
2684
|
+
};
|
|
2685
|
+
}
|
|
2686
|
+
if (patch.op === "set_checkboxes" && field.kind === "checkboxes") {
|
|
2687
|
+
if (!patch.value) return { patch };
|
|
2688
|
+
let needsNormalization = false;
|
|
2689
|
+
for (const value of Object.values(patch.value)) if (typeof value === "boolean") {
|
|
2690
|
+
needsNormalization = true;
|
|
2691
|
+
break;
|
|
2692
|
+
}
|
|
2693
|
+
if (!needsNormalization) return { patch };
|
|
2694
|
+
const normalizedValues = {};
|
|
2695
|
+
for (const [optId, value] of Object.entries(patch.value)) if (typeof value === "boolean") normalizedValues[optId] = coerceBooleanToCheckboxValue(value, field.checkboxMode);
|
|
2696
|
+
else normalizedValues[optId] = value;
|
|
2697
|
+
return {
|
|
2698
|
+
patch: {
|
|
2699
|
+
...patch,
|
|
2700
|
+
value: normalizedValues
|
|
2701
|
+
},
|
|
2702
|
+
warning: createWarning(index, field.id, "boolean_to_checkbox", `Coerced boolean values to checkbox state strings`)
|
|
2703
|
+
};
|
|
2704
|
+
}
|
|
2705
|
+
return { patch };
|
|
2706
|
+
}
|
|
2707
|
+
/**
|
|
2651
2708
|
* Create a type mismatch error with field metadata for LLM guidance.
|
|
2652
2709
|
*/
|
|
2653
2710
|
function typeMismatchError(index, op, field) {
|
|
@@ -2752,20 +2809,6 @@ function validatePatch(form, patch, index) {
|
|
|
2752
2809
|
return null;
|
|
2753
2810
|
}
|
|
2754
2811
|
/**
|
|
2755
|
-
* Validate all patches against the form schema.
|
|
2756
|
-
*/
|
|
2757
|
-
function validatePatches(form, patches) {
|
|
2758
|
-
const errors = [];
|
|
2759
|
-
for (let i = 0; i < patches.length; i++) {
|
|
2760
|
-
const patch = patches[i];
|
|
2761
|
-
if (patch) {
|
|
2762
|
-
const error = validatePatch(form, patch, i);
|
|
2763
|
-
if (error) errors.push(error);
|
|
2764
|
-
}
|
|
2765
|
-
}
|
|
2766
|
-
return errors;
|
|
2767
|
-
}
|
|
2768
|
-
/**
|
|
2769
2812
|
* Generate a unique note ID for the form.
|
|
2770
2813
|
*/
|
|
2771
2814
|
function generateNoteId(form) {
|
|
@@ -2962,16 +3005,28 @@ function convertToInspectIssues(form) {
|
|
|
2962
3005
|
/**
|
|
2963
3006
|
* Apply patches to a parsed form.
|
|
2964
3007
|
*
|
|
2965
|
-
* Uses
|
|
3008
|
+
* Uses best-effort semantics: valid patches are applied even when some fail.
|
|
3009
|
+
* Invalid patches are rejected with detailed error messages.
|
|
2966
3010
|
*
|
|
2967
3011
|
* @param form - The parsed form to update
|
|
2968
3012
|
* @param patches - Array of patches to apply
|
|
2969
|
-
* @returns Apply result with new summaries and
|
|
3013
|
+
* @returns Apply result with new summaries, status, and detailed feedback
|
|
2970
3014
|
*/
|
|
2971
3015
|
function applyPatches(form, patches) {
|
|
2972
|
-
const
|
|
2973
|
-
const
|
|
2974
|
-
|
|
3016
|
+
const normalized = patches.map((p, i) => normalizePatch(form, p, i));
|
|
3017
|
+
const warnings = normalized.filter((r) => r.warning).map((r) => r.warning);
|
|
3018
|
+
const normalizedPatches = normalized.map((r) => r.patch);
|
|
3019
|
+
const validPatches = [];
|
|
3020
|
+
const errors = [];
|
|
3021
|
+
for (let i = 0; i < normalizedPatches.length; i++) {
|
|
3022
|
+
const patch = normalizedPatches[i];
|
|
3023
|
+
if (patch) {
|
|
3024
|
+
const error = validatePatch(form, patch, i);
|
|
3025
|
+
if (error) errors.push(error);
|
|
3026
|
+
else validPatches.push(patch);
|
|
3027
|
+
}
|
|
3028
|
+
}
|
|
3029
|
+
if (validPatches.length === 0 && errors.length > 0) {
|
|
2975
3030
|
const issues$1 = convertToInspectIssues(form);
|
|
2976
3031
|
const summaries$1 = computeAllSummaries(form.schema, form.responsesByFieldId, form.notes, issues$1);
|
|
2977
3032
|
return {
|
|
@@ -2981,27 +3036,30 @@ function applyPatches(form, patches) {
|
|
|
2981
3036
|
issues: issues$1,
|
|
2982
3037
|
isComplete: summaries$1.isComplete,
|
|
2983
3038
|
formState: summaries$1.formState,
|
|
2984
|
-
|
|
3039
|
+
appliedPatches: [],
|
|
3040
|
+
rejectedPatches: errors,
|
|
3041
|
+
warnings: []
|
|
2985
3042
|
};
|
|
2986
3043
|
}
|
|
2987
3044
|
const newResponses = { ...form.responsesByFieldId };
|
|
2988
3045
|
const newNotes = [...form.notes];
|
|
2989
|
-
form.notes;
|
|
2990
3046
|
form.notes = newNotes;
|
|
2991
|
-
for (const patch of
|
|
3047
|
+
for (const patch of validPatches) applyPatch(form, newResponses, patch);
|
|
2992
3048
|
form.responsesByFieldId = newResponses;
|
|
2993
3049
|
const issues = convertToInspectIssues(form);
|
|
2994
3050
|
const summaries = computeAllSummaries(form.schema, newResponses, newNotes, issues);
|
|
2995
3051
|
return {
|
|
2996
|
-
applyStatus: "applied",
|
|
3052
|
+
applyStatus: errors.length > 0 ? "partial" : "applied",
|
|
2997
3053
|
structureSummary: summaries.structureSummary,
|
|
2998
3054
|
progressSummary: summaries.progressSummary,
|
|
2999
3055
|
issues,
|
|
3000
3056
|
isComplete: isFormComplete(summaries.progressSummary),
|
|
3001
3057
|
formState: computeFormState(summaries.progressSummary),
|
|
3002
|
-
|
|
3058
|
+
appliedPatches: validPatches,
|
|
3059
|
+
rejectedPatches: errors,
|
|
3060
|
+
warnings
|
|
3003
3061
|
};
|
|
3004
3062
|
}
|
|
3005
3063
|
|
|
3006
3064
|
//#endregion
|
|
3007
|
-
export {
|
|
3065
|
+
export { isParseError as $, deriveExportPath as A, parseModelIdForDisplay as B, DEFAULT_RESEARCH_MAX_ISSUES_PER_TURN as C, MAX_FORMS_IN_MENU as D, DEFAULT_ROLE_INSTRUCTIONS as E, SUGGESTED_LLMS as F, MarkformParseError as G, MarkformConfigError as H, WEB_SEARCH_CONFIG as I, ParseError as J, MarkformPatchError as K, formatSuggestedLlms as L, deriveSchemaPath as M, detectFileType as N, REPORT_EXTENSION as O, parseRolesFlag as P, isMarkformError as Q, getWebSearchConfig as R, DEFAULT_PRIORITY as S, DEFAULT_ROLES as T, MarkformError as U, MarkformAbortError as V, MarkformLlmError as W, isConfigError as X, isAbortError as Y, isLlmError as Z, DEFAULT_MAX_ISSUES_PER_TURN as _, validate as a, DEFAULT_MAX_TURNS as b, computeProgressSummary as c, serializeForm as d, isPatchError as et, serializeRawMarkdown as f, DEFAULT_FORMS_DIR as g, ALL_EXTENSIONS as h, inspect as i, deriveReportPath as j, USER_ROLE as k, computeStructureSummary as l, AGENT_ROLE as m, getAllFields as n, isValidationError as nt, computeAllSummaries as o, serializeReport as p, MarkformValidationError as q, getFieldsForRoles as r, computeFormState as s, applyPatches as t, isRetryableError as tt, isFormComplete as u, DEFAULT_MAX_PATCHES_PER_TURN as v, DEFAULT_RESEARCH_MAX_PATCHES_PER_TURN as w, DEFAULT_PORT as x, DEFAULT_MAX_STEPS_PER_TURN as y, hasWebSearchSupport as z };
|
package/dist/bin.mjs
CHANGED
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
|
|
2
|
-
import { L as PatchSchema } from "./coreTypes-
|
|
3
|
-
import { A as
|
|
4
|
-
import { D as parseForm, E as formToJsonSchema, a as resolveHarnessConfig, c as getProviderNames, d as createLiveAgent, h as createHarness, i as runResearch, l as resolveModel, n as isResearchForm, o as fillForm, p as createMockAgent, s as getProviderInfo, t as VERSION, u as buildMockWireFormat } from "./src-
|
|
5
|
-
import { n as serializeSession } from "./session-
|
|
2
|
+
import { L as PatchSchema } from "./coreTypes-Big8sgih.mjs";
|
|
3
|
+
import { A as deriveExportPath, B as parseModelIdForDisplay, C as DEFAULT_RESEARCH_MAX_ISSUES_PER_TURN, D as MAX_FORMS_IN_MENU, F as SUGGESTED_LLMS, I as WEB_SEARCH_CONFIG, L as formatSuggestedLlms, M as deriveSchemaPath, N as detectFileType, O as REPORT_EXTENSION, P as parseRolesFlag, _ as DEFAULT_MAX_ISSUES_PER_TURN, b as DEFAULT_MAX_TURNS, d as serializeForm, f as serializeRawMarkdown, g as DEFAULT_FORMS_DIR, h as ALL_EXTENSIONS, i as inspect, j as deriveReportPath, k as USER_ROLE, m as AGENT_ROLE, n as getAllFields, p as serializeReport, t as applyPatches, v as DEFAULT_MAX_PATCHES_PER_TURN, w as DEFAULT_RESEARCH_MAX_PATCHES_PER_TURN, x as DEFAULT_PORT, z as hasWebSearchSupport } from "./apply-D5FLd9Yp.mjs";
|
|
4
|
+
import { D as parseForm, E as formToJsonSchema, a as resolveHarnessConfig, c as getProviderNames, d as createLiveAgent, h as createHarness, i as runResearch, l as resolveModel, n as isResearchForm, o as fillForm, p as createMockAgent, s as getProviderInfo, t as VERSION, u as buildMockWireFormat } from "./src-DuA3kv-E.mjs";
|
|
5
|
+
import { n as serializeSession } from "./session-CrhOG4eH.mjs";
|
|
6
6
|
import { a as formatPath, c as logError, d as logTiming, f as logVerbose, g as writeFile, i as formatOutput, l as logInfo, m as readFile$1, n as createSpinner, o as getCommandContext, p as logWarn, r as ensureFormsDir, s as logDryRun, t as OUTPUT_FORMATS, u as logSuccess } from "./shared-D3dNi-Gn.mjs";
|
|
7
7
|
import Markdoc from "@markdoc/markdoc";
|
|
8
8
|
import YAML from "yaml";
|
|
@@ -5111,7 +5111,7 @@ function registerResearchCommand(program) {
|
|
|
5111
5111
|
console.log(` ${formPath} ${pc.dim("(filled markform source)")}`);
|
|
5112
5112
|
console.log(` ${schemaPath} ${pc.dim("(JSON Schema)")}`);
|
|
5113
5113
|
if (options.transcript && result.transcript) {
|
|
5114
|
-
const { serializeSession: serializeSession$1 } = await import("./session-
|
|
5114
|
+
const { serializeSession: serializeSession$1 } = await import("./session-7QJlUeNg.mjs");
|
|
5115
5115
|
const transcriptPath = outputPath.replace(/\.form\.md$/, ".session.yaml");
|
|
5116
5116
|
const { writeFile: writeFile$1 } = await import("./shared-CNqwaxUt.mjs");
|
|
5117
5117
|
await writeFile$1(transcriptPath, serializeSession$1(result.transcript));
|
package/dist/cli.mjs
CHANGED
|
@@ -467,16 +467,31 @@ interface PatchRejection {
|
|
|
467
467
|
/** Column IDs if available (for table fields) */
|
|
468
468
|
columnIds?: string[];
|
|
469
469
|
}
|
|
470
|
+
/** Coercion type for patch warnings */
|
|
471
|
+
type PatchCoercionType = 'string_to_list' | 'url_to_list' | 'option_to_array' | 'boolean_to_checkbox';
|
|
472
|
+
/** Warning for coerced patches */
|
|
473
|
+
interface PatchWarning {
|
|
474
|
+
patchIndex: number;
|
|
475
|
+
fieldId: string;
|
|
476
|
+
message: string;
|
|
477
|
+
coercion: PatchCoercionType;
|
|
478
|
+
}
|
|
479
|
+
/** Status of patch application */
|
|
480
|
+
type ApplyStatus = 'applied' | 'partial' | 'rejected';
|
|
470
481
|
/** Result from apply operation */
|
|
471
482
|
interface ApplyResult {
|
|
472
|
-
applyStatus:
|
|
483
|
+
applyStatus: ApplyStatus;
|
|
473
484
|
structureSummary: StructureSummary;
|
|
474
485
|
progressSummary: ProgressSummary;
|
|
475
486
|
issues: InspectIssue[];
|
|
476
487
|
isComplete: boolean;
|
|
477
488
|
formState: ProgressState;
|
|
489
|
+
/** Patches that were successfully applied (normalized/coerced) */
|
|
490
|
+
appliedPatches: Patch[];
|
|
478
491
|
/** Empty on success, contains rejection details on failure */
|
|
479
492
|
rejectedPatches: PatchRejection[];
|
|
493
|
+
/** Warnings for patches that were coerced */
|
|
494
|
+
warnings: PatchWarning[];
|
|
480
495
|
}
|
|
481
496
|
/** Set string field value */
|
|
482
497
|
interface SetStringPatch {
|
|
@@ -721,6 +736,8 @@ interface SessionTurn {
|
|
|
721
736
|
patches: Patch[];
|
|
722
737
|
/** Patches that were rejected (type mismatch, invalid field, etc.) */
|
|
723
738
|
rejectedPatches?: PatchRejection[];
|
|
739
|
+
/** Warnings for patches that were coerced (e.g., string → array) */
|
|
740
|
+
warnings?: PatchWarning[];
|
|
724
741
|
};
|
|
725
742
|
after: {
|
|
726
743
|
requiredIssueCount: number;
|
|
@@ -2487,6 +2504,7 @@ declare const InspectResultSchema: z.ZodObject<{
|
|
|
2487
2504
|
declare const ApplyResultSchema: z.ZodObject<{
|
|
2488
2505
|
applyStatus: z.ZodEnum<{
|
|
2489
2506
|
applied: "applied";
|
|
2507
|
+
partial: "partial";
|
|
2490
2508
|
rejected: "rejected";
|
|
2491
2509
|
}>;
|
|
2492
2510
|
structureSummary: z.ZodObject<{
|
|
@@ -2623,6 +2641,100 @@ declare const ApplyResultSchema: z.ZodObject<{
|
|
|
2623
2641
|
invalid: "invalid";
|
|
2624
2642
|
complete: "complete";
|
|
2625
2643
|
}>;
|
|
2644
|
+
appliedPatches: z.ZodArray<z.ZodLazy<z.ZodDiscriminatedUnion<[z.ZodObject<{
|
|
2645
|
+
op: z.ZodLiteral<"set_string">;
|
|
2646
|
+
fieldId: z.ZodString;
|
|
2647
|
+
value: z.ZodNullable<z.ZodString>;
|
|
2648
|
+
}, z.core.$strip>, z.ZodObject<{
|
|
2649
|
+
op: z.ZodLiteral<"set_number">;
|
|
2650
|
+
fieldId: z.ZodString;
|
|
2651
|
+
value: z.ZodNullable<z.ZodNumber>;
|
|
2652
|
+
}, z.core.$strip>, z.ZodObject<{
|
|
2653
|
+
op: z.ZodLiteral<"set_string_list">;
|
|
2654
|
+
fieldId: z.ZodString;
|
|
2655
|
+
value: z.ZodArray<z.ZodString>;
|
|
2656
|
+
}, z.core.$strip>, z.ZodObject<{
|
|
2657
|
+
op: z.ZodLiteral<"set_checkboxes">;
|
|
2658
|
+
fieldId: z.ZodString;
|
|
2659
|
+
value: z.ZodRecord<z.ZodString, z.ZodUnion<readonly [z.ZodEnum<{
|
|
2660
|
+
todo: "todo";
|
|
2661
|
+
done: "done";
|
|
2662
|
+
incomplete: "incomplete";
|
|
2663
|
+
active: "active";
|
|
2664
|
+
na: "na";
|
|
2665
|
+
}>, z.ZodEnum<{
|
|
2666
|
+
unfilled: "unfilled";
|
|
2667
|
+
yes: "yes";
|
|
2668
|
+
no: "no";
|
|
2669
|
+
}>]>>;
|
|
2670
|
+
}, z.core.$strip>, z.ZodObject<{
|
|
2671
|
+
op: z.ZodLiteral<"set_single_select">;
|
|
2672
|
+
fieldId: z.ZodString;
|
|
2673
|
+
value: z.ZodNullable<z.ZodString>;
|
|
2674
|
+
}, z.core.$strip>, z.ZodObject<{
|
|
2675
|
+
op: z.ZodLiteral<"set_multi_select">;
|
|
2676
|
+
fieldId: z.ZodString;
|
|
2677
|
+
value: z.ZodArray<z.ZodString>;
|
|
2678
|
+
}, z.core.$strip>, z.ZodObject<{
|
|
2679
|
+
op: z.ZodLiteral<"set_url">;
|
|
2680
|
+
fieldId: z.ZodString;
|
|
2681
|
+
value: z.ZodNullable<z.ZodString>;
|
|
2682
|
+
}, z.core.$strip>, z.ZodObject<{
|
|
2683
|
+
op: z.ZodLiteral<"set_url_list">;
|
|
2684
|
+
fieldId: z.ZodString;
|
|
2685
|
+
value: z.ZodArray<z.ZodString>;
|
|
2686
|
+
}, z.core.$strip>, z.ZodObject<{
|
|
2687
|
+
op: z.ZodLiteral<"set_date">;
|
|
2688
|
+
fieldId: z.ZodString;
|
|
2689
|
+
value: z.ZodNullable<z.ZodString>;
|
|
2690
|
+
}, z.core.$strip>, z.ZodObject<{
|
|
2691
|
+
op: z.ZodLiteral<"set_year">;
|
|
2692
|
+
fieldId: z.ZodString;
|
|
2693
|
+
value: z.ZodNullable<z.ZodNumber>;
|
|
2694
|
+
}, z.core.$strip>, z.ZodObject<{
|
|
2695
|
+
op: z.ZodLiteral<"set_table">;
|
|
2696
|
+
fieldId: z.ZodString;
|
|
2697
|
+
value: z.ZodArray<z.ZodRecord<z.ZodString, z.ZodUnion<readonly [z.ZodUnion<readonly [z.ZodString, z.ZodNumber]>, z.ZodNull, z.ZodString]>>>;
|
|
2698
|
+
}, z.core.$strip>, z.ZodObject<{
|
|
2699
|
+
op: z.ZodLiteral<"clear_field">;
|
|
2700
|
+
fieldId: z.ZodString;
|
|
2701
|
+
}, z.core.$strip>, z.ZodObject<{
|
|
2702
|
+
op: z.ZodLiteral<"skip_field">;
|
|
2703
|
+
fieldId: z.ZodString;
|
|
2704
|
+
role: z.ZodString;
|
|
2705
|
+
reason: z.ZodOptional<z.ZodString>;
|
|
2706
|
+
}, z.core.$strip>, z.ZodObject<{
|
|
2707
|
+
op: z.ZodLiteral<"abort_field">;
|
|
2708
|
+
fieldId: z.ZodString;
|
|
2709
|
+
role: z.ZodString;
|
|
2710
|
+
reason: z.ZodOptional<z.ZodString>;
|
|
2711
|
+
}, z.core.$strip>, z.ZodObject<{
|
|
2712
|
+
op: z.ZodLiteral<"add_note">;
|
|
2713
|
+
ref: z.ZodString;
|
|
2714
|
+
role: z.ZodString;
|
|
2715
|
+
text: z.ZodString;
|
|
2716
|
+
}, z.core.$strip>, z.ZodObject<{
|
|
2717
|
+
op: z.ZodLiteral<"remove_note">;
|
|
2718
|
+
noteId: z.ZodString;
|
|
2719
|
+
}, z.core.$strip>], "op">>>;
|
|
2720
|
+
rejectedPatches: z.ZodArray<z.ZodObject<{
|
|
2721
|
+
patchIndex: z.ZodNumber;
|
|
2722
|
+
message: z.ZodString;
|
|
2723
|
+
fieldId: z.ZodOptional<z.ZodString>;
|
|
2724
|
+
fieldKind: z.ZodOptional<z.ZodString>;
|
|
2725
|
+
columnIds: z.ZodOptional<z.ZodArray<z.ZodString>>;
|
|
2726
|
+
}, z.core.$strip>>;
|
|
2727
|
+
warnings: z.ZodArray<z.ZodObject<{
|
|
2728
|
+
patchIndex: z.ZodNumber;
|
|
2729
|
+
fieldId: z.ZodString;
|
|
2730
|
+
message: z.ZodString;
|
|
2731
|
+
coercion: z.ZodEnum<{
|
|
2732
|
+
string_to_list: "string_to_list";
|
|
2733
|
+
url_to_list: "url_to_list";
|
|
2734
|
+
option_to_array: "option_to_array";
|
|
2735
|
+
boolean_to_checkbox: "boolean_to_checkbox";
|
|
2736
|
+
}>;
|
|
2737
|
+
}, z.core.$strip>>;
|
|
2626
2738
|
}, z.core.$strip>;
|
|
2627
2739
|
declare const SetStringPatchSchema: z.ZodObject<{
|
|
2628
2740
|
op: z.ZodLiteral<"set_string">;
|
|
@@ -3102,6 +3214,17 @@ declare const SessionTurnSchema: z.ZodObject<{
|
|
|
3102
3214
|
fieldKind: z.ZodOptional<z.ZodString>;
|
|
3103
3215
|
columnIds: z.ZodOptional<z.ZodArray<z.ZodString>>;
|
|
3104
3216
|
}, z.core.$strip>>>;
|
|
3217
|
+
warnings: z.ZodOptional<z.ZodArray<z.ZodObject<{
|
|
3218
|
+
patchIndex: z.ZodNumber;
|
|
3219
|
+
fieldId: z.ZodString;
|
|
3220
|
+
message: z.ZodString;
|
|
3221
|
+
coercion: z.ZodEnum<{
|
|
3222
|
+
string_to_list: "string_to_list";
|
|
3223
|
+
url_to_list: "url_to_list";
|
|
3224
|
+
option_to_array: "option_to_array";
|
|
3225
|
+
boolean_to_checkbox: "boolean_to_checkbox";
|
|
3226
|
+
}>;
|
|
3227
|
+
}, z.core.$strip>>>;
|
|
3105
3228
|
}, z.core.$strip>;
|
|
3106
3229
|
after: z.ZodObject<{
|
|
3107
3230
|
requiredIssueCount: z.ZodNumber;
|
|
@@ -3296,6 +3419,17 @@ declare const SessionTranscriptSchema: z.ZodObject<{
|
|
|
3296
3419
|
fieldKind: z.ZodOptional<z.ZodString>;
|
|
3297
3420
|
columnIds: z.ZodOptional<z.ZodArray<z.ZodString>>;
|
|
3298
3421
|
}, z.core.$strip>>>;
|
|
3422
|
+
warnings: z.ZodOptional<z.ZodArray<z.ZodObject<{
|
|
3423
|
+
patchIndex: z.ZodNumber;
|
|
3424
|
+
fieldId: z.ZodString;
|
|
3425
|
+
message: z.ZodString;
|
|
3426
|
+
coercion: z.ZodEnum<{
|
|
3427
|
+
string_to_list: "string_to_list";
|
|
3428
|
+
url_to_list: "url_to_list";
|
|
3429
|
+
option_to_array: "option_to_array";
|
|
3430
|
+
boolean_to_checkbox: "boolean_to_checkbox";
|
|
3431
|
+
}>;
|
|
3432
|
+
}, z.core.$strip>>>;
|
|
3299
3433
|
}, z.core.$strip>;
|
|
3300
3434
|
after: z.ZodObject<{
|
|
3301
3435
|
requiredIssueCount: z.ZodNumber;
|
|
@@ -447,14 +447,6 @@ const InspectResultSchema = z.object({
|
|
|
447
447
|
isComplete: z.boolean(),
|
|
448
448
|
formState: ProgressStateSchema
|
|
449
449
|
});
|
|
450
|
-
const ApplyResultSchema = z.object({
|
|
451
|
-
applyStatus: z.enum(["applied", "rejected"]),
|
|
452
|
-
structureSummary: StructureSummarySchema,
|
|
453
|
-
progressSummary: ProgressSummarySchema,
|
|
454
|
-
issues: z.array(InspectIssueSchema),
|
|
455
|
-
isComplete: z.boolean(),
|
|
456
|
-
formState: ProgressStateSchema
|
|
457
|
-
});
|
|
458
450
|
const PatchRejectionSchema = z.object({
|
|
459
451
|
patchIndex: z.number().int().nonnegative(),
|
|
460
452
|
message: z.string(),
|
|
@@ -462,6 +454,34 @@ const PatchRejectionSchema = z.object({
|
|
|
462
454
|
fieldKind: z.string().optional(),
|
|
463
455
|
columnIds: z.array(z.string()).optional()
|
|
464
456
|
});
|
|
457
|
+
const PatchCoercionTypeSchema = z.enum([
|
|
458
|
+
"string_to_list",
|
|
459
|
+
"url_to_list",
|
|
460
|
+
"option_to_array",
|
|
461
|
+
"boolean_to_checkbox"
|
|
462
|
+
]);
|
|
463
|
+
const PatchWarningSchema = z.object({
|
|
464
|
+
patchIndex: z.number().int().nonnegative(),
|
|
465
|
+
fieldId: z.string(),
|
|
466
|
+
message: z.string(),
|
|
467
|
+
coercion: PatchCoercionTypeSchema
|
|
468
|
+
});
|
|
469
|
+
const ApplyStatusSchema = z.enum([
|
|
470
|
+
"applied",
|
|
471
|
+
"partial",
|
|
472
|
+
"rejected"
|
|
473
|
+
]);
|
|
474
|
+
const ApplyResultSchema = z.object({
|
|
475
|
+
applyStatus: ApplyStatusSchema,
|
|
476
|
+
structureSummary: StructureSummarySchema,
|
|
477
|
+
progressSummary: ProgressSummarySchema,
|
|
478
|
+
issues: z.array(InspectIssueSchema),
|
|
479
|
+
isComplete: z.boolean(),
|
|
480
|
+
formState: ProgressStateSchema,
|
|
481
|
+
appliedPatches: z.array(z.lazy(() => PatchSchema)),
|
|
482
|
+
rejectedPatches: z.array(PatchRejectionSchema),
|
|
483
|
+
warnings: z.array(PatchWarningSchema)
|
|
484
|
+
});
|
|
465
485
|
const SetStringPatchSchema = z.object({
|
|
466
486
|
op: z.literal("set_string"),
|
|
467
487
|
fieldId: IdSchema,
|
|
@@ -629,7 +649,8 @@ const SessionTurnSchema = z.object({
|
|
|
629
649
|
context: SessionTurnContextSchema.optional(),
|
|
630
650
|
apply: z.object({
|
|
631
651
|
patches: z.array(PatchSchema),
|
|
632
|
-
rejectedPatches: z.array(PatchRejectionSchema).optional()
|
|
652
|
+
rejectedPatches: z.array(PatchRejectionSchema).optional(),
|
|
653
|
+
warnings: z.array(PatchWarningSchema).optional()
|
|
633
654
|
}),
|
|
634
655
|
after: z.object({
|
|
635
656
|
requiredIssueCount: z.number().int().nonnegative(),
|
package/dist/index.d.mts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
|
|
2
|
-
import { $ as IdIndexEntry, $n as UrlListField, $t as SetMultiSelectPatch, A as ExplicitCheckboxValue, An as StepResultSchema, At as PatchSchema, B as FieldProgressSchema, Bn as StructureSummarySchema, Bt as RunModeSchema, C as DateFieldSchema, Cn as SingleSelectValue, Cr as WireToolResultSchema, Ct as Option, D as DocumentationBlockSchema, Dn as SourceRange, Dr as YearValueSchema, Dt as ParsedForm, E as DocumentationBlock, En as SourcePositionSchema, Er as YearValue, Et as OptionSchema, F as FieldGroupSchema, Fn as StringListValue, Ft as ProgressSummary, G as FieldValueSchema, Gn as TableRowPatch, Gt as SessionTurn, H as FieldResponseSchema, Hn as TableColumnSchema, Ht as SessionFinalSchema, I as FieldKind, In as StringListValueSchema, It as ProgressSummarySchema, J as FormSchemaSchema, Jn as TableRowResponseSchema, Jt as SessionTurnStats, K as FillMode, Kn as TableRowPatchSchema, Kt as SessionTurnContext, L as FieldKindSchema, Ln as StringValue, Lt as QualifiedColumnRef, M as Field, Mn as StringFieldSchema, Mt as ProgressCountsSchema, N as FieldBase, Nn as StringListField, Nt as ProgressState, O as DocumentationTag, On as SourceRangeSchema, Ot as Patch, P as FieldGroup, Pn as StringListFieldSchema, Pt as ProgressStateSchema, Q as Id, Qn as UrlFieldSchema, Qt as SetDatePatchSchema, R as FieldPriorityLevel, Rn as StringValueSchema, Rt as QualifiedOptionRef, S as DateField, Sn as SingleSelectFieldSchema, Sr as WireToolResult, St as NumberValueSchema, T as DateValueSchema, Tn as SourcePosition, Tr as YearFieldSchema, Tt as OptionIdSchema, U as FieldSchema, Un as TableField, Ut as SessionTranscript, V as FieldResponse, Vn as TableColumn, Vt as SessionFinal, W as FieldValue, Wn as TableFieldSchema, Wt as SessionTranscriptSchema, X as HarnessConfig, Xn as TableValueSchema, Xt as SetCheckboxesPatchSchema, Y as FrontmatterHarnessConfig, Yn as TableValue, Yt as SetCheckboxesPatch, Z as HarnessConfigSchema, Zn as UrlField, Zt as SetDatePatch, _ as CheckboxesValueSchema, _n as Severity, _r as WireResponseFormatSchema, _t as NodeType, a as ApprovalMode, an as SetStringListPatch, ar as ValidationIssue, at as IssueReason, b as ColumnTypeName, bn as SimpleCheckboxStateSchema, br as WireToolCall, bt as NumberFieldSchema, c as CheckboxMode, cn as SetStringPatchSchema, cr as ValidatorFn, ct as IssueScopeSchema, d as CheckboxProgressCountsSchema, dn as SetUrlListPatch, dr as ValidatorRegistry, dt as MultiCheckboxState, en as SetMultiSelectPatchSchema, er as UrlListFieldSchema, et as IdSchema, f as CheckboxValue, fn as SetUrlListPatchSchema, fr as WireFormat, ft as MultiCheckboxStateSchema, g as CheckboxesValue, gn as SetYearPatchSchema, gr as WireResponseFormat, gt as MultiSelectValueSchema, h as CheckboxesFieldSchema, hn as SetYearPatch, hr as WireRequestFormatSchema, ht as MultiSelectValue, i as ApplyResultSchema, in as SetSingleSelectPatchSchema, ir as UrlValueSchema, it as InspectResultSchema, j as ExplicitCheckboxValueSchema, jn as StringField, jt as ProgressCounts, k as DocumentationTagSchema, kn as StepResult, kt as PatchRejection, l as CheckboxModeSchema, ln as SetTablePatch, lr as ValidatorRef, lt as MarkformFrontmatter, m as CheckboxesField, mn as SetUrlPatchSchema, mr as WireRequestFormat, mt as MultiSelectFieldSchema, n as AnswerStateSchema, nn as SetNumberPatchSchema, nr as UrlListValueSchema, nt as InspectIssueSchema, o as CellResponse, on as SetStringListPatchSchema, or as ValidationIssueSchema, ot as IssueReasonSchema, p as CheckboxValueSchema, pn as SetUrlPatch, pr as WireFormatSchema, pt as MultiSelectField, q as FormSchema, qn as TableRowResponse, qt as SessionTurnSchema, r as ApplyResult, rn as SetSingleSelectPatch, rr as UrlValue, rt as InspectResult, s as CellResponseSchema, sn as SetStringPatch, sr as ValidatorContext, st as IssueScope, t as AnswerState, tn as SetNumberPatch, tr as UrlListValue, tt as InspectIssue, u as CheckboxProgressCounts, un as SetTablePatchSchema, ur as ValidatorRefSchema, ut as MarkformFrontmatterSchema, v as ClearFieldPatch, vn as SeveritySchema, vr as WireResponseStep, vt as Note, w as DateValue, wn as SingleSelectValueSchema, wr as YearField, wt as OptionId, x as ColumnTypeNameSchema, xn as SingleSelectField, xr as WireToolCallSchema, xt as NumberValue, y as ClearFieldPatchSchema, yn as SimpleCheckboxState, yr as WireResponseStepSchema, yt as NumberField, z as FieldProgress, zn as StructureSummary, zt as RunMode } from "./coreTypes-
|
|
2
|
+
import { $ as IdIndexEntry, $n as UrlListField, $t as SetMultiSelectPatch, A as ExplicitCheckboxValue, An as StepResultSchema, At as PatchSchema, B as FieldProgressSchema, Bn as StructureSummarySchema, Bt as RunModeSchema, C as DateFieldSchema, Cn as SingleSelectValue, Cr as WireToolResultSchema, Ct as Option, D as DocumentationBlockSchema, Dn as SourceRange, Dr as YearValueSchema, Dt as ParsedForm, E as DocumentationBlock, En as SourcePositionSchema, Er as YearValue, Et as OptionSchema, F as FieldGroupSchema, Fn as StringListValue, Ft as ProgressSummary, G as FieldValueSchema, Gn as TableRowPatch, Gt as SessionTurn, H as FieldResponseSchema, Hn as TableColumnSchema, Ht as SessionFinalSchema, I as FieldKind, In as StringListValueSchema, It as ProgressSummarySchema, J as FormSchemaSchema, Jn as TableRowResponseSchema, Jt as SessionTurnStats, K as FillMode, Kn as TableRowPatchSchema, Kt as SessionTurnContext, L as FieldKindSchema, Ln as StringValue, Lt as QualifiedColumnRef, M as Field, Mn as StringFieldSchema, Mt as ProgressCountsSchema, N as FieldBase, Nn as StringListField, Nt as ProgressState, O as DocumentationTag, On as SourceRangeSchema, Ot as Patch, P as FieldGroup, Pn as StringListFieldSchema, Pt as ProgressStateSchema, Q as Id, Qn as UrlFieldSchema, Qt as SetDatePatchSchema, R as FieldPriorityLevel, Rn as StringValueSchema, Rt as QualifiedOptionRef, S as DateField, Sn as SingleSelectFieldSchema, Sr as WireToolResult, St as NumberValueSchema, T as DateValueSchema, Tn as SourcePosition, Tr as YearFieldSchema, Tt as OptionIdSchema, U as FieldSchema, Un as TableField, Ut as SessionTranscript, V as FieldResponse, Vn as TableColumn, Vt as SessionFinal, W as FieldValue, Wn as TableFieldSchema, Wt as SessionTranscriptSchema, X as HarnessConfig, Xn as TableValueSchema, Xt as SetCheckboxesPatchSchema, Y as FrontmatterHarnessConfig, Yn as TableValue, Yt as SetCheckboxesPatch, Z as HarnessConfigSchema, Zn as UrlField, Zt as SetDatePatch, _ as CheckboxesValueSchema, _n as Severity, _r as WireResponseFormatSchema, _t as NodeType, a as ApprovalMode, an as SetStringListPatch, ar as ValidationIssue, at as IssueReason, b as ColumnTypeName, bn as SimpleCheckboxStateSchema, br as WireToolCall, bt as NumberFieldSchema, c as CheckboxMode, cn as SetStringPatchSchema, cr as ValidatorFn, ct as IssueScopeSchema, d as CheckboxProgressCountsSchema, dn as SetUrlListPatch, dr as ValidatorRegistry, dt as MultiCheckboxState, en as SetMultiSelectPatchSchema, er as UrlListFieldSchema, et as IdSchema, f as CheckboxValue, fn as SetUrlListPatchSchema, fr as WireFormat, ft as MultiCheckboxStateSchema, g as CheckboxesValue, gn as SetYearPatchSchema, gr as WireResponseFormat, gt as MultiSelectValueSchema, h as CheckboxesFieldSchema, hn as SetYearPatch, hr as WireRequestFormatSchema, ht as MultiSelectValue, i as ApplyResultSchema, in as SetSingleSelectPatchSchema, ir as UrlValueSchema, it as InspectResultSchema, j as ExplicitCheckboxValueSchema, jn as StringField, jt as ProgressCounts, k as DocumentationTagSchema, kn as StepResult, kt as PatchRejection, l as CheckboxModeSchema, ln as SetTablePatch, lr as ValidatorRef, lt as MarkformFrontmatter, m as CheckboxesField, mn as SetUrlPatchSchema, mr as WireRequestFormat, mt as MultiSelectFieldSchema, n as AnswerStateSchema, nn as SetNumberPatchSchema, nr as UrlListValueSchema, nt as InspectIssueSchema, o as CellResponse, on as SetStringListPatchSchema, or as ValidationIssueSchema, ot as IssueReasonSchema, p as CheckboxValueSchema, pn as SetUrlPatch, pr as WireFormatSchema, pt as MultiSelectField, q as FormSchema, qn as TableRowResponse, qt as SessionTurnSchema, r as ApplyResult, rn as SetSingleSelectPatch, rr as UrlValue, rt as InspectResult, s as CellResponseSchema, sn as SetStringPatch, sr as ValidatorContext, st as IssueScope, t as AnswerState, tn as SetNumberPatch, tr as UrlListValue, tt as InspectIssue, u as CheckboxProgressCounts, un as SetTablePatchSchema, ur as ValidatorRefSchema, ut as MarkformFrontmatterSchema, v as ClearFieldPatch, vn as SeveritySchema, vr as WireResponseStep, vt as Note, w as DateValue, wn as SingleSelectValueSchema, wr as YearField, wt as OptionId, x as ColumnTypeNameSchema, xn as SingleSelectField, xr as WireToolCallSchema, xt as NumberValue, y as ClearFieldPatchSchema, yn as SimpleCheckboxState, yr as WireResponseStepSchema, yt as NumberField, z as FieldProgress, zn as StructureSummary, zt as RunMode } from "./coreTypes-2Duxp-Wo.mjs";
|
|
3
3
|
import { LanguageModel, Tool } from "ai";
|
|
4
4
|
|
|
5
5
|
//#region src/errors.d.ts
|
|
@@ -325,11 +325,12 @@ declare function serializeSession(session: SessionTranscript): string;
|
|
|
325
325
|
/**
|
|
326
326
|
* Apply patches to a parsed form.
|
|
327
327
|
*
|
|
328
|
-
* Uses
|
|
328
|
+
* Uses best-effort semantics: valid patches are applied even when some fail.
|
|
329
|
+
* Invalid patches are rejected with detailed error messages.
|
|
329
330
|
*
|
|
330
331
|
* @param form - The parsed form to update
|
|
331
332
|
* @param patches - Array of patches to apply
|
|
332
|
-
* @returns Apply result with new summaries and
|
|
333
|
+
* @returns Apply result with new summaries, status, and detailed feedback
|
|
333
334
|
*/
|
|
334
335
|
declare function applyPatches(form: ParsedForm, patches: Patch[]): ApplyResult;
|
|
335
336
|
//#endregion
|
|
@@ -880,6 +881,8 @@ interface FillOptions {
|
|
|
880
881
|
maxPatchesPerTurn?: number;
|
|
881
882
|
/** Maximum issues to show per turn (default: 10) */
|
|
882
883
|
maxIssuesPerTurn?: number;
|
|
884
|
+
/** Maximum AI SDK steps (tool call rounds) per turn (default: 20) */
|
|
885
|
+
maxStepsPerTurn?: number;
|
|
883
886
|
/** Target roles to fill (default: ['agent']) */
|
|
884
887
|
targetRoles?: string[];
|
|
885
888
|
/** Fill mode: 'continue' (skip filled) or 'overwrite' (re-fill) */
|
package/dist/index.mjs
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
|
|
2
|
-
import { $ as SetUrlListPatchSchema, A as MultiCheckboxStateSchema, At as WireToolResultSchema, B as ProgressSummarySchema, C as HarnessConfigSchema, Ct as ValidationIssueSchema, D as IssueReasonSchema, Dt as WireResponseFormatSchema, E as InspectResultSchema, Et as WireRequestFormatSchema, F as OptionIdSchema, G as SetCheckboxesPatchSchema, H as SessionFinalSchema, I as OptionSchema, J as SetNumberPatchSchema, K as SetDatePatchSchema, L as PatchSchema, M as MultiSelectValueSchema, Mt as YearValueSchema, N as NumberFieldSchema, O as IssueScopeSchema, Ot as WireResponseStepSchema, P as NumberValueSchema, Q as SetTablePatchSchema, R as ProgressCountsSchema, S as FormSchemaSchema, St as UrlValueSchema, T as InspectIssueSchema, Tt as WireFormatSchema, U as SessionTranscriptSchema, V as RunModeSchema, W as SessionTurnSchema, X as SetStringListPatchSchema, Y as SetSingleSelectPatchSchema, Z as SetStringPatchSchema, _ as FieldKindSchema, _t as TableRowResponseSchema, a as CheckboxProgressCountsSchema, at as SingleSelectValueSchema, b as FieldSchema, bt as UrlListFieldSchema, c as CheckboxesValueSchema, ct as StepResultSchema, d as DateFieldSchema, dt as StringListValueSchema, et as SetUrlPatchSchema, f as DateValueSchema, ft as StringValueSchema, g as FieldGroupSchema, gt as TableRowPatchSchema, h as ExplicitCheckboxValueSchema, ht as TableFieldSchema, i as CheckboxModeSchema, it as SingleSelectFieldSchema, j as MultiSelectFieldSchema, jt as YearFieldSchema, k as MarkformFrontmatterSchema, kt as WireToolCallSchema, l as ClearFieldPatchSchema, lt as StringFieldSchema, m as DocumentationTagSchema, mt as TableColumnSchema, n as ApplyResultSchema, nt as SeveritySchema, o as CheckboxValueSchema, ot as SourcePositionSchema, p as DocumentationBlockSchema, pt as StructureSummarySchema, q as SetMultiSelectPatchSchema, r as CellResponseSchema, rt as SimpleCheckboxStateSchema, s as CheckboxesFieldSchema, st as SourceRangeSchema, t as AnswerStateSchema, tt as SetYearPatchSchema, u as ColumnTypeNameSchema, ut as StringListFieldSchema, v as FieldProgressSchema, vt as TableValueSchema, w as IdSchema, wt as ValidatorRefSchema, x as FieldValueSchema, xt as UrlListValueSchema, y as FieldResponseSchema, yt as UrlFieldSchema, z as ProgressStateSchema } from "./coreTypes-
|
|
3
|
-
import { $ as
|
|
4
|
-
import { A as parseRawTable, C as parseScopeRef, D as parseForm, E as formToJsonSchema, O as parseCellValue, S as isQualifiedRef, T as fieldToJsonSchema, _ as coerceToFieldPatch, a as resolveHarnessConfig, b as isCellRef, f as MockAgent, g as coerceInputContext, h as createHarness, i as runResearch, k as parseMarkdownTable, m as FormHarness, n as isResearchForm, o as fillForm, p as createMockAgent, r as validateResearchForm, t as VERSION, v as findFieldById, w as serializeScopeRef, x as isFieldRef, y as getFieldId } from "./src-
|
|
5
|
-
import { n as serializeSession, t as parseSession } from "./session-
|
|
2
|
+
import { $ as SetUrlListPatchSchema, A as MultiCheckboxStateSchema, At as WireToolResultSchema, B as ProgressSummarySchema, C as HarnessConfigSchema, Ct as ValidationIssueSchema, D as IssueReasonSchema, Dt as WireResponseFormatSchema, E as InspectResultSchema, Et as WireRequestFormatSchema, F as OptionIdSchema, G as SetCheckboxesPatchSchema, H as SessionFinalSchema, I as OptionSchema, J as SetNumberPatchSchema, K as SetDatePatchSchema, L as PatchSchema, M as MultiSelectValueSchema, Mt as YearValueSchema, N as NumberFieldSchema, O as IssueScopeSchema, Ot as WireResponseStepSchema, P as NumberValueSchema, Q as SetTablePatchSchema, R as ProgressCountsSchema, S as FormSchemaSchema, St as UrlValueSchema, T as InspectIssueSchema, Tt as WireFormatSchema, U as SessionTranscriptSchema, V as RunModeSchema, W as SessionTurnSchema, X as SetStringListPatchSchema, Y as SetSingleSelectPatchSchema, Z as SetStringPatchSchema, _ as FieldKindSchema, _t as TableRowResponseSchema, a as CheckboxProgressCountsSchema, at as SingleSelectValueSchema, b as FieldSchema, bt as UrlListFieldSchema, c as CheckboxesValueSchema, ct as StepResultSchema, d as DateFieldSchema, dt as StringListValueSchema, et as SetUrlPatchSchema, f as DateValueSchema, ft as StringValueSchema, g as FieldGroupSchema, gt as TableRowPatchSchema, h as ExplicitCheckboxValueSchema, ht as TableFieldSchema, i as CheckboxModeSchema, it as SingleSelectFieldSchema, j as MultiSelectFieldSchema, jt as YearFieldSchema, k as MarkformFrontmatterSchema, kt as WireToolCallSchema, l as ClearFieldPatchSchema, lt as StringFieldSchema, m as DocumentationTagSchema, mt as TableColumnSchema, n as ApplyResultSchema, nt as SeveritySchema, o as CheckboxValueSchema, ot as SourcePositionSchema, p as DocumentationBlockSchema, pt as StructureSummarySchema, q as SetMultiSelectPatchSchema, r as CellResponseSchema, rt as SimpleCheckboxStateSchema, s as CheckboxesFieldSchema, st as SourceRangeSchema, t as AnswerStateSchema, tt as SetYearPatchSchema, u as ColumnTypeNameSchema, ut as StringListFieldSchema, v as FieldProgressSchema, vt as TableValueSchema, w as IdSchema, wt as ValidatorRefSchema, x as FieldValueSchema, xt as UrlListValueSchema, y as FieldResponseSchema, yt as UrlFieldSchema, z as ProgressStateSchema } from "./coreTypes-Big8sgih.mjs";
|
|
3
|
+
import { $ as isParseError, G as MarkformParseError, H as MarkformConfigError, J as ParseError, K as MarkformPatchError, Q as isMarkformError, U as MarkformError, V as MarkformAbortError, W as MarkformLlmError, X as isConfigError, Y as isAbortError, Z as isLlmError, a as validate, c as computeProgressSummary, d as serializeForm, et as isPatchError, i as inspect, l as computeStructureSummary, nt as isValidationError, o as computeAllSummaries, p as serializeReport, q as MarkformValidationError, s as computeFormState, t as applyPatches, tt as isRetryableError, u as isFormComplete } from "./apply-D5FLd9Yp.mjs";
|
|
4
|
+
import { A as parseRawTable, C as parseScopeRef, D as parseForm, E as formToJsonSchema, O as parseCellValue, S as isQualifiedRef, T as fieldToJsonSchema, _ as coerceToFieldPatch, a as resolveHarnessConfig, b as isCellRef, f as MockAgent, g as coerceInputContext, h as createHarness, i as runResearch, k as parseMarkdownTable, m as FormHarness, n as isResearchForm, o as fillForm, p as createMockAgent, r as validateResearchForm, t as VERSION, v as findFieldById, w as serializeScopeRef, x as isFieldRef, y as getFieldId } from "./src-DuA3kv-E.mjs";
|
|
5
|
+
import { n as serializeSession, t as parseSession } from "./session-CrhOG4eH.mjs";
|
|
6
6
|
|
|
7
7
|
export { AnswerStateSchema, ApplyResultSchema, CellResponseSchema, CheckboxModeSchema, CheckboxProgressCountsSchema, CheckboxValueSchema, CheckboxesFieldSchema, CheckboxesValueSchema, ClearFieldPatchSchema, ColumnTypeNameSchema, DateFieldSchema, DateValueSchema, DocumentationBlockSchema, DocumentationTagSchema, ExplicitCheckboxValueSchema, FieldGroupSchema, FieldKindSchema, FieldProgressSchema, FieldResponseSchema, FieldSchema, FieldValueSchema, FormHarness, FormSchemaSchema, HarnessConfigSchema, IdSchema, InspectIssueSchema, InspectResultSchema, IssueReasonSchema, IssueScopeSchema, MarkformAbortError, MarkformConfigError, MarkformError, MarkformFrontmatterSchema, MarkformLlmError, MarkformParseError, MarkformPatchError, MarkformValidationError, MockAgent, MultiCheckboxStateSchema, MultiSelectFieldSchema, MultiSelectValueSchema, NumberFieldSchema, NumberValueSchema, OptionIdSchema, OptionSchema, ParseError, PatchSchema, ProgressCountsSchema, ProgressStateSchema, ProgressSummarySchema, RunModeSchema, SessionFinalSchema, SessionTranscriptSchema, SessionTurnSchema, SetCheckboxesPatchSchema, SetDatePatchSchema, SetMultiSelectPatchSchema, SetNumberPatchSchema, SetSingleSelectPatchSchema, SetStringListPatchSchema, SetStringPatchSchema, SetTablePatchSchema, SetUrlListPatchSchema, SetUrlPatchSchema, SetYearPatchSchema, SeveritySchema, SimpleCheckboxStateSchema, SingleSelectFieldSchema, SingleSelectValueSchema, SourcePositionSchema, SourceRangeSchema, StepResultSchema, StringFieldSchema, StringListFieldSchema, StringListValueSchema, StringValueSchema, StructureSummarySchema, TableColumnSchema, TableFieldSchema, TableRowPatchSchema, TableRowResponseSchema, TableValueSchema, UrlFieldSchema, UrlListFieldSchema, UrlListValueSchema, UrlValueSchema, VERSION, ValidationIssueSchema, ValidatorRefSchema, WireFormatSchema, WireRequestFormatSchema, WireResponseFormatSchema, WireResponseStepSchema, WireToolCallSchema, WireToolResultSchema, YearFieldSchema, YearValueSchema, applyPatches, coerceInputContext, coerceToFieldPatch, computeAllSummaries, computeFormState, computeProgressSummary, computeStructureSummary, createHarness, createMockAgent, fieldToJsonSchema, fillForm, findFieldById, formToJsonSchema, getFieldId, inspect, isAbortError, isCellRef, isConfigError, isFieldRef, isFormComplete, isLlmError, isMarkformError, isParseError, isPatchError, isQualifiedRef, isResearchForm, isRetryableError, isValidationError, parseCellValue, parseForm, parseMarkdownTable, parseRawTable, parseScopeRef, parseSession, resolveHarnessConfig, runResearch, serializeForm, serializeReport, serializeScopeRef, serializeSession, validate, validateResearchForm };
|