@cydm/pie 1.0.37 → 1.0.39
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/README.md +2 -0
- package/dist/builtin/extensions/ask-user/index.js +3 -3
- package/dist/builtin/extensions/plan-mode/index.js +71 -6
- package/dist/builtin/extensions/subagent/index.js +4 -4
- package/dist/builtin/extensions/todo/index.js +3 -3
- package/dist/chunks/{chunk-4B42ZU4B.js → chunk-7IFMKPHH.js} +1 -1
- package/dist/chunks/{chunk-QXTAEPLR.js → chunk-F6VAOGFL.js} +2 -2
- package/dist/chunks/{chunk-64XJIKVK.js → chunk-HPTWCKJE.js} +1721 -1700
- package/dist/chunks/{chunk-MGZHZSHB.js → chunk-SNSSIR3E.js} +272 -46
- package/dist/chunks/{src-27UD2ZBZ.js → src-N6MKSRB3.js} +2 -2
- package/dist/chunks/{test-stream-L4PUYWQQ.js → test-stream-6F6VZ44U.js} +1 -1
- package/dist/cli.js +36 -26
- package/models.schema.json +1 -0
- package/package.json +2 -2
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { createRequire as __createRequire } from "node:module"; const require = __createRequire(import.meta.url);
|
|
2
2
|
import {
|
|
3
3
|
Agent
|
|
4
|
-
} from "./chunk-
|
|
4
|
+
} from "./chunk-7IFMKPHH.js";
|
|
5
5
|
import {
|
|
6
6
|
FileSystemGateway,
|
|
7
7
|
Type,
|
|
@@ -11,7 +11,241 @@ import {
|
|
|
11
11
|
getPlatformConfig,
|
|
12
12
|
hashText,
|
|
13
13
|
streamSimple
|
|
14
|
-
} from "./chunk-
|
|
14
|
+
} from "./chunk-HPTWCKJE.js";
|
|
15
|
+
import {
|
|
16
|
+
__commonJS,
|
|
17
|
+
__toESM
|
|
18
|
+
} from "./chunk-TG2EQLX2.js";
|
|
19
|
+
|
|
20
|
+
// ../../node_modules/shell-quote/quote.js
|
|
21
|
+
var require_quote = __commonJS({
|
|
22
|
+
"../../node_modules/shell-quote/quote.js"(exports, module) {
|
|
23
|
+
"use strict";
|
|
24
|
+
module.exports = function quote(xs) {
|
|
25
|
+
return xs.map(function(s) {
|
|
26
|
+
if (s === "") {
|
|
27
|
+
return "''";
|
|
28
|
+
}
|
|
29
|
+
if (s && typeof s === "object") {
|
|
30
|
+
return s.op.replace(/(.)/g, "\\$1");
|
|
31
|
+
}
|
|
32
|
+
if (/["\s\\]/.test(s) && !/'/.test(s)) {
|
|
33
|
+
return "'" + s.replace(/(['])/g, "\\$1") + "'";
|
|
34
|
+
}
|
|
35
|
+
if (/["'\s]/.test(s)) {
|
|
36
|
+
return '"' + s.replace(/(["\\$`!])/g, "\\$1") + '"';
|
|
37
|
+
}
|
|
38
|
+
return String(s).replace(/([A-Za-z]:)?([#!"$&'()*,:;<=>?@[\\\]^`{|}])/g, "$1\\$2");
|
|
39
|
+
}).join(" ");
|
|
40
|
+
};
|
|
41
|
+
}
|
|
42
|
+
});
|
|
43
|
+
|
|
44
|
+
// ../../node_modules/shell-quote/parse.js
|
|
45
|
+
var require_parse = __commonJS({
|
|
46
|
+
"../../node_modules/shell-quote/parse.js"(exports, module) {
|
|
47
|
+
"use strict";
|
|
48
|
+
var CONTROL = "(?:" + [
|
|
49
|
+
"\\|\\|",
|
|
50
|
+
"\\&\\&",
|
|
51
|
+
";;",
|
|
52
|
+
"\\|\\&",
|
|
53
|
+
"\\<\\(",
|
|
54
|
+
"\\<\\<\\<",
|
|
55
|
+
">>",
|
|
56
|
+
">\\&",
|
|
57
|
+
"<\\&",
|
|
58
|
+
"[&;()|<>]"
|
|
59
|
+
].join("|") + ")";
|
|
60
|
+
var controlRE = new RegExp("^" + CONTROL + "$");
|
|
61
|
+
var META = "|&;()<> \\t";
|
|
62
|
+
var SINGLE_QUOTE = '"((\\\\"|[^"])*?)"';
|
|
63
|
+
var DOUBLE_QUOTE = "'((\\\\'|[^'])*?)'";
|
|
64
|
+
var hash = /^#$/;
|
|
65
|
+
var SQ = "'";
|
|
66
|
+
var DQ = '"';
|
|
67
|
+
var DS = "$";
|
|
68
|
+
var TOKEN = "";
|
|
69
|
+
var mult = 4294967296;
|
|
70
|
+
for (i = 0; i < 4; i++) {
|
|
71
|
+
TOKEN += (mult * Math.random()).toString(16);
|
|
72
|
+
}
|
|
73
|
+
var i;
|
|
74
|
+
var startsWithToken = new RegExp("^" + TOKEN);
|
|
75
|
+
function matchAll(s, r) {
|
|
76
|
+
var origIndex = r.lastIndex;
|
|
77
|
+
var matches = [];
|
|
78
|
+
var matchObj;
|
|
79
|
+
while (matchObj = r.exec(s)) {
|
|
80
|
+
matches.push(matchObj);
|
|
81
|
+
if (r.lastIndex === matchObj.index) {
|
|
82
|
+
r.lastIndex += 1;
|
|
83
|
+
}
|
|
84
|
+
}
|
|
85
|
+
r.lastIndex = origIndex;
|
|
86
|
+
return matches;
|
|
87
|
+
}
|
|
88
|
+
function getVar(env, pre, key) {
|
|
89
|
+
var r = typeof env === "function" ? env(key) : env[key];
|
|
90
|
+
if (typeof r === "undefined" && key != "") {
|
|
91
|
+
r = "";
|
|
92
|
+
} else if (typeof r === "undefined") {
|
|
93
|
+
r = "$";
|
|
94
|
+
}
|
|
95
|
+
if (typeof r === "object") {
|
|
96
|
+
return pre + TOKEN + JSON.stringify(r) + TOKEN;
|
|
97
|
+
}
|
|
98
|
+
return pre + r;
|
|
99
|
+
}
|
|
100
|
+
function parseInternal(string, env, opts) {
|
|
101
|
+
if (!opts) {
|
|
102
|
+
opts = {};
|
|
103
|
+
}
|
|
104
|
+
var BS = opts.escape || "\\";
|
|
105
|
+
var BAREWORD = "(\\" + BS + `['"` + META + `]|[^\\s'"` + META + "])+";
|
|
106
|
+
var chunker = new RegExp([
|
|
107
|
+
"(" + CONTROL + ")",
|
|
108
|
+
// control chars
|
|
109
|
+
"(" + BAREWORD + "|" + SINGLE_QUOTE + "|" + DOUBLE_QUOTE + ")+"
|
|
110
|
+
].join("|"), "g");
|
|
111
|
+
var matches = matchAll(string, chunker);
|
|
112
|
+
if (matches.length === 0) {
|
|
113
|
+
return [];
|
|
114
|
+
}
|
|
115
|
+
if (!env) {
|
|
116
|
+
env = {};
|
|
117
|
+
}
|
|
118
|
+
var commented = false;
|
|
119
|
+
return matches.map(function(match2) {
|
|
120
|
+
var s = match2[0];
|
|
121
|
+
if (!s || commented) {
|
|
122
|
+
return void 0;
|
|
123
|
+
}
|
|
124
|
+
if (controlRE.test(s)) {
|
|
125
|
+
return { op: s };
|
|
126
|
+
}
|
|
127
|
+
var quote = false;
|
|
128
|
+
var esc = false;
|
|
129
|
+
var out = "";
|
|
130
|
+
var isGlob = false;
|
|
131
|
+
var i2;
|
|
132
|
+
function parseEnvVar() {
|
|
133
|
+
i2 += 1;
|
|
134
|
+
var varend;
|
|
135
|
+
var varname;
|
|
136
|
+
var char = s.charAt(i2);
|
|
137
|
+
if (char === "{") {
|
|
138
|
+
i2 += 1;
|
|
139
|
+
if (s.charAt(i2) === "}") {
|
|
140
|
+
throw new Error("Bad substitution: " + s.slice(i2 - 2, i2 + 1));
|
|
141
|
+
}
|
|
142
|
+
varend = s.indexOf("}", i2);
|
|
143
|
+
if (varend < 0) {
|
|
144
|
+
throw new Error("Bad substitution: " + s.slice(i2));
|
|
145
|
+
}
|
|
146
|
+
varname = s.slice(i2, varend);
|
|
147
|
+
i2 = varend;
|
|
148
|
+
} else if (/[*@#?$!_-]/.test(char)) {
|
|
149
|
+
varname = char;
|
|
150
|
+
i2 += 1;
|
|
151
|
+
} else {
|
|
152
|
+
var slicedFromI = s.slice(i2);
|
|
153
|
+
varend = slicedFromI.match(/[^\w\d_]/);
|
|
154
|
+
if (!varend) {
|
|
155
|
+
varname = slicedFromI;
|
|
156
|
+
i2 = s.length;
|
|
157
|
+
} else {
|
|
158
|
+
varname = slicedFromI.slice(0, varend.index);
|
|
159
|
+
i2 += varend.index - 1;
|
|
160
|
+
}
|
|
161
|
+
}
|
|
162
|
+
return getVar(env, "", varname);
|
|
163
|
+
}
|
|
164
|
+
for (i2 = 0; i2 < s.length; i2++) {
|
|
165
|
+
var c = s.charAt(i2);
|
|
166
|
+
isGlob = isGlob || !quote && (c === "*" || c === "?");
|
|
167
|
+
if (esc) {
|
|
168
|
+
out += c;
|
|
169
|
+
esc = false;
|
|
170
|
+
} else if (quote) {
|
|
171
|
+
if (c === quote) {
|
|
172
|
+
quote = false;
|
|
173
|
+
} else if (quote == SQ) {
|
|
174
|
+
out += c;
|
|
175
|
+
} else {
|
|
176
|
+
if (c === BS) {
|
|
177
|
+
i2 += 1;
|
|
178
|
+
c = s.charAt(i2);
|
|
179
|
+
if (c === DQ || c === BS || c === DS) {
|
|
180
|
+
out += c;
|
|
181
|
+
} else {
|
|
182
|
+
out += BS + c;
|
|
183
|
+
}
|
|
184
|
+
} else if (c === DS) {
|
|
185
|
+
out += parseEnvVar();
|
|
186
|
+
} else {
|
|
187
|
+
out += c;
|
|
188
|
+
}
|
|
189
|
+
}
|
|
190
|
+
} else if (c === DQ || c === SQ) {
|
|
191
|
+
quote = c;
|
|
192
|
+
} else if (controlRE.test(c)) {
|
|
193
|
+
return { op: s };
|
|
194
|
+
} else if (hash.test(c)) {
|
|
195
|
+
commented = true;
|
|
196
|
+
var commentObj = { comment: string.slice(match2.index + i2 + 1) };
|
|
197
|
+
if (out.length) {
|
|
198
|
+
return [out, commentObj];
|
|
199
|
+
}
|
|
200
|
+
return [commentObj];
|
|
201
|
+
} else if (c === BS) {
|
|
202
|
+
esc = true;
|
|
203
|
+
} else if (c === DS) {
|
|
204
|
+
out += parseEnvVar();
|
|
205
|
+
} else {
|
|
206
|
+
out += c;
|
|
207
|
+
}
|
|
208
|
+
}
|
|
209
|
+
if (isGlob) {
|
|
210
|
+
return { op: "glob", pattern: out };
|
|
211
|
+
}
|
|
212
|
+
return out;
|
|
213
|
+
}).reduce(function(prev, arg) {
|
|
214
|
+
return typeof arg === "undefined" ? prev : prev.concat(arg);
|
|
215
|
+
}, []);
|
|
216
|
+
}
|
|
217
|
+
module.exports = function parse2(s, env, opts) {
|
|
218
|
+
var mapped = parseInternal(s, env, opts);
|
|
219
|
+
if (typeof env !== "function") {
|
|
220
|
+
return mapped;
|
|
221
|
+
}
|
|
222
|
+
return mapped.reduce(function(acc, s2) {
|
|
223
|
+
if (typeof s2 === "object") {
|
|
224
|
+
return acc.concat(s2);
|
|
225
|
+
}
|
|
226
|
+
var xs = s2.split(RegExp("(" + TOKEN + ".*?" + TOKEN + ")", "g"));
|
|
227
|
+
if (xs.length === 1) {
|
|
228
|
+
return acc.concat(xs[0]);
|
|
229
|
+
}
|
|
230
|
+
return acc.concat(xs.filter(Boolean).map(function(x) {
|
|
231
|
+
if (startsWithToken.test(x)) {
|
|
232
|
+
return JSON.parse(x.split(TOKEN)[1]);
|
|
233
|
+
}
|
|
234
|
+
return x;
|
|
235
|
+
}));
|
|
236
|
+
}, []);
|
|
237
|
+
};
|
|
238
|
+
}
|
|
239
|
+
});
|
|
240
|
+
|
|
241
|
+
// ../../node_modules/shell-quote/index.js
|
|
242
|
+
var require_shell_quote = __commonJS({
|
|
243
|
+
"../../node_modules/shell-quote/index.js"(exports) {
|
|
244
|
+
"use strict";
|
|
245
|
+
exports.quote = require_quote();
|
|
246
|
+
exports.parse = require_parse();
|
|
247
|
+
}
|
|
248
|
+
});
|
|
15
249
|
|
|
16
250
|
// ../../packages/shared-headless-capabilities/src/loop.ts
|
|
17
251
|
function nowIso() {
|
|
@@ -445,6 +679,7 @@ var BUILTIN_TOOL_CAPABILITY_METADATA = {
|
|
|
445
679
|
unity_log_read: { riskClass: "read_only", concurrencySafe: true, permissionScope: "unity", readsHostResource: true, availableInPlanMode: true, allowedForSubagentByDefault: true, maxOutputChars: 1e5 },
|
|
446
680
|
unity_scene_object_edit: { riskClass: "external_side_effect", concurrencySafe: false, requiresPermission: true, permissionScope: "unity", externalSideEffect: true, highRisk: true },
|
|
447
681
|
unity_refresh: { riskClass: "external_side_effect", concurrencySafe: false, permissionScope: "unity", externalSideEffect: true },
|
|
682
|
+
unity_tool_call: { riskClass: "external_side_effect", concurrencySafe: false, requiresPermission: true, permissionScope: "unity", externalSideEffect: true, highRisk: true },
|
|
448
683
|
unity_script_run: { riskClass: "external_side_effect", concurrencySafe: false, requiresPermission: true, permissionScope: "unity", externalSideEffect: true, highRisk: true }
|
|
449
684
|
};
|
|
450
685
|
function getToolCapabilityMetadata(tool) {
|
|
@@ -493,39 +728,27 @@ function selectToolsForRuntimePolicy(tools, mode) {
|
|
|
493
728
|
var DEFAULT_PLAN_MODE_TOOL_NAMES = Object.entries(BUILTIN_TOOL_CAPABILITY_METADATA).filter(([, metadata]) => metadata.availableInPlanMode).map(([name]) => name);
|
|
494
729
|
|
|
495
730
|
// ../../packages/shared-headless-capabilities/src/plan.ts
|
|
496
|
-
var
|
|
497
|
-
|
|
498
|
-
|
|
499
|
-
|
|
500
|
-
|
|
501
|
-
|
|
502
|
-
|
|
503
|
-
|
|
504
|
-
"
|
|
505
|
-
|
|
506
|
-
|
|
507
|
-
|
|
508
|
-
|
|
509
|
-
"
|
|
510
|
-
"
|
|
511
|
-
|
|
512
|
-
|
|
513
|
-
|
|
514
|
-
"
|
|
515
|
-
|
|
516
|
-
|
|
517
|
-
var DANGEROUS_PATTERNS = [
|
|
518
|
-
/\brm\s+-[rf]*/i,
|
|
519
|
-
/>[\s]*\/dev\//,
|
|
520
|
-
/\|.*\brm\b/,
|
|
521
|
-
/git\s+push/i,
|
|
522
|
-
/git\s+reset/i,
|
|
523
|
-
/git\s+checkout\s+-/,
|
|
524
|
-
/git\s+revert/i,
|
|
525
|
-
/npm\s+publish/i,
|
|
526
|
-
/npm\s+uninstall/i,
|
|
527
|
-
/npm\s+rm/i
|
|
528
|
-
];
|
|
731
|
+
var import_shell_quote = __toESM(require_shell_quote(), 1);
|
|
732
|
+
var SIMPLE_READ_COMMANDS = /* @__PURE__ */ new Set(["pwd", "ls", "cat", "head", "tail", "wc", "grep", "rg", "which", "type", "echo", "printf", "cd", "true", "false"]);
|
|
733
|
+
var GIT_READ_SUBCOMMANDS = /* @__PURE__ */ new Set(["status", "log", "diff", "show", "rev-parse", "ls-files", "ls-tree"]);
|
|
734
|
+
var UNSAFE_GIT_FLAGS = /^(?:-c|--config-env|--exec|--output|--ext-diff|--textconv)(?:=|$)/;
|
|
735
|
+
var UNSAFE_RG_FLAGS = /^(?:--pre|--pre-glob)(?:=|$)/;
|
|
736
|
+
function isReadOnlySegment(words) {
|
|
737
|
+
if (words.length === 0) return false;
|
|
738
|
+
const [program, ...args] = words;
|
|
739
|
+
if (program === "git") {
|
|
740
|
+
const subcommand = args[0] ?? "";
|
|
741
|
+
const isReadSubcommand = GIT_READ_SUBCOMMANDS.has(subcommand) || subcommand === "branch" && args.slice(1).every((arg) => ["-a", "--all", "-r", "--remotes", "--list"].includes(arg)) || subcommand === "remote" && args.length === 2 && args[1] === "-v" || subcommand === "config" && args.length === 2 && args[1] === "--list";
|
|
742
|
+
return isReadSubcommand && !args.some((arg) => UNSAFE_GIT_FLAGS.test(arg) || arg === "--no-pager" || arg === "-c");
|
|
743
|
+
}
|
|
744
|
+
if (program === "npm") return ["list", "view"].includes(args[0] ?? "") && !args.some((arg) => arg === "--script-shell");
|
|
745
|
+
if (program === "find") {
|
|
746
|
+
return !args.some((arg) => /^-(?:exec|execdir|ok|okdir|delete|fprint|fls|fprintf)/.test(arg));
|
|
747
|
+
}
|
|
748
|
+
if (!SIMPLE_READ_COMMANDS.has(program)) return false;
|
|
749
|
+
if (program === "rg") return !args.some((arg) => UNSAFE_RG_FLAGS.test(arg) || arg === "--pre" || arg === "--pre-glob");
|
|
750
|
+
return true;
|
|
751
|
+
}
|
|
529
752
|
function extractPlanTodoItems(text) {
|
|
530
753
|
const items = [];
|
|
531
754
|
const planMatch = text.match(/Plan:\s*\n?([\s\S]*?)(?=\n\n|\n[A-Z]|$)/i);
|
|
@@ -545,20 +768,23 @@ function extractPlanTodoItems(text) {
|
|
|
545
768
|
}
|
|
546
769
|
function isPlanModeSafeCommand(command) {
|
|
547
770
|
const trimmed = command.trim();
|
|
548
|
-
|
|
549
|
-
|
|
550
|
-
|
|
551
|
-
|
|
771
|
+
if (!trimmed || /[$`\n\r\0]/.test(trimmed)) return false;
|
|
772
|
+
let tokens;
|
|
773
|
+
try {
|
|
774
|
+
tokens = (0, import_shell_quote.parse)(trimmed);
|
|
775
|
+
} catch {
|
|
776
|
+
return false;
|
|
552
777
|
}
|
|
553
|
-
|
|
554
|
-
|
|
555
|
-
|
|
778
|
+
const segment = [];
|
|
779
|
+
for (const token of tokens) {
|
|
780
|
+
if (typeof token === "string") {
|
|
781
|
+
segment.push(token);
|
|
782
|
+
continue;
|
|
556
783
|
}
|
|
784
|
+
if (!("op" in token) || !["|", "&&", "||", ";"].includes(String(token.op)) || !isReadOnlySegment(segment)) return false;
|
|
785
|
+
segment.length = 0;
|
|
557
786
|
}
|
|
558
|
-
|
|
559
|
-
return ["pwd", "ls", "clear", "whoami"].includes(trimmed);
|
|
560
|
-
}
|
|
561
|
-
return false;
|
|
787
|
+
return isReadOnlySegment(segment);
|
|
562
788
|
}
|
|
563
789
|
function extractDoneSteps(text) {
|
|
564
790
|
const steps = [];
|
package/dist/cli.js
CHANGED
|
@@ -19,7 +19,7 @@ import {
|
|
|
19
19
|
getThemesDir,
|
|
20
20
|
migrateConfigFromAgentDir,
|
|
21
21
|
truncateHeadTail
|
|
22
|
-
} from "./chunks/chunk-
|
|
22
|
+
} from "./chunks/chunk-F6VAOGFL.js";
|
|
23
23
|
import {
|
|
24
24
|
AGENTS_CONTEXT_FILE_NAME,
|
|
25
25
|
AgentSessionController,
|
|
@@ -69,8 +69,8 @@ import {
|
|
|
69
69
|
setExtensionEnabledInSettings,
|
|
70
70
|
shouldPreserveExecutionStateForUserText,
|
|
71
71
|
supersedeExecutionState
|
|
72
|
-
} from "./chunks/chunk-
|
|
73
|
-
import "./chunks/chunk-
|
|
72
|
+
} from "./chunks/chunk-SNSSIR3E.js";
|
|
73
|
+
import "./chunks/chunk-7IFMKPHH.js";
|
|
74
74
|
import {
|
|
75
75
|
Deref,
|
|
76
76
|
EMPTY_ASSISTANT_CONTENT_ERROR,
|
|
@@ -105,7 +105,7 @@ import {
|
|
|
105
105
|
setLogger,
|
|
106
106
|
sortToolModelCandidatesByCapability,
|
|
107
107
|
type_exports
|
|
108
|
-
} from "./chunks/chunk-
|
|
108
|
+
} from "./chunks/chunk-HPTWCKJE.js";
|
|
109
109
|
import {
|
|
110
110
|
resolveCliProjectRoot
|
|
111
111
|
} from "./chunks/chunk-NTYHFBUA.js";
|
|
@@ -44905,6 +44905,7 @@ function validateCompat(value, label) {
|
|
|
44905
44905
|
if (value === void 0) return;
|
|
44906
44906
|
if (!isPlainRecord(value)) throw new Error(`${label} is invalid`);
|
|
44907
44907
|
assertOnlyKeys(value, [
|
|
44908
|
+
"forcedReasoningEffort",
|
|
44908
44909
|
"supportsStore",
|
|
44909
44910
|
"supportsDeveloperRole",
|
|
44910
44911
|
"supportsReasoningEffort",
|
|
@@ -44916,6 +44917,9 @@ function validateCompat(value, label) {
|
|
|
44916
44917
|
"supportsStrictMode",
|
|
44917
44918
|
"cacheCapability"
|
|
44918
44919
|
], label);
|
|
44920
|
+
if (value.forcedReasoningEffort !== void 0 && value.forcedReasoningEffort !== "none") {
|
|
44921
|
+
throw new Error(`${label}.forcedReasoningEffort must be "none"`);
|
|
44922
|
+
}
|
|
44919
44923
|
for (const field of [
|
|
44920
44924
|
"supportsStore",
|
|
44921
44925
|
"supportsDeveloperRole",
|
|
@@ -60054,7 +60058,14 @@ var ExecutionStateManager = class {
|
|
|
60054
60058
|
return this.store.clear();
|
|
60055
60059
|
}
|
|
60056
60060
|
restoreFromMetadata(raw) {
|
|
60057
|
-
|
|
60061
|
+
const restored = restoreExecutionState(raw);
|
|
60062
|
+
if (restored.mode === "todo" && restored.lifecycle === "active" && restored.awaitingContinuation) {
|
|
60063
|
+
return this.store.replace(pauseExecutionState({
|
|
60064
|
+
...restored,
|
|
60065
|
+
awaitingContinuation: false
|
|
60066
|
+
}, "Previous todo turn was interrupted while a tool was running. Send 'continue' to resume the remaining items."));
|
|
60067
|
+
}
|
|
60068
|
+
return this.store.replace(restored);
|
|
60058
60069
|
}
|
|
60059
60070
|
getReminder() {
|
|
60060
60071
|
return buildExecutionReminder(this.store.read());
|
|
@@ -67987,6 +67998,14 @@ function scheduleContinuationTimeout(host) {
|
|
|
67987
67998
|
});
|
|
67988
67999
|
return;
|
|
67989
68000
|
}
|
|
68001
|
+
if (host.agent.state.isStreaming || host.isProcessing || host.submitLock || host.pendingTools.size > 0) {
|
|
68002
|
+
host.logDebug("continuation_timeout:active_work", {
|
|
68003
|
+
isStreaming: host.agent.state.isStreaming,
|
|
68004
|
+
isProcessing: host.isProcessing,
|
|
68005
|
+
pendingTools: host.pendingTools.size
|
|
68006
|
+
});
|
|
68007
|
+
return;
|
|
68008
|
+
}
|
|
67990
68009
|
const outcome = host.executionState.markAwaitingContinuationStalled();
|
|
67991
68010
|
host.logDebug("continuation_timeout:expired", {
|
|
67992
68011
|
currentStepId: state.currentStepId,
|
|
@@ -68001,20 +68020,6 @@ function scheduleContinuationTimeout(host) {
|
|
|
68001
68020
|
appendWarningSummary(host, outcome.terminalSummary);
|
|
68002
68021
|
}
|
|
68003
68022
|
}
|
|
68004
|
-
if (host.agent.state.isStreaming || host.submitLock || host.isProcessing) {
|
|
68005
|
-
host.logDebug("continuation_timeout:force_reset", {
|
|
68006
|
-
isStreaming: host.agent.state.isStreaming,
|
|
68007
|
-
submitLock: host.submitLock,
|
|
68008
|
-
isProcessing: host.isProcessing
|
|
68009
|
-
});
|
|
68010
|
-
host.agent.resetProcessingState();
|
|
68011
|
-
host.isProcessing = false;
|
|
68012
|
-
host.setSubmitLock(false);
|
|
68013
|
-
host.streamingComponent = void 0;
|
|
68014
|
-
host.pendingTools.clear();
|
|
68015
|
-
host.footer.setState({ status: "ready" });
|
|
68016
|
-
host.safeRequestRender();
|
|
68017
|
-
}
|
|
68018
68023
|
host.agentSessionController?.requestQueueDispatch();
|
|
68019
68024
|
}, timeoutMs);
|
|
68020
68025
|
}
|
|
@@ -68112,12 +68117,14 @@ function createInteractiveAgentSessionController(host) {
|
|
|
68112
68117
|
queueLength: host.agentSessionController?.pendingMessageCount ?? 0
|
|
68113
68118
|
});
|
|
68114
68119
|
} else if (event.type === "turn_recovery_pending") {
|
|
68120
|
+
host.setControllerBusy(true);
|
|
68115
68121
|
if (event.recovery === "retry") {
|
|
68116
68122
|
host.showStatus(`Transient request error. Retrying in ${(event.delayMs ?? 0) / 1e3}s... (attempt ${event.attempt}/${event.maxRetries})`);
|
|
68117
68123
|
} else {
|
|
68118
68124
|
host.showStatus(event.failure.kind === "context_overflow" ? "Context overflow detected, compacting..." : "Auto-compacting context before retry...");
|
|
68119
68125
|
}
|
|
68120
68126
|
} else if (event.type === "turn_retry_started") {
|
|
68127
|
+
host.setControllerBusy(true);
|
|
68121
68128
|
host.showStatus(`Retrying request (attempt ${event.attempt}/${event.maxRetries})...`);
|
|
68122
68129
|
} else if (event.type === "turn_retry_succeeded") {
|
|
68123
68130
|
const outcome = host.executionState.resumePausedTodo();
|
|
@@ -68345,7 +68352,7 @@ function buildRuntimeModeContext(state) {
|
|
|
68345
68352
|
const lines = [
|
|
68346
68353
|
RUNTIME_MODE_CONTEXT_MARKER,
|
|
68347
68354
|
"Current runtime mode:",
|
|
68348
|
-
`- Plan mode: ${state.planMode === "planning" ? "active (
|
|
68355
|
+
`- Plan mode: ${state.planMode === "planning" ? "active (workspace read-only; plan_scratch permits session-local temporary drafts)" : "off"}.`,
|
|
68349
68356
|
`- YOLO mode: ${state.yoloMode ? "on (filesystem sandbox directory restrictions are disabled)" : "off (workspace/protected-path restrictions apply)"}.`,
|
|
68350
68357
|
`- Filesystem scope: ${state.filesystemScope === "all" ? "all local paths may be passed directly to file tools when permitted" : "workspace paths and configured safe roots only"}.`
|
|
68351
68358
|
];
|
|
@@ -68353,7 +68360,7 @@ function buildRuntimeModeContext(state) {
|
|
|
68353
68360
|
const transitionText = {
|
|
68354
68361
|
entered_yolo: "YOLO mode was just enabled for this turn.",
|
|
68355
68362
|
exited_yolo: "YOLO mode was just disabled; do not assume previous absolute-path access still applies.",
|
|
68356
|
-
entered_plan: "Plan mode was just enabled; analyze and plan without
|
|
68363
|
+
entered_plan: "Plan mode was just enabled; analyze and plan without changing the workspace. Use plan_scratch for temporary drafts.",
|
|
68357
68364
|
exited_plan: "Plan mode was just disabled; execution tools may be used when the task requires them."
|
|
68358
68365
|
};
|
|
68359
68366
|
lines.push(`- Transition: ${transitionText[state.pendingTransition]}`);
|
|
@@ -69355,7 +69362,10 @@ var InteractiveMode = class {
|
|
|
69355
69362
|
async syncSessionScopedState(messages) {
|
|
69356
69363
|
const activeSession = this.sessionManager.getActiveSession();
|
|
69357
69364
|
const sessionMessages = messages ?? this.sessionManager.getMessages();
|
|
69358
|
-
this.executionState.restoreFromMetadata(activeSession?.metadata?.executionState);
|
|
69365
|
+
const restoredExecutionState = this.executionState.restoreFromMetadata(activeSession?.metadata?.executionState);
|
|
69366
|
+
if (restoredExecutionState.lifecycle === "paused" && activeSession?.metadata?.executionState?.awaitingContinuation) {
|
|
69367
|
+
this.persistExecutionState();
|
|
69368
|
+
}
|
|
69359
69369
|
if (this.executionState.clearIfSupersededByUserMessage(sessionMessages)) {
|
|
69360
69370
|
this.persistExecutionState();
|
|
69361
69371
|
}
|
|
@@ -69372,7 +69382,7 @@ var InteractiveMode = class {
|
|
|
69372
69382
|
if (savedLevel) {
|
|
69373
69383
|
this.thinkingLevel = savedLevel;
|
|
69374
69384
|
}
|
|
69375
|
-
const { Agent } = await import("./chunks/src-
|
|
69385
|
+
const { Agent } = await import("./chunks/src-N6MKSRB3.js");
|
|
69376
69386
|
const activeSession = this.sessionManager.getActiveSession();
|
|
69377
69387
|
this.agent = new Agent({
|
|
69378
69388
|
initialState: {
|
|
@@ -70093,7 +70103,7 @@ async function runPrintMode(params) {
|
|
|
70093
70103
|
`);
|
|
70094
70104
|
console.log("Assistant: ");
|
|
70095
70105
|
}
|
|
70096
|
-
const { Agent: AgentClass } = await import("./chunks/src-
|
|
70106
|
+
const { Agent: AgentClass } = await import("./chunks/src-N6MKSRB3.js");
|
|
70097
70107
|
let agent;
|
|
70098
70108
|
const printModeExtensions = await loadPrintModeExtensions({
|
|
70099
70109
|
cwd: runtime.cwd,
|
|
@@ -71043,7 +71053,7 @@ async function runJsonEventsMode(params) {
|
|
|
71043
71053
|
if (runtime.initialModel.unconfigured || controller) {
|
|
71044
71054
|
return;
|
|
71045
71055
|
}
|
|
71046
|
-
const { Agent: AgentClass } = await import("./chunks/src-
|
|
71056
|
+
const { Agent: AgentClass } = await import("./chunks/src-N6MKSRB3.js");
|
|
71047
71057
|
const jsonModeExtensions = await loadJsonModeExtensions({ runtime, getAgent: () => agent });
|
|
71048
71058
|
const tools = [...runtime.tools, ...jsonModeExtensions.extensionTools];
|
|
71049
71059
|
recordCliCompositionStep(runtime.compositionTrace, {
|
|
@@ -71675,7 +71685,7 @@ async function runWithJsonEventsConsoleIsolation(fn) {
|
|
|
71675
71685
|
}
|
|
71676
71686
|
async function createCliTestStreamFnFromEnv() {
|
|
71677
71687
|
if (!process.env.PIE_TEST_MOCK_STREAM_SEQUENCE) return void 0;
|
|
71678
|
-
return (await import("./chunks/test-stream-
|
|
71688
|
+
return (await import("./chunks/test-stream-6F6VZ44U.js")).createTestStreamFnFromSequenceEnv();
|
|
71679
71689
|
}
|
|
71680
71690
|
async function startChat(initialPrompt, testCommand) {
|
|
71681
71691
|
const rawOutput = process.argv.includes("--raw-output");
|
package/models.schema.json
CHANGED
|
@@ -163,6 +163,7 @@
|
|
|
163
163
|
"supportsStore": { "type": "boolean" },
|
|
164
164
|
"supportsDeveloperRole": { "type": "boolean" },
|
|
165
165
|
"supportsReasoningEffort": { "type": "boolean" },
|
|
166
|
+
"forcedReasoningEffort": { "type": "string", "enum": ["none"] },
|
|
166
167
|
"supportsUsageInStreaming": { "type": "boolean" },
|
|
167
168
|
"maxTokensField": {
|
|
168
169
|
"type": "string",
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@cydm/pie",
|
|
3
|
-
"version": "1.0.
|
|
3
|
+
"version": "1.0.39",
|
|
4
4
|
"description": "Pie AI Agent CLI",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"bin": {
|
|
@@ -18,7 +18,7 @@
|
|
|
18
18
|
"test": "npm run test:offline",
|
|
19
19
|
"pretest:offline": "npm run build --workspace @pie/agent-framework && npm run build --workspace @pie/shared-headless-capabilities && npm run build",
|
|
20
20
|
"posttest:offline": "node --test --import tsx test/remote-model-catalog.test.ts",
|
|
21
|
-
"test:offline": "node --test --import tsx test/core-services.test.ts test/cli.test.ts test/cli-auto-compaction.test.ts test/execution-state-manager.test.ts test/queued-steer-execution-state.test.ts test/architecture-boundaries.test.ts test/attachment-resolver.test.ts test/kimi-attachment-extension.test.ts test/document-attachment-extension.test.ts test/auto-compact-overflow.test.ts test/hierarchical-command-system.test.ts test/extensions-enablement.test.ts test/message-queue-unit.test.ts test/evals-harness.test.ts test/session-trace.test.ts test/runtime-mode-context.test.ts test/tool-policy.test.ts test/retry-policy.test.ts test/yolo-command.test.ts test/footer-lifecycle.test.ts test/files-utils.test.ts test/source-size-guard.test.ts test/runtime-logger.test.ts test/release-readiness.test.ts test/package-artifacts.test.ts test/code-intel-typescript-provider.test.ts test/init-extension-contract.test.ts test/skills-runtime.test.ts test/cross-host-parity.test.ts test/tool-name-rendering.test.ts test/session-selector.test.ts test/terminal-title.test.ts test/tools-registry.test.ts test/system-prompt-contract.test.ts test/direct-bash.test.ts test/daily-agent-smoke.terminal.test.ts",
|
|
21
|
+
"test:offline": "node --test --import tsx test/core-services.test.ts test/cli.test.ts test/cli-auto-compaction.test.ts test/execution-state-manager.test.ts test/queued-steer-execution-state.test.ts test/architecture-boundaries.test.ts test/attachment-resolver.test.ts test/kimi-attachment-extension.test.ts test/document-attachment-extension.test.ts test/auto-compact-overflow.test.ts test/hierarchical-command-system.test.ts test/extensions-enablement.test.ts test/message-queue-unit.test.ts test/evals-harness.test.ts test/session-trace.test.ts test/runtime-mode-context.test.ts test/tool-policy.test.ts test/retry-policy.test.ts test/yolo-command.test.ts test/footer-lifecycle.test.ts test/files-utils.test.ts test/source-size-guard.test.ts test/runtime-logger.test.ts test/release-readiness.test.ts test/package-artifacts.test.ts test/code-intel-typescript-provider.test.ts test/init-extension-contract.test.ts test/skills-runtime.test.ts test/cross-host-parity.test.ts test/tool-name-rendering.test.ts test/session-selector.test.ts test/terminal-title.test.ts test/interactive-controller-title.test.ts test/todo-title.terminal.test.ts test/plan-mode-extension.test.ts test/tools-registry.test.ts test/system-prompt-contract.test.ts test/direct-bash.test.ts test/daily-agent-smoke.terminal.test.ts",
|
|
22
22
|
"test:all": "npm run test:offline && npm run test:terminal:vitest",
|
|
23
23
|
"test:terminal:vitest": "vitest run test/mention-file-select.terminal.test.ts test/tool-partial-display.terminal.test.ts test/viewport-position-final.test.ts --no-file-parallelism",
|
|
24
24
|
"test:todo-tui": "PIE_REAL_TODO_TUI=1 node --test --import tsx test/todo-closure.terminal.test.ts",
|