@optique/prompt 1.2.0-dev.2198 → 1.2.0-dev.2200
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/index.cjs +8 -6
- package/dist/index.js +8 -6
- package/package.json +5 -5
package/dist/index.cjs
CHANGED
|
@@ -222,9 +222,10 @@ function createPromptAdapter(adapter) {
|
|
|
222
222
|
const completeState = parseResult.success ? parseResult.next.state : effectiveInitialState;
|
|
223
223
|
const innerR = parser.complete(completeState, exec);
|
|
224
224
|
const handleCompleteResult = (res) => {
|
|
225
|
-
|
|
226
|
-
if (
|
|
227
|
-
return
|
|
225
|
+
const unwrapped = unwrapCompleteResult(res);
|
|
226
|
+
if (unwrapped.success && unwrapped.value === void 0 && cliStateIsInjected) return finalizePrompt();
|
|
227
|
+
if (!unwrapped.success) return finalizePrompt();
|
|
228
|
+
return Promise.resolve(unwrapped);
|
|
228
229
|
};
|
|
229
230
|
if (innerR instanceof Promise) return innerR.then(handleCompleteResult);
|
|
230
231
|
return handleCompleteResult(innerR);
|
|
@@ -232,9 +233,10 @@ function createPromptAdapter(adapter) {
|
|
|
232
233
|
if (hasDeferHook) {
|
|
233
234
|
const innerR = withAnnotatedInnerState(state, effectiveInitialState, (annotatedInnerState) => parser.complete(annotatedInnerState, exec), parserInheritsAnnotations);
|
|
234
235
|
const handleDeferHookResult = (res) => {
|
|
235
|
-
|
|
236
|
-
if (
|
|
237
|
-
return
|
|
236
|
+
const unwrapped = unwrapCompleteResult(res);
|
|
237
|
+
if (unwrapped.success && unwrapped.value === void 0) return finalizePrompt();
|
|
238
|
+
if (!unwrapped.success) return finalizePrompt();
|
|
239
|
+
return Promise.resolve(unwrapped);
|
|
238
240
|
};
|
|
239
241
|
if (innerR instanceof Promise) return innerR.then(handleDeferHookResult);
|
|
240
242
|
return handleDeferHookResult(innerR);
|
package/dist/index.js
CHANGED
|
@@ -199,9 +199,10 @@ function createPromptAdapter(adapter) {
|
|
|
199
199
|
const completeState = parseResult.success ? parseResult.next.state : effectiveInitialState;
|
|
200
200
|
const innerR = parser.complete(completeState, exec);
|
|
201
201
|
const handleCompleteResult = (res) => {
|
|
202
|
-
|
|
203
|
-
if (
|
|
204
|
-
return
|
|
202
|
+
const unwrapped = unwrapCompleteResult(res);
|
|
203
|
+
if (unwrapped.success && unwrapped.value === void 0 && cliStateIsInjected) return finalizePrompt();
|
|
204
|
+
if (!unwrapped.success) return finalizePrompt();
|
|
205
|
+
return Promise.resolve(unwrapped);
|
|
205
206
|
};
|
|
206
207
|
if (innerR instanceof Promise) return innerR.then(handleCompleteResult);
|
|
207
208
|
return handleCompleteResult(innerR);
|
|
@@ -209,9 +210,10 @@ function createPromptAdapter(adapter) {
|
|
|
209
210
|
if (hasDeferHook) {
|
|
210
211
|
const innerR = withAnnotatedInnerState(state, effectiveInitialState, (annotatedInnerState) => parser.complete(annotatedInnerState, exec), parserInheritsAnnotations);
|
|
211
212
|
const handleDeferHookResult = (res) => {
|
|
212
|
-
|
|
213
|
-
if (
|
|
214
|
-
return
|
|
213
|
+
const unwrapped = unwrapCompleteResult(res);
|
|
214
|
+
if (unwrapped.success && unwrapped.value === void 0) return finalizePrompt();
|
|
215
|
+
if (!unwrapped.success) return finalizePrompt();
|
|
216
|
+
return Promise.resolve(unwrapped);
|
|
215
217
|
};
|
|
216
218
|
if (innerR instanceof Promise) return innerR.then(handleDeferHookResult);
|
|
217
219
|
return handleDeferHookResult(innerR);
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@optique/prompt",
|
|
3
|
-
"version": "1.2.0-dev.
|
|
3
|
+
"version": "1.2.0-dev.2200",
|
|
4
4
|
"description": "Generic prompt adapter support for Optique",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"CLI",
|
|
@@ -60,16 +60,16 @@
|
|
|
60
60
|
},
|
|
61
61
|
"sideEffects": false,
|
|
62
62
|
"dependencies": {
|
|
63
|
-
"@optique/core": "1.2.0-dev.
|
|
63
|
+
"@optique/core": "1.2.0-dev.2200+9ff07852"
|
|
64
64
|
},
|
|
65
65
|
"devDependencies": {
|
|
66
66
|
"@types/node": "^24.0.0",
|
|
67
67
|
"fast-check": "^4.7.0",
|
|
68
68
|
"tsdown": "^0.13.0",
|
|
69
69
|
"typescript": "^5.8.3",
|
|
70
|
-
"@optique/config": "1.2.0-dev.
|
|
71
|
-
"@optique/env": "1.2.0-dev.
|
|
72
|
-
"@optique/run": "1.2.0-dev.
|
|
70
|
+
"@optique/config": "1.2.0-dev.2200+9ff07852",
|
|
71
|
+
"@optique/env": "1.2.0-dev.2200+9ff07852",
|
|
72
|
+
"@optique/run": "1.2.0-dev.2200+9ff07852"
|
|
73
73
|
},
|
|
74
74
|
"scripts": {
|
|
75
75
|
"build": "tsdown",
|