@jini-ai/core 0.6.19 → 0.6.21
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 +4 -0
- package/dist/approval.d.ts +10 -0
- package/dist/approval.js +14 -0
- package/package.json +1 -1
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,9 @@
|
|
|
1
1
|
# @jini-ai/core
|
|
2
2
|
|
|
3
|
+
## 0.6.21
|
|
4
|
+
|
|
5
|
+
- `createPreparedBatchHandler`: prepares a complete direct batch before any effect, reusing the approval handler's input snapshot, cap, duplicate detection and cancellation lifecycle, with no review card.
|
|
6
|
+
|
|
3
7
|
## 0.6.19
|
|
4
8
|
|
|
5
9
|
- Preserve detached, frozen batch schema symbol metadata in tool exposure snapshots and single-call required-field guidance in plan-mode descriptions.
|
package/dist/approval.d.ts
CHANGED
|
@@ -73,6 +73,16 @@ export interface ApprovalSteps<TPrepared, TDescription> {
|
|
|
73
73
|
export declare function createApprovalHandler<TPrepared, TDescription>(steps: ApprovalSteps<TPrepared, TDescription>, { remembered }?: {
|
|
74
74
|
remembered?: RememberedApprovalPort;
|
|
75
75
|
}): ToolHandler;
|
|
76
|
+
/** Prepare a complete direct batch before effects, reusing the approval owner's input snapshot,
|
|
77
|
+
* cap, duplicate detection and cancellation lifecycle. No review description or transport exists.
|
|
78
|
+
* @returns A handler preserving scalar results and ordered batch results.
|
|
79
|
+
* @throws ToolInputError on cancellation or invalid batches; preparation/effect failures propagate.
|
|
80
|
+
* @complexity Same bounds as createBatchApprovalHandler: O(input bytes) plus bounded port effects.
|
|
81
|
+
* @example createPreparedBatchHandler({ prepare, run });
|
|
82
|
+
*/
|
|
83
|
+
export declare function createPreparedBatchHandler<TPrepared>(steps: Pick<ApprovalSteps<TPrepared, undefined>, 'prepare' | 'run'>, options?: {
|
|
84
|
+
maxItems?: number;
|
|
85
|
+
}): ToolHandler;
|
|
76
86
|
/** Prepare every item before asking once for the complete batch. Reuses the single-call approval
|
|
77
87
|
* lifecycle, including its detached inputs, authenticated confirmer and abort checks.
|
|
78
88
|
* Single inputs preserve their result shape. Batch effects run in order and stop on the first
|
package/dist/approval.js
CHANGED
|
@@ -90,6 +90,20 @@ export function createApprovalHandler(steps, { remembered } = {}) {
|
|
|
90
90
|
},
|
|
91
91
|
});
|
|
92
92
|
}
|
|
93
|
+
/** Prepare a complete direct batch before effects, reusing the approval owner's input snapshot,
|
|
94
|
+
* cap, duplicate detection and cancellation lifecycle. No review description or transport exists.
|
|
95
|
+
* @returns A handler preserving scalar results and ordered batch results.
|
|
96
|
+
* @throws ToolInputError on cancellation or invalid batches; preparation/effect failures propagate.
|
|
97
|
+
* @complexity Same bounds as createBatchApprovalHandler: O(input bytes) plus bounded port effects.
|
|
98
|
+
* @example createPreparedBatchHandler({ prepare, run });
|
|
99
|
+
*/
|
|
100
|
+
export function createPreparedBatchHandler(steps, options = {}) {
|
|
101
|
+
return createBatchApprovalHandler({ steps: { ...steps,
|
|
102
|
+
describe: () => ({ ask: false, description: undefined }),
|
|
103
|
+
askHuman: async () => { throw new Error('Direct batches have no approval transport'); },
|
|
104
|
+
notConfirmed: ({ reason }) => { throw new ToolInputError({ message: `This tool call was ${reason} before the next change. Retry the remaining changes when ready.` }); },
|
|
105
|
+
}, combineDescriptions: () => undefined }, options);
|
|
106
|
+
}
|
|
93
107
|
/** Prepare every item before asking once for the complete batch. Reuses the single-call approval
|
|
94
108
|
* lifecycle, including its detached inputs, authenticated confirmer and abort checks.
|
|
95
109
|
* Single inputs preserve their result shape. Batch effects run in order and stop on the first
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@jini-ai/core",
|
|
3
|
-
"version": "0.6.
|
|
3
|
+
"version": "0.6.21",
|
|
4
4
|
"description": "The Jini kernel: typed DI tokens, pack composition and lifecycle, the tool registry, redaction, and origin/API-token auth primitives. Zero dependencies.",
|
|
5
5
|
"license": "Apache-2.0",
|
|
6
6
|
"repository": {
|