indusagi-coding-agent 0.1.54 → 0.1.56
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
CHANGED
|
@@ -1,5 +1,29 @@
|
|
|
1
1
|
# Changelog
|
|
2
2
|
|
|
3
|
+
## [0.1.56] - Latest Release
|
|
4
|
+
|
|
5
|
+
### Added
|
|
6
|
+
- **GPT-5.5 Model (CLI bridges)**: Added `gpt-5.5` to the built-in CLI-bridge providers in `app/runtime/providers/builtins.ts`:
|
|
7
|
+
- `codex-cli` / `gpt-5.5` — `contextWindow: 1_000_000`, `maxTokens: 128_000`.
|
|
8
|
+
- `indusagi-cli` / `openai/gpt-5.5` — `api: openai-responses`, `contextWindow: 1_000_000`, `maxTokens: 128_000`.
|
|
9
|
+
- `indusagi-cli` / `openai-codex/gpt-5.5` — `api: openai-codex-responses`, `contextWindow: 1_000_000`, `maxTokens: 128_000`.
|
|
10
|
+
- **Framework Bump**: Aligned with `indusagi@0.12.31`, which adds the direct `openai` / `gpt-5.5` and `openai-codex` / `gpt-5.5` model entries (1M context, 128K max output, `$5` / `$30` per 1M, `cacheRead: $0.5`).
|
|
11
|
+
|
|
12
|
+
### Changed
|
|
13
|
+
- **Published Framework Dependency**: Pinned the `indusagi` dependency to the published npm package `indusagi@^0.12.31` (the version that ships the `openai` / `gpt-5.5` and `openai-codex` / `gpt-5.5` model entries).
|
|
14
|
+
- **Postinstall Patcher Compatibility**: Updated `tasks/patch-indusagi-react-host.mjs` so it recognises the freshly-built `loader.js` (which uses `argv1Real` instead of the older `__argv1Real` variable name) as already-patched, instead of throwing on install.
|
|
15
|
+
- **Version Bump**: Updated package version to `0.1.56`.
|
|
16
|
+
|
|
17
|
+
## [0.1.55] - Latest Release
|
|
18
|
+
|
|
19
|
+
### Changed
|
|
20
|
+
- **Version Bump**: Updated package version to `0.1.55`.
|
|
21
|
+
|
|
22
|
+
### Notes
|
|
23
|
+
- Package name remains **`indusagi-coding-agent`** (unchanged).
|
|
24
|
+
- Bin shims unchanged — `indus` and `indusagi` both resolve to `dist/cli.js`.
|
|
25
|
+
- Install with `npm install -g indusagi-coding-agent` once published.
|
|
26
|
+
|
|
3
27
|
## [0.1.54] - Latest Release
|
|
4
28
|
|
|
5
29
|
### Changed
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"builtins.d.ts","sourceRoot":"","sources":["../../../app/runtime/providers/builtins.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,aAAa,EAAuB,MAAM,sBAAsB,CAAC;
|
|
1
|
+
{"version":3,"file":"builtins.d.ts","sourceRoot":"","sources":["../../../app/runtime/providers/builtins.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,aAAa,EAAuB,MAAM,sBAAsB,CAAC;AA2H/E,wBAAgB,+BAA+B,CAAC,aAAa,EAAE,aAAa,GAAG,IAAI,CAIlF"}
|
|
@@ -35,6 +35,10 @@ const BUILT_IN_RUNTIME_PROVIDERS = [
|
|
|
35
35
|
runtime: { adapter: "codex-cli", authMode: "external-cli" },
|
|
36
36
|
api: "openai-responses",
|
|
37
37
|
models: [
|
|
38
|
+
createModel("gpt-5.5", "GPT-5.5 (Codex CLI)", {
|
|
39
|
+
contextWindow: 1_000_000,
|
|
40
|
+
maxTokens: 128_000,
|
|
41
|
+
}),
|
|
38
42
|
createModel("gpt-5.4", "GPT-5.4 (Codex CLI)", { contextWindow: 1_000_000, maxTokens: 32_000 }),
|
|
39
43
|
createModel("gpt-5.4-mini", "GPT-5.4 Mini (Codex CLI)", {
|
|
40
44
|
contextWindow: 400_000,
|
|
@@ -72,6 +76,16 @@ const BUILT_IN_RUNTIME_PROVIDERS = [
|
|
|
72
76
|
contextWindow: 200_000,
|
|
73
77
|
maxTokens: 8_192,
|
|
74
78
|
}),
|
|
79
|
+
createModel("openai/gpt-5.5", "GPT-5.5 via indusagi CLI", {
|
|
80
|
+
api: "openai-responses",
|
|
81
|
+
contextWindow: 1_000_000,
|
|
82
|
+
maxTokens: 128_000,
|
|
83
|
+
}),
|
|
84
|
+
createModel("openai-codex/gpt-5.5", "GPT-5.5 (Codex) via indusagi CLI", {
|
|
85
|
+
api: "openai-codex-responses",
|
|
86
|
+
contextWindow: 1_000_000,
|
|
87
|
+
maxTokens: 128_000,
|
|
88
|
+
}),
|
|
75
89
|
createModel("openai-codex/gpt-5.4-1m", "GPT-5.4 1M via indusagi CLI", {
|
|
76
90
|
api: "openai-codex-responses",
|
|
77
91
|
contextWindow: 1_000_000,
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"builtins.js","sourceRoot":"","sources":["../../../app/runtime/providers/builtins.ts"],"names":[],"mappings":"AAKA,MAAM,SAAS,GAAG,EAAE,KAAK,EAAE,CAAC,EAAE,MAAM,EAAE,CAAC,EAAE,SAAS,EAAE,CAAC,EAAE,UAAU,EAAE,CAAC,EAAW,CAAC;AAChF,MAAM,UAAU,GAAG,CAAC,MAAM,CAAyB,CAAC;AAEpD,SAAS,WAAW,CACnB,EAAU,EACV,IAAY,EACZ,OAKC;IAED,OAAO;QACN,EAAE;QACF,IAAI;QACJ,GAAG,EAAE,OAAO,CAAC,GAAG;QAChB,SAAS,EAAE,OAAO,CAAC,SAAS,IAAI,IAAI;QACpC,KAAK,EAAE,UAAU;QACjB,IAAI,EAAE,SAAS;QACf,aAAa,EAAE,OAAO,CAAC,aAAa,IAAI,OAAO;QAC/C,SAAS,EAAE,OAAO,CAAC,SAAS,IAAI,MAAM;KACtC,CAAC;AACH,CAAC;AAED,MAAM,0BAA0B,GAAyD;IACxF;QACC,IAAI,EAAE,YAAY;QAClB,MAAM,EAAE;YACP,OAAO,EAAE,EAAE,OAAO,EAAE,YAAY,EAAE,QAAQ,EAAE,cAAc,EAAE;YAC5D,GAAG,EAAE,oBAAoB;YACzB,MAAM,EAAE;gBACP,WAAW,CAAC,QAAQ,EAAE,qBAAqB,EAAE,EAAE,aAAa,EAAE,OAAO,EAAE,SAAS,E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,GAAG,EAAE,wBAAwB;oBAC7B,aAAa,EAAE,SAAS;oBACxB,SAAS,EAAE,OAAO;iBAClB,CAAC;gBACF,WAAW,CAAC,yBAAyB,EAAE,6BAA6B,EAAE;oBACrE,GAAG,EAAE,wBAAwB;oBAC7B,aAAa,EAAE,SAAS;oBACxB,SAAS,EAAE,MAAM;iBACjB,CAAC;gBACF,WAAW,CAAC,sBAAsB,EAAE,gCAAgC,EAAE;oBACrE,GAAG,EAAE,kBAAkB;oBACvB,aAAa,EAAE,OAAO;oBACtB,SAAS,EAAE,MAAM;iBACjB,CAAC;gBACF,WAAW,CAAC,uBAAuB,EAAE,iCAAiC,EAAE;oBACvE,GAAG,EAAE,sBAAsB;oBAC3B,aAAa,EAAE,SAAS;oBACxB,SAAS,EAAE,MAAM;iBACjB,CAAC;aACF;SACD;KACD;CACD,CAAC;AAEF,MAAM,UAAU,+BAA+B,CAAC,aAA4B;IAC3E,KAAK,MAAM,QAAQ,IAAI,0BAA0B,EAAE,CAAC;QACnD,aAAa,CAAC,gBAAgB,CAAC,QAAQ,CAAC,IAAI,EAAE,QAAQ,CAAC,MAAM,CAAC,CAAC;IAChE,CAAC;AACF,CAAC"}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "indusagi-coding-agent",
|
|
3
|
-
"version": "0.1.
|
|
3
|
+
"version": "0.1.56",
|
|
4
4
|
"description": "Terminal-first TypeScript coding agent built on the indusagi framework package.",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"main": "./dist/index.js",
|
|
@@ -60,7 +60,7 @@
|
|
|
60
60
|
"glob": "^11.0.3",
|
|
61
61
|
"highlight.js": "^11.11.1",
|
|
62
62
|
"i": "^0.3.7",
|
|
63
|
-
"indusagi": "^0.12.
|
|
63
|
+
"indusagi": "^0.12.31",
|
|
64
64
|
"indusagi-coding-agent": "^0.1.42",
|
|
65
65
|
"ink": "^5.2.1",
|
|
66
66
|
"marked": "^17.0.5",
|
|
@@ -2,7 +2,15 @@ import { existsSync, readFileSync, writeFileSync } from "node:fs";
|
|
|
2
2
|
import { dirname, resolve } from "node:path";
|
|
3
3
|
import { fileURLToPath } from "node:url";
|
|
4
4
|
|
|
5
|
-
|
|
5
|
+
// Allow override via env or CLI arg so this script can patch a specific loader
|
|
6
|
+
// (e.g. the global install at /opt/homebrew/lib/node_modules/...).
|
|
7
|
+
// sudo node patch-indusagi-react-host.mjs /opt/homebrew/lib/node_modules/indusagi-coding-agent
|
|
8
|
+
const rootDir = resolve(
|
|
9
|
+
process.argv[2] ||
|
|
10
|
+
process.env.INDUSAGI_PATCH_ROOT ||
|
|
11
|
+
dirname(fileURLToPath(import.meta.url)),
|
|
12
|
+
process.argv[2] || process.env.INDUSAGI_PATCH_ROOT ? "." : "..",
|
|
13
|
+
);
|
|
6
14
|
const originalUrlImport = 'import { pathToFileURL } from "node:url";';
|
|
7
15
|
const patchedUrlImport = 'import { fileURLToPath, pathToFileURL } from "node:url";';
|
|
8
16
|
|
|
@@ -105,7 +113,13 @@ const patchedCandidateRootsLegacyBadOrder = `function candidatePackageRoots() {
|
|
|
105
113
|
return [...roots];
|
|
106
114
|
}`;
|
|
107
115
|
|
|
108
|
-
|
|
116
|
+
// Previously-shipped patched form (no realpath of argv[1]). Triggered the
|
|
117
|
+
// "Objects are not valid as a React child (found: object with keys
|
|
118
|
+
// {$$typeof, type, key, props, _owner, _store})" error when the CLI was run
|
|
119
|
+
// from a global bin shim and the user's cwd contained a foreign React (e.g.
|
|
120
|
+
// React 19, whose elements have no `ref` field). Two header-comment variants
|
|
121
|
+
// are recognised because the comment text drifted between source revisions.
|
|
122
|
+
const patchedCandidateRootsLegacyV2 = `function candidatePackageRoots() {
|
|
109
123
|
const roots = new Set();
|
|
110
124
|
const addCandidate = (candidate) => {
|
|
111
125
|
if (!candidate) {
|
|
@@ -128,6 +142,69 @@ const patchedCandidateRoots = `function candidatePackageRoots() {
|
|
|
128
142
|
return [...roots];
|
|
129
143
|
}`;
|
|
130
144
|
|
|
145
|
+
// Same shape, but built from the .ts source comment ("still work"). This is
|
|
146
|
+
// what shipped in indusagi@0.12.30.
|
|
147
|
+
const patchedCandidateRootsLegacyV2_alt = `function candidatePackageRoots() {
|
|
148
|
+
const roots = new Set();
|
|
149
|
+
const addCandidate = (candidate) => {
|
|
150
|
+
if (!candidate) {
|
|
151
|
+
return;
|
|
152
|
+
}
|
|
153
|
+
const root = findPackageRoot(candidate);
|
|
154
|
+
if (root) {
|
|
155
|
+
roots.add(root);
|
|
156
|
+
}
|
|
157
|
+
};
|
|
158
|
+
// Prefer the consumer package's React/Ink. The indusvx package root is a
|
|
159
|
+
// last-resort fallback so dev runs from inside this repo still work.
|
|
160
|
+
const packageRoot = fileURLToPath(new URL("../../..", import.meta.url));
|
|
161
|
+
addCandidate(process.env.INDUSAGI_REACT_HOST_ROOT);
|
|
162
|
+
addCandidate(process.argv[1] ? path.dirname(process.argv[1]) : undefined);
|
|
163
|
+
addCandidate(process.env.INIT_CWD);
|
|
164
|
+
addCandidate(process.cwd());
|
|
165
|
+
addCandidate(packageRoot);
|
|
166
|
+
return [...roots];
|
|
167
|
+
}`;
|
|
168
|
+
|
|
169
|
+
const patchedCandidateRoots = `function candidatePackageRoots() {
|
|
170
|
+
const roots = new Set();
|
|
171
|
+
const addCandidate = (candidate) => {
|
|
172
|
+
if (!candidate) {
|
|
173
|
+
return;
|
|
174
|
+
}
|
|
175
|
+
const root = findPackageRoot(candidate);
|
|
176
|
+
if (root) {
|
|
177
|
+
roots.add(root);
|
|
178
|
+
}
|
|
179
|
+
};
|
|
180
|
+
// When the CLI is invoked via a global bin symlink (e.g.
|
|
181
|
+
// /opt/homebrew/bin/indusagi -> .../indusagi-coding-agent/dist/cli.js),
|
|
182
|
+
// argv[1] sits in a bin/ directory with no package.json above it. Follow
|
|
183
|
+
// the symlink to find the real consumer package root, otherwise we fall
|
|
184
|
+
// through to process.cwd() and may pick up a foreign React (e.g. React 19,
|
|
185
|
+
// whose elements have keys {$$typeof, type, key, props, _owner, _store} —
|
|
186
|
+
// note: no \`ref\`) from the user's project, while Ink uses the bundled
|
|
187
|
+
// React 18. That mismatch produces "Objects are not valid as a React
|
|
188
|
+
// child (found: object with keys {$$typeof, type, key, props, _owner, _store})".
|
|
189
|
+
const __argv1 = process.argv[1];
|
|
190
|
+
let __argv1Real;
|
|
191
|
+
if (__argv1) {
|
|
192
|
+
try { __argv1Real = fs.realpathSync(__argv1); }
|
|
193
|
+
catch { __argv1Real = __argv1; }
|
|
194
|
+
}
|
|
195
|
+
// Prefer the consumer package's React/Ink so we never load a second copy
|
|
196
|
+
// alongside the host. The indusvx package root is a last-resort fallback
|
|
197
|
+
// for dev runs from inside this repo.
|
|
198
|
+
const packageRoot = fileURLToPath(new URL("../../..", import.meta.url));
|
|
199
|
+
addCandidate(process.env.INDUSAGI_REACT_HOST_ROOT);
|
|
200
|
+
addCandidate(__argv1Real ? path.dirname(__argv1Real) : undefined);
|
|
201
|
+
addCandidate(__argv1 ? path.dirname(__argv1) : undefined);
|
|
202
|
+
addCandidate(process.env.INIT_CWD);
|
|
203
|
+
addCandidate(process.cwd());
|
|
204
|
+
addCandidate(packageRoot);
|
|
205
|
+
return [...roots];
|
|
206
|
+
}`;
|
|
207
|
+
|
|
131
208
|
if (!loaderPath) {
|
|
132
209
|
console.warn("[patch-indusagi-react-host] Skipping patch because an indusagi react-host loader could not be found.");
|
|
133
210
|
process.exit(0);
|
|
@@ -143,11 +220,15 @@ if (!next.includes(patchedUrlImport)) {
|
|
|
143
220
|
next = next.replace(originalUrlImport, patchedUrlImport);
|
|
144
221
|
}
|
|
145
222
|
|
|
146
|
-
if (next.includes(
|
|
223
|
+
if (next.includes(patchedCandidateRootsLegacyV2)) {
|
|
224
|
+
next = next.replace(patchedCandidateRootsLegacyV2, patchedCandidateRoots);
|
|
225
|
+
} else if (next.includes(patchedCandidateRootsLegacyV2_alt)) {
|
|
226
|
+
next = next.replace(patchedCandidateRootsLegacyV2_alt, patchedCandidateRoots);
|
|
227
|
+
} else if (next.includes(patchedCandidateRootsLegacyBadOrder)) {
|
|
147
228
|
next = next.replace(patchedCandidateRootsLegacyBadOrder, patchedCandidateRoots);
|
|
148
229
|
} else if (next.includes(patchedCandidateRootsLegacy)) {
|
|
149
230
|
next = next.replace(patchedCandidateRootsLegacy, patchedCandidateRoots);
|
|
150
|
-
} else if (!next.includes('
|
|
231
|
+
} else if (!next.includes('__argv1Real') && !next.includes('argv1Real')) {
|
|
151
232
|
if (next.includes(originalCandidateRoots)) {
|
|
152
233
|
next = next.replace(originalCandidateRoots, patchedCandidateRoots);
|
|
153
234
|
} else if (next.includes(originalCandidateRootsV2)) {
|