@staff0rd/assist 0.1213.2 → 0.1214.0
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/.build-files +81 -81
- package/dist/{addActivity-3EIPBUTW.js → addActivity-WLEREK6S.js} +2 -2
- package/dist/{addPhase-2L44BROM.js → addPhase-QZJV42LT.js} +3 -3
- package/dist/{advise-DQ3PRCPY.js → advise-5THTRMZU.js} +3 -3
- package/dist/{askCheck-IZBAQIYI.js → askCheck-5T4VYDAE.js} +7 -7
- package/dist/{askDesign-ACKAWPGF.js → askDesign-3CYL6V6S.js} +1 -1
- package/dist/{branch-NUGTOJEQ.js → branch-E6NNTI5B.js} +3 -3
- package/dist/built-version +1 -1
- package/dist/{chunk-X76ZC7OC.js → chunk-5YZRUE2O.js} +1 -1
- package/dist/{chunk-Y6P5C6PQ.js → chunk-74YIV5PU.js} +7 -7
- package/dist/{chunk-BWFIWG5Z.js → chunk-7XRKREJ5.js} +1 -1
- package/dist/{chunk-ZQV2VYHK.js → chunk-AZPGWWRD.js} +1 -1
- package/dist/{chunk-KBS7CW76.js → chunk-B64KPPKV.js} +1 -1
- package/dist/{chunk-LGY5OE5H.js → chunk-BLDYUHH5.js} +1 -1
- package/dist/{chunk-APD2IEY6.js → chunk-C2TWNP4O.js} +1 -1
- package/dist/{chunk-WQN4KHMR.js → chunk-CGRXKBLB.js} +6 -6
- package/dist/{chunk-654EZCLQ.js → chunk-CT364X7G.js} +1 -1
- package/dist/{chunk-DCLGXELS.js → chunk-DU4L4EOJ.js} +1 -1
- package/dist/{chunk-LUHIGYK4.js → chunk-EA3XAFFA.js} +2 -2
- package/dist/{chunk-CDI7X4YQ.js → chunk-EAMHKVRO.js} +1 -1
- package/dist/{chunk-PBFA5KUQ.js → chunk-F3QYRXOU.js} +1 -1
- package/dist/{chunk-RI3JT2F6.js → chunk-GPLGZH22.js} +1 -1
- package/dist/{chunk-EREBM27C.js → chunk-HYMSYVT4.js} +1 -1
- package/dist/{chunk-PBDOARKC.js → chunk-I34RLNRZ.js} +3 -3
- package/dist/{chunk-QHWGT3MB.js → chunk-IHHE5QX2.js} +1 -1
- package/dist/{chunk-TCPFVNSF.js → chunk-J43DTOUI.js} +1 -1
- package/dist/{chunk-SXPRDIR4.js → chunk-JFAGJ4OH.js} +1 -1
- package/dist/{chunk-M5YRR6AZ.js → chunk-JKAJD2M6.js} +5 -5
- package/dist/{chunk-25ORJ4V5.js → chunk-JRTINAVH.js} +1 -1
- package/dist/{chunk-Q543SWGW.js → chunk-KNCMXHIU.js} +1 -1
- package/dist/{chunk-V3EB3YOL.js → chunk-MMQBAXCE.js} +1 -1
- package/dist/{chunk-DVHJAS57.js → chunk-N3FVHMLA.js} +1 -1
- package/dist/{chunk-K5XI4RE3.js → chunk-NGRN34EK.js} +1 -1
- package/dist/{chunk-ZNXCAHNG.js → chunk-O6Q4JWN7.js} +1 -1
- package/dist/{chunk-VRS4UKBC.js → chunk-OI2TSNWI.js} +1 -1
- package/dist/{chunk-SVUSRDLY.js → chunk-Q5L3GBM3.js} +2 -2
- package/dist/{chunk-EJHSPFJI.js → chunk-QJ3Q7SV7.js} +1 -1
- package/dist/{chunk-FMP3VC43.js → chunk-QPPBG6M7.js} +322 -48
- package/dist/{chunk-HHQRS2AU.js → chunk-RU3C3FRL.js} +2 -2
- package/dist/{chunk-EZTEBMK5.js → chunk-S5G4EVHG.js} +2 -2
- package/dist/{chunk-4WJMXSPD.js → chunk-WC6J2PBT.js} +1 -1
- package/dist/{chunk-V6IHPBP3.js → chunk-XA4T6AIZ.js} +2 -2
- package/dist/{chunk-SIXXVTQR.js → chunk-XBEUDQK7.js} +2 -2
- package/dist/{chunk-NBFZZQMA.js → chunk-YT265ZZN.js} +3 -3
- package/dist/{chunk-NIJVRUOL.js → chunk-ZFFJBAKX.js} +1 -1
- package/dist/{chunk-MKITEB2N.js → chunk-ZYQSZ6FB.js} +1 -1
- package/dist/{cliHook-2P55B6BT.js → cliHook-4D4LISRU.js} +6 -6
- package/dist/{cliHookCheck-TRTDCTAO.js → cliHookCheck-N7Y7LGBT.js} +2 -2
- package/dist/{codexHook-QQZD6DUH.js → codexHook-Y4COLYV6.js} +8 -8
- package/dist/commands/sessions/web/bundle.js +323 -323
- package/dist/{commit-2O3IJ5JJ.js → commit-O2KBD22J.js} +4 -4
- package/dist/{doctorNodes-XFMNXZKW.js → doctorNodes-PN3H5W5O.js} +3 -3
- package/dist/{done-MC3YZLNW.js → done-SPU5EUVS.js} +4 -4
- package/dist/{editHook-O6RD55H6.js → editHook-M2B5PM72.js} +6 -6
- package/dist/{fixConflict-EID7CDKW.js → fixConflict-2GLJCN7U.js} +4 -4
- package/dist/index.js +50 -50
- package/dist/{launchMode-SF4N7CFD.js → launchMode-BRJSCO2I.js} +14 -14
- package/dist/{list-LJMNT7KR.js → list-QPIQ7SBP.js} +5 -5
- package/dist/{migrate-6TR6DPWF.js → migrate-IYLDSCPZ.js} +3 -3
- package/dist/{next-MNLKDCPQ.js → next-BDHKGIWA.js} +13 -13
- package/dist/{phaseDone-BJQJZDQL.js → phaseDone-IXGC6PEA.js} +5 -5
- package/dist/{piHook-MHCOKIAX.js → piHook-TP5BAMBD.js} +6 -6
- package/dist/{propose-PQN44LHS.js → propose-YI6GRXLS.js} +4 -4
- package/dist/{refine-5PWK3FNY.js → refine-C5BXW2J3.js} +15 -15
- package/dist/{restartNode-64X6V6OO.js → restartNode-ULUCEZCU.js} +5 -5
- package/dist/{review-PRU4WYMP.js → review-3DKFGPGK.js} +4 -4
- package/dist/{reviewPrComments-W6NDAEGY.js → reviewPrComments-LCEVPQBL.js} +4 -4
- package/dist/{rewindPhase-H7HMW6CP.js → rewindPhase-2KIEXBDU.js} +8 -8
- package/dist/{run-DBU5B74Q.js → run-MWLHRVOF.js} +11 -11
- package/dist/{run-EZGJ23EC.js → run-VZWSXEAB.js} +11 -11
- package/dist/{runDaemon-J63CEC4C.js → runDaemon-3V34QP5Q.js} +14 -14
- package/dist/{runParallelPhase-L6OAKOGW.js → runParallelPhase-RSOTL3M3.js} +7 -7
- package/dist/{runRefine-VO7H5WOU.js → runRefine-2XXWUSY7.js} +15 -15
- package/dist/{scan-GD5Y6DO3.js → scan-5FILQLN6.js} +2 -2
- package/dist/{schemaConfirm-QZHHVKYN.js → schemaConfirm-YK5HAMPP.js} +2 -2
- package/dist/{schemaLock-B4N5VBN6.js → schemaLock-TP2G7QZC.js} +2 -2
- package/dist/{schemaUnlock-6ONJWLFG.js → schemaUnlock-4UR4JREF.js} +2 -2
- package/dist/{search-5ZOW6C6F.js → search-XBMTV42H.js} +5 -5
- package/dist/{show-BMUONGWF.js → show-ANI44V7N.js} +3 -3
- package/dist/{show-CTLQ5FE7.js → show-QWC64PQO.js} +3 -3
- package/dist/{signExtension-MGE6QOGB.js → signExtension-PCLDZ7Z6.js} +1 -1
- package/dist/{updateNode-RXSKARHZ.js → updateNode-WPWB4XLO.js} +5 -5
- package/dist/{updatePlan-KYPLY23N.js → updatePlan-CZII6UIC.js} +4 -4
- package/dist/{web-H6EVJR67.js → web-4LMQD5LI.js} +16 -16
- package/dist/{web-3TMSJGCF.js → web-BP3AUMBE.js} +16 -16
- package/package.json +1 -1
|
@@ -2715,6 +2715,19 @@ function codexInnerCallView(call) {
|
|
|
2715
2715
|
return call.tool === "exec_command" ? execCommandView(call.args) : writeStdinView(call.args);
|
|
2716
2716
|
}
|
|
2717
2717
|
|
|
2718
|
+
// src/shared/harnessAdapters/codexExec/isOutputExpression.ts
|
|
2719
|
+
var ALLOWED = /^[\w$.{}:,()[\]]+$/;
|
|
2720
|
+
var IDENTIFIER = /(?<![\w$.])[A-Za-z_$][\w$]*/g;
|
|
2721
|
+
function isOutputExpression(expression, bound) {
|
|
2722
|
+
const code = expression.replaceAll("...", "").replace(/JSON\.stringify\(/g, "(");
|
|
2723
|
+
if (!ALLOWED.test(code) || /[\w$]\(/.test(code)) return false;
|
|
2724
|
+
for (const match of code.matchAll(IDENTIFIER)) {
|
|
2725
|
+
const isKey = code[match.index + match[0].length] === ":";
|
|
2726
|
+
if (!isKey && !bound.has(match[0])) return false;
|
|
2727
|
+
}
|
|
2728
|
+
return true;
|
|
2729
|
+
}
|
|
2730
|
+
|
|
2718
2731
|
// src/shared/harnessAdapters/codexExec/readEscape.ts
|
|
2719
2732
|
var SIMPLE_ESCAPES = {
|
|
2720
2733
|
n: "\n",
|
|
@@ -2827,66 +2840,327 @@ function readJsLiteral(src, start) {
|
|
|
2827
2840
|
return number ? { value: Number(number[0]), end: i + number[0].length } : null;
|
|
2828
2841
|
}
|
|
2829
2842
|
|
|
2830
|
-
// src/shared/harnessAdapters/codexExec/
|
|
2831
|
-
var
|
|
2832
|
-
var CALL =
|
|
2833
|
-
var
|
|
2834
|
-
var
|
|
2835
|
-
|
|
2836
|
-
|
|
2837
|
-
|
|
2838
|
-
|
|
2839
|
-
|
|
2840
|
-
|
|
2841
|
-
)
|
|
2843
|
+
// src/shared/harnessAdapters/codexExec/replaceLiteralCalls.ts
|
|
2844
|
+
var CALL_PLACEHOLDER = "__CALL__";
|
|
2845
|
+
var CALL = /(?<![\w$])tools\s*\.\s*([\w$]+)\s*\(/g;
|
|
2846
|
+
var TOOLS = /(?<![\w$])tools(?![\w$])/;
|
|
2847
|
+
var INNER_TOOLS = /* @__PURE__ */ new Set(["exec_command", "write_stdin"]);
|
|
2848
|
+
function readCall(src, match) {
|
|
2849
|
+
if (!INNER_TOOLS.has(match[1])) return null;
|
|
2850
|
+
const args = readJsLiteral(src, match.index + match[0].length);
|
|
2851
|
+
const value = args?.value;
|
|
2852
|
+
if (!args || typeof value !== "object" || !value || Array.isArray(value))
|
|
2853
|
+
return null;
|
|
2854
|
+
const close = skipSpace(src, args.end);
|
|
2855
|
+
if (src[close] !== ")") return null;
|
|
2856
|
+
const call = { tool: match[1], args: value };
|
|
2857
|
+
return codexInnerCallView(call) && { call, end: close + 1 };
|
|
2858
|
+
}
|
|
2859
|
+
function replaceLiteralCalls(src) {
|
|
2860
|
+
const calls = [];
|
|
2861
|
+
let code = "";
|
|
2862
|
+
let last = 0;
|
|
2863
|
+
CALL.lastIndex = 0;
|
|
2864
|
+
for (let match = CALL.exec(src); match; match = CALL.exec(src)) {
|
|
2865
|
+
const read = readCall(src, match);
|
|
2866
|
+
if (!read) return null;
|
|
2867
|
+
calls.push(read.call);
|
|
2868
|
+
code += `${src.slice(last, match.index)}${CALL_PLACEHOLDER}`;
|
|
2869
|
+
last = read.end;
|
|
2870
|
+
CALL.lastIndex = read.end;
|
|
2871
|
+
}
|
|
2872
|
+
code += src.slice(last);
|
|
2873
|
+
return TOOLS.test(code) ? null : { code, calls };
|
|
2874
|
+
}
|
|
2875
|
+
|
|
2876
|
+
// src/shared/harnessAdapters/codexExec/jsPatterns.ts
|
|
2877
|
+
var LIST = String.raw`Promise\.all(?:Settled)?\(\[${CALL_PLACEHOLDER}(?:,${CALL_PLACEHOLDER})*,?\]\)`;
|
|
2878
|
+
var jsPatterns = {
|
|
2879
|
+
ID: String.raw`[A-Za-z_$][\w$]*`,
|
|
2880
|
+
DECL: "(?:const|let|var) ?",
|
|
2881
|
+
PRINT: String.raw`(?:text|console\.log)`,
|
|
2882
|
+
SOURCE: `(?:${CALL_PLACEHOLDER}|${LIST})`
|
|
2883
|
+
};
|
|
2884
|
+
|
|
2885
|
+
// src/shared/harnessAdapters/codexExec/isGlueStatement.ts
|
|
2886
|
+
var { DECL, ID, PRINT } = jsPatterns;
|
|
2887
|
+
var PRINT_EXPRESSION = new RegExp(`^${PRINT}\\((.+)\\)$`);
|
|
2888
|
+
var FOR_EACH_PRINT = new RegExp(`^(${ID})\\.forEach\\(${PRINT}\\)$`);
|
|
2889
|
+
var LOOPS = [
|
|
2890
|
+
{
|
|
2891
|
+
pattern: new RegExp(
|
|
2892
|
+
`^(${ID})\\.forEach\\(\\(?(${ID})(?:,(${ID}))?\\)?=>(.+)\\)$`
|
|
2893
|
+
),
|
|
2894
|
+
source: 1,
|
|
2895
|
+
params: [2, 3],
|
|
2896
|
+
body: 4
|
|
2897
|
+
},
|
|
2898
|
+
{
|
|
2899
|
+
pattern: new RegExp(`^for\\(${DECL}(${ID}) of (${ID})\\)(.+)$`),
|
|
2900
|
+
source: 2,
|
|
2901
|
+
params: [1],
|
|
2902
|
+
body: 3
|
|
2903
|
+
},
|
|
2904
|
+
{
|
|
2905
|
+
pattern: new RegExp(
|
|
2906
|
+
`^for\\(${DECL}(${ID})=0;\\1<(${ID})\\.length;(?:\\1\\+\\+|\\+\\+\\1)\\)(.+)$`
|
|
2907
|
+
),
|
|
2908
|
+
source: 2,
|
|
2909
|
+
params: [1],
|
|
2910
|
+
body: 3
|
|
2911
|
+
}
|
|
2842
2912
|
];
|
|
2843
|
-
function
|
|
2844
|
-
|
|
2845
|
-
|
|
2846
|
-
|
|
2847
|
-
|
|
2913
|
+
function isGlueBody(body, bound) {
|
|
2914
|
+
const inner = /^\{(.*)\}$/.exec(body)?.[1] ?? body;
|
|
2915
|
+
const statements = inner.split(";").filter(Boolean);
|
|
2916
|
+
return statements.length > 0 && statements.every((statement) => isGlueStatement(statement, bound));
|
|
2917
|
+
}
|
|
2918
|
+
function isGlueLoop(code, bound) {
|
|
2919
|
+
for (const { pattern, source, params, body } of LOOPS) {
|
|
2920
|
+
const match = pattern.exec(code);
|
|
2921
|
+
if (!match) continue;
|
|
2922
|
+
const names = params.map((i) => match[i]).filter(Boolean);
|
|
2923
|
+
return bound.has(match[source]) && isGlueBody(match[body], /* @__PURE__ */ new Set([...bound, ...names]));
|
|
2924
|
+
}
|
|
2925
|
+
return false;
|
|
2926
|
+
}
|
|
2927
|
+
function isGlueStatement(code, bound) {
|
|
2928
|
+
const print = PRINT_EXPRESSION.exec(code);
|
|
2929
|
+
if (print) return isOutputExpression(print[1], bound);
|
|
2930
|
+
const forEachPrint = FOR_EACH_PRINT.exec(code);
|
|
2931
|
+
if (forEachPrint) return bound.has(forEachPrint[1]);
|
|
2932
|
+
return isGlueLoop(code, bound);
|
|
2848
2933
|
}
|
|
2934
|
+
|
|
2935
|
+
// src/shared/harnessAdapters/codexExec/normaliseCode.ts
|
|
2849
2936
|
function normaliseCode(code) {
|
|
2850
|
-
return code.replace(/\s+/g, " ").trim().replace(/ (?=[^\w$])|(?<=[^\w$]) /g, "");
|
|
2937
|
+
return code.replace(/\s+/g, " ").trim().replace(/ (?=[^\w$])|(?<=[^\w$]) /g, "").replace(/;+$/, "");
|
|
2851
2938
|
}
|
|
2852
|
-
|
|
2853
|
-
|
|
2939
|
+
|
|
2940
|
+
// src/shared/harnessAdapters/codexExec/classifyStatement.ts
|
|
2941
|
+
var { DECL: DECL2, ID: ID2, PRINT: PRINT2, SOURCE } = jsPatterns;
|
|
2942
|
+
var AWAITED = `await ${SOURCE}`;
|
|
2943
|
+
var PRINTED = new RegExp(
|
|
2944
|
+
`^(?:(?:await )?${SOURCE}|${PRINT2}\\((?:${AWAITED}|\\(${AWAITED}\\)(?:\\.output)?|JSON\\.stringify\\(${AWAITED}\\))\\))$`
|
|
2945
|
+
);
|
|
2946
|
+
var ASSIGNED = new RegExp(
|
|
2947
|
+
`^${DECL2}(${ID2}|\\{[^{}]*\\}|\\[[^\\[\\]]*\\])=${AWAITED}$`
|
|
2948
|
+
);
|
|
2949
|
+
var LOOPED = new RegExp(`^for\\(${DECL2}(${ID2}) of ${AWAITED}\\)(.+)$`);
|
|
2950
|
+
var PATTERN_NAME = new RegExp(`^(?:\\.\\.\\.)?(?:${ID2}:)?(${ID2})$`);
|
|
2951
|
+
function boundNames(target) {
|
|
2952
|
+
if (!/^[{[]/.test(target)) return [target];
|
|
2953
|
+
const names = target.slice(1, -1).split(",").filter(Boolean);
|
|
2954
|
+
const matches = names.map((name) => PATTERN_NAME.exec(name)?.[1]);
|
|
2955
|
+
return matches.every((name) => name !== void 0) ? matches : null;
|
|
2956
|
+
}
|
|
2957
|
+
function callBinds(code, bound) {
|
|
2958
|
+
if (PRINTED.test(code)) return [];
|
|
2959
|
+
const assigned = ASSIGNED.exec(code);
|
|
2960
|
+
if (assigned) return boundNames(assigned[1]);
|
|
2961
|
+
const looped = LOOPED.exec(code);
|
|
2962
|
+
if (looped && isGlueBody(looped[2], /* @__PURE__ */ new Set([...bound, looped[1]])))
|
|
2963
|
+
return [];
|
|
2964
|
+
return null;
|
|
2854
2965
|
}
|
|
2966
|
+
function classifyStatement(source, bound) {
|
|
2967
|
+
const replaced = replaceLiteralCalls(source);
|
|
2968
|
+
if (!replaced) return { kind: "raw" };
|
|
2969
|
+
const code = normaliseCode(replaced.code);
|
|
2970
|
+
if (!replaced.calls.length)
|
|
2971
|
+
return isGlueStatement(code, bound) ? { kind: "glue" } : { kind: "raw" };
|
|
2972
|
+
const binds = callBinds(code, bound);
|
|
2973
|
+
return binds ? { kind: "call", calls: replaced.calls, binds } : { kind: "raw" };
|
|
2974
|
+
}
|
|
2975
|
+
|
|
2976
|
+
// src/shared/harnessAdapters/codexExec/closeStatement.ts
|
|
2977
|
+
function closeStatement(state, end) {
|
|
2978
|
+
if (state.open) state.spans.push({ start: state.open.start, end });
|
|
2979
|
+
state.open = null;
|
|
2980
|
+
}
|
|
2981
|
+
|
|
2982
|
+
// src/shared/harnessAdapters/codexExec/continuesAcrossNewline.ts
|
|
2983
|
+
var CONTINUING_WORDS = /* @__PURE__ */ new Set([
|
|
2984
|
+
"await",
|
|
2985
|
+
"const",
|
|
2986
|
+
"let",
|
|
2987
|
+
"var",
|
|
2988
|
+
"of",
|
|
2989
|
+
"in",
|
|
2990
|
+
"new",
|
|
2991
|
+
"typeof",
|
|
2992
|
+
"return",
|
|
2993
|
+
"yield",
|
|
2994
|
+
"else",
|
|
2995
|
+
"do"
|
|
2996
|
+
]);
|
|
2997
|
+
function continuesAcrossNewline(src, lastSignificant, next) {
|
|
2998
|
+
if (!/^(?:[\w$]|\/\/|\/\*)/.test(src.slice(next, next + 2))) return true;
|
|
2999
|
+
const prev = src[lastSignificant] ?? "";
|
|
3000
|
+
if (/[)\]}"'`]/.test(prev)) return false;
|
|
3001
|
+
if (!/[\w$]/.test(prev)) return true;
|
|
3002
|
+
const word = /[\w$]+$/.exec(src.slice(0, lastSignificant + 1))?.[0] ?? "";
|
|
3003
|
+
return CONTINUING_WORDS.has(word);
|
|
3004
|
+
}
|
|
3005
|
+
|
|
3006
|
+
// src/shared/harnessAdapters/codexExec/applyNewline.ts
|
|
3007
|
+
function applyNewline(state, i) {
|
|
3008
|
+
const open = state.open;
|
|
3009
|
+
if (!open || state.depth) return;
|
|
3010
|
+
if (open.header && open.body === "none") return;
|
|
3011
|
+
const next = skipSpace(state.src, i);
|
|
3012
|
+
if (!continuesAcrossNewline(state.src, state.last, next))
|
|
3013
|
+
closeStatement(state, state.last + 1);
|
|
3014
|
+
}
|
|
3015
|
+
|
|
3016
|
+
// src/shared/harnessAdapters/codexExec/markBody.ts
|
|
3017
|
+
function markBody(state, c) {
|
|
3018
|
+
const open = state.open;
|
|
3019
|
+
if (open?.headerDone && open.body === "none")
|
|
3020
|
+
open.body = c === "{" && state.depth === 0 ? "block" : "simple";
|
|
3021
|
+
}
|
|
3022
|
+
|
|
3023
|
+
// src/shared/harnessAdapters/codexExec/applyBracket.ts
|
|
3024
|
+
function applyBracket(state, c, i) {
|
|
3025
|
+
if ("([{".includes(c)) {
|
|
3026
|
+
markBody(state, c);
|
|
3027
|
+
state.depth++;
|
|
3028
|
+
return true;
|
|
3029
|
+
}
|
|
3030
|
+
state.depth--;
|
|
3031
|
+
if (state.depth < 0) return false;
|
|
3032
|
+
const open = state.open;
|
|
3033
|
+
if (state.depth || !open) return true;
|
|
3034
|
+
if (open.header && !open.headerDone && c === ")") open.headerDone = true;
|
|
3035
|
+
else if (open.body === "block" && c === "}") closeStatement(state, i + 1);
|
|
3036
|
+
return true;
|
|
3037
|
+
}
|
|
3038
|
+
|
|
3039
|
+
// src/shared/harnessAdapters/codexExec/skipQuoted.ts
|
|
3040
|
+
function skipQuoted(src, i) {
|
|
3041
|
+
const quote = src[i];
|
|
3042
|
+
let depth = 0;
|
|
3043
|
+
for (let j = i + 1; j < src.length; j++) {
|
|
3044
|
+
const c = src[j];
|
|
3045
|
+
if (c === "\\") j++;
|
|
3046
|
+
else if (quote === "`" && c === "$" && src[j + 1] === "{") {
|
|
3047
|
+
depth++;
|
|
3048
|
+
j++;
|
|
3049
|
+
} else if (depth && c === "}") depth--;
|
|
3050
|
+
else if (!depth && c === quote) return j + 1;
|
|
3051
|
+
else if (quote !== "`" && c === "\n") return -1;
|
|
3052
|
+
}
|
|
3053
|
+
return -1;
|
|
3054
|
+
}
|
|
3055
|
+
|
|
3056
|
+
// src/shared/harnessAdapters/codexExec/applyToken.ts
|
|
3057
|
+
var MALFORMED = -1;
|
|
3058
|
+
function applyToken(state, c, i) {
|
|
3059
|
+
if (c === '"' || c === "'" || c === "`") {
|
|
3060
|
+
markBody(state, c);
|
|
3061
|
+
return skipQuoted(state.src, i);
|
|
3062
|
+
}
|
|
3063
|
+
if ("()[]{}".includes(c))
|
|
3064
|
+
return applyBracket(state, c, i) ? i + 1 : MALFORMED;
|
|
3065
|
+
if (c === ";" && !state.depth) closeStatement(state, i + 1);
|
|
3066
|
+
else markBody(state, c);
|
|
3067
|
+
return i + 1;
|
|
3068
|
+
}
|
|
3069
|
+
|
|
3070
|
+
// src/shared/harnessAdapters/codexExec/skipComment.ts
|
|
3071
|
+
function skipComment(src, i) {
|
|
3072
|
+
if (src[i] !== "/") return i;
|
|
3073
|
+
if (src[i + 1] === "/") {
|
|
3074
|
+
const end = src.indexOf("\n", i);
|
|
3075
|
+
return end === -1 ? src.length : end;
|
|
3076
|
+
}
|
|
3077
|
+
if (src[i + 1] === "*") {
|
|
3078
|
+
const end = src.indexOf("*/", i + 2);
|
|
3079
|
+
return end === -1 ? -1 : end + 2;
|
|
3080
|
+
}
|
|
3081
|
+
return i;
|
|
3082
|
+
}
|
|
3083
|
+
|
|
3084
|
+
// src/shared/harnessAdapters/codexExec/splitStatements.ts
|
|
3085
|
+
var HEADER = /^(?:for|while|if)\s*\(/;
|
|
3086
|
+
function step(state, i) {
|
|
3087
|
+
const c = state.src[i];
|
|
3088
|
+
if (c === "\n") applyNewline(state, i);
|
|
3089
|
+
if (/\s/.test(c)) return i + 1;
|
|
3090
|
+
const afterComment = skipComment(state.src, i);
|
|
3091
|
+
if (afterComment !== i) return afterComment;
|
|
3092
|
+
if (!state.open && c === ";") return i + 1;
|
|
3093
|
+
if (!state.open) {
|
|
3094
|
+
const header = HEADER.test(state.src.slice(i));
|
|
3095
|
+
state.open = { start: i, header, headerDone: false, body: "none" };
|
|
3096
|
+
}
|
|
3097
|
+
const next = applyToken(state, c, i);
|
|
3098
|
+
if (next !== MALFORMED) state.last = next - 1;
|
|
3099
|
+
return next;
|
|
3100
|
+
}
|
|
3101
|
+
function splitStatements(src) {
|
|
3102
|
+
const state = { src, spans: [], depth: 0, last: -1, open: null };
|
|
3103
|
+
for (let i = 0; i < src.length; ) {
|
|
3104
|
+
i = step(state, i);
|
|
3105
|
+
if (i === MALFORMED) return null;
|
|
3106
|
+
}
|
|
3107
|
+
if (state.depth) return null;
|
|
3108
|
+
closeStatement(state, state.last + 1);
|
|
3109
|
+
return state.spans;
|
|
3110
|
+
}
|
|
3111
|
+
|
|
3112
|
+
// src/shared/harnessAdapters/codexExec/parseCodexExecWrapper.ts
|
|
2855
3113
|
function parseCodexExecWrapper(input) {
|
|
2856
|
-
const
|
|
2857
|
-
|
|
2858
|
-
|
|
2859
|
-
const
|
|
2860
|
-
|
|
2861
|
-
const
|
|
2862
|
-
|
|
2863
|
-
|
|
2864
|
-
|
|
2865
|
-
|
|
2866
|
-
|
|
2867
|
-
|
|
3114
|
+
const spans = splitStatements(input);
|
|
3115
|
+
if (!spans) return null;
|
|
3116
|
+
const bound = /* @__PURE__ */ new Set();
|
|
3117
|
+
const parts = [];
|
|
3118
|
+
const raw = { start: -1, end: -1 };
|
|
3119
|
+
const flushRaw = () => {
|
|
3120
|
+
if (raw.start !== -1)
|
|
3121
|
+
parts.push({ kind: "raw", source: input.slice(raw.start, raw.end) });
|
|
3122
|
+
raw.start = -1;
|
|
3123
|
+
};
|
|
3124
|
+
for (const span of spans) {
|
|
3125
|
+
const statement = classifyStatement(
|
|
3126
|
+
input.slice(span.start, span.end),
|
|
3127
|
+
bound
|
|
3128
|
+
);
|
|
3129
|
+
if (statement.kind === "raw") {
|
|
3130
|
+
if (raw.start === -1) raw.start = span.start;
|
|
3131
|
+
raw.end = span.end;
|
|
3132
|
+
}
|
|
3133
|
+
if (statement.kind !== "call") continue;
|
|
3134
|
+
flushRaw();
|
|
3135
|
+
for (const name of statement.binds) bound.add(name);
|
|
3136
|
+
for (const call of statement.calls) parts.push({ kind: "call", call });
|
|
3137
|
+
}
|
|
3138
|
+
flushRaw();
|
|
3139
|
+
return parts.some((part) => part.kind === "call") ? parts : null;
|
|
2868
3140
|
}
|
|
2869
3141
|
|
|
2870
3142
|
// src/shared/harnessAdapters/codexExec/codexExecEvents.ts
|
|
3143
|
+
function rawEvent(source, operations2, at) {
|
|
3144
|
+
const target = source.trim();
|
|
3145
|
+
return {
|
|
3146
|
+
kind: "tool",
|
|
3147
|
+
tool: "exec",
|
|
3148
|
+
target,
|
|
3149
|
+
label: condensePreview(target),
|
|
3150
|
+
operations: operations2,
|
|
3151
|
+
at
|
|
3152
|
+
};
|
|
3153
|
+
}
|
|
2871
3154
|
function codexExecEvents(input, operations2, at) {
|
|
2872
|
-
const
|
|
2873
|
-
|
|
2874
|
-
|
|
2875
|
-
if (!view) return [];
|
|
3155
|
+
const parts = parseCodexExecWrapper(input);
|
|
3156
|
+
if (!parts) return [rawEvent(input, operations2, at)];
|
|
3157
|
+
return parts.map((part, i) => {
|
|
2876
3158
|
const ops = i === 0 ? operations2 : [];
|
|
2877
|
-
|
|
3159
|
+
if (part.kind === "raw") return rawEvent(part.source, ops, at);
|
|
3160
|
+
const view = codexInnerCallView(part.call);
|
|
3161
|
+
if (!view) return rawEvent(JSON.stringify(part.call), ops, at);
|
|
3162
|
+
return { kind: "tool", tool: part.call.tool, ...view, operations: ops, at };
|
|
2878
3163
|
});
|
|
2879
|
-
if (calls.length && events.length === calls.length) return events;
|
|
2880
|
-
return [
|
|
2881
|
-
{
|
|
2882
|
-
kind: "tool",
|
|
2883
|
-
tool: "exec",
|
|
2884
|
-
target: input.trim(),
|
|
2885
|
-
label: condensePreview(input),
|
|
2886
|
-
operations: operations2,
|
|
2887
|
-
at
|
|
2888
|
-
}
|
|
2889
|
-
];
|
|
2890
3164
|
}
|
|
2891
3165
|
|
|
2892
3166
|
// src/shared/harnessAdapters/codexAsyncQuestionOperation.ts
|
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
import {
|
|
2
2
|
resolveReviewPhase
|
|
3
|
-
} from "./chunk-
|
|
3
|
+
} from "./chunk-GPLGZH22.js";
|
|
4
4
|
import {
|
|
5
5
|
resolvePlan
|
|
6
|
-
} from "./chunk-
|
|
6
|
+
} from "./chunk-JFAGJ4OH.js";
|
|
7
7
|
|
|
8
8
|
// src/commands/backlog/resolveRewindPlan.ts
|
|
9
9
|
function resolveRewindPlan(item) {
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import {
|
|
2
2
|
checkoutPr
|
|
3
|
-
} from "./chunk-
|
|
3
|
+
} from "./chunk-O6Q4JWN7.js";
|
|
4
4
|
import {
|
|
5
5
|
launchBlocker
|
|
6
6
|
} from "./chunk-U3IQIWLI.js";
|
|
@@ -19,7 +19,7 @@ import {
|
|
|
19
19
|
} from "./chunk-3DNFNT2L.js";
|
|
20
20
|
import {
|
|
21
21
|
harnessAdapter
|
|
22
|
-
} from "./chunk-
|
|
22
|
+
} from "./chunk-QPPBG6M7.js";
|
|
23
23
|
|
|
24
24
|
// src/commands/launchPrSkill.ts
|
|
25
25
|
import chalk from "chalk";
|
|
@@ -6,10 +6,10 @@ import {
|
|
|
6
6
|
} from "./chunk-LQMXLKPW.js";
|
|
7
7
|
import {
|
|
8
8
|
resolveRewindPlan
|
|
9
|
-
} from "./chunk-
|
|
9
|
+
} from "./chunk-RU3C3FRL.js";
|
|
10
10
|
import {
|
|
11
11
|
resolvePlan
|
|
12
|
-
} from "./chunk-
|
|
12
|
+
} from "./chunk-JFAGJ4OH.js";
|
|
13
13
|
import {
|
|
14
14
|
resetPhaseAndDependents,
|
|
15
15
|
updateStatus
|
|
@@ -8,10 +8,10 @@ import {
|
|
|
8
8
|
isDocsPath,
|
|
9
9
|
isSchemaPath,
|
|
10
10
|
mentionsDocsPath
|
|
11
|
-
} from "./chunk-
|
|
11
|
+
} from "./chunk-5YZRUE2O.js";
|
|
12
12
|
import {
|
|
13
13
|
isSchemaLocked
|
|
14
|
-
} from "./chunk-
|
|
14
|
+
} from "./chunk-ZFFJBAKX.js";
|
|
15
15
|
import {
|
|
16
16
|
findBuiltinDenyRaw,
|
|
17
17
|
findDeny,
|
|
@@ -21,7 +21,7 @@ import {
|
|
|
21
21
|
isApprovedRead,
|
|
22
22
|
resolvePermission,
|
|
23
23
|
splitCompound
|
|
24
|
-
} from "./chunk-
|
|
24
|
+
} from "./chunk-OI2TSNWI.js";
|
|
25
25
|
import {
|
|
26
26
|
inWebSession
|
|
27
27
|
} from "./chunk-HKGCLAZ7.js";
|
|
@@ -1,16 +1,16 @@
|
|
|
1
1
|
import {
|
|
2
2
|
decideToolOperations,
|
|
3
3
|
logPolicyDeny
|
|
4
|
-
} from "./chunk-
|
|
4
|
+
} from "./chunk-YT265ZZN.js";
|
|
5
5
|
import "./chunk-CDU6M5IX.js";
|
|
6
|
-
import "./chunk-
|
|
7
|
-
import "./chunk-
|
|
6
|
+
import "./chunk-5YZRUE2O.js";
|
|
7
|
+
import "./chunk-ZFFJBAKX.js";
|
|
8
8
|
import "./chunk-ZN4PSZSA.js";
|
|
9
9
|
import {
|
|
10
10
|
currentExecutionIdentity
|
|
11
|
-
} from "./chunk-
|
|
11
|
+
} from "./chunk-HYMSYVT4.js";
|
|
12
12
|
import "./chunk-ZMH7UZNP.js";
|
|
13
|
-
import "./chunk-
|
|
13
|
+
import "./chunk-OI2TSNWI.js";
|
|
14
14
|
import "./chunk-VDXS55BC.js";
|
|
15
15
|
import "./chunk-HKGCLAZ7.js";
|
|
16
16
|
import "./chunk-FPWL4VRC.js";
|
|
@@ -28,7 +28,7 @@ import "./chunk-N3S5RZYX.js";
|
|
|
28
28
|
import "./chunk-JMHNLOLN.js";
|
|
29
29
|
import {
|
|
30
30
|
claudeAdapter
|
|
31
|
-
} from "./chunk-
|
|
31
|
+
} from "./chunk-QPPBG6M7.js";
|
|
32
32
|
import "./chunk-MRUIXQXS.js";
|
|
33
33
|
import "./chunk-YLQAQHRT.js";
|
|
34
34
|
import "./chunk-5AAHWTRQ.js";
|
|
@@ -5,9 +5,9 @@ import {
|
|
|
5
5
|
findTruncatedReadDenyRaw,
|
|
6
6
|
isApprovedRead,
|
|
7
7
|
splitCompound
|
|
8
|
-
} from "./chunk-
|
|
8
|
+
} from "./chunk-OI2TSNWI.js";
|
|
9
9
|
import "./chunk-VDXS55BC.js";
|
|
10
|
-
import "./chunk-
|
|
10
|
+
import "./chunk-QPPBG6M7.js";
|
|
11
11
|
import "./chunk-MRUIXQXS.js";
|
|
12
12
|
import "./chunk-YLQAQHRT.js";
|
|
13
13
|
import "./chunk-5AAHWTRQ.js";
|
|
@@ -1,16 +1,16 @@
|
|
|
1
1
|
import {
|
|
2
2
|
decideToolOperations,
|
|
3
3
|
logPolicyDeny
|
|
4
|
-
} from "./chunk-
|
|
4
|
+
} from "./chunk-YT265ZZN.js";
|
|
5
5
|
import "./chunk-CDU6M5IX.js";
|
|
6
|
-
import "./chunk-
|
|
7
|
-
import "./chunk-
|
|
6
|
+
import "./chunk-5YZRUE2O.js";
|
|
7
|
+
import "./chunk-ZFFJBAKX.js";
|
|
8
8
|
import "./chunk-ZN4PSZSA.js";
|
|
9
9
|
import {
|
|
10
10
|
currentExecutionIdentity
|
|
11
|
-
} from "./chunk-
|
|
11
|
+
} from "./chunk-HYMSYVT4.js";
|
|
12
12
|
import "./chunk-ZMH7UZNP.js";
|
|
13
|
-
import "./chunk-
|
|
13
|
+
import "./chunk-OI2TSNWI.js";
|
|
14
14
|
import "./chunk-VDXS55BC.js";
|
|
15
15
|
import "./chunk-HKGCLAZ7.js";
|
|
16
16
|
import {
|
|
@@ -20,7 +20,7 @@ import "./chunk-FPWL4VRC.js";
|
|
|
20
20
|
import "./chunk-H63MI5HI.js";
|
|
21
21
|
import {
|
|
22
22
|
adviceHookPayload
|
|
23
|
-
} from "./chunk-
|
|
23
|
+
} from "./chunk-AZPGWWRD.js";
|
|
24
24
|
import "./chunk-P7FVAGFQ.js";
|
|
25
25
|
import "./chunk-XJTXAL22.js";
|
|
26
26
|
import {
|
|
@@ -40,11 +40,11 @@ import "./chunk-2R4VODAU.js";
|
|
|
40
40
|
import "./chunk-J6ULAU7G.js";
|
|
41
41
|
import "./chunk-N3S5RZYX.js";
|
|
42
42
|
import "./chunk-JMHNLOLN.js";
|
|
43
|
-
import "./chunk-
|
|
43
|
+
import "./chunk-IHHE5QX2.js";
|
|
44
44
|
import "./chunk-QBDPUOLA.js";
|
|
45
45
|
import {
|
|
46
46
|
codexAdapter
|
|
47
|
-
} from "./chunk-
|
|
47
|
+
} from "./chunk-QPPBG6M7.js";
|
|
48
48
|
import "./chunk-MRUIXQXS.js";
|
|
49
49
|
import "./chunk-YLQAQHRT.js";
|
|
50
50
|
import "./chunk-5AAHWTRQ.js";
|