@code-yeongyu/senpi 2026.9.11 → 2026.9.12-2
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 +40 -0
- package/dist/core/agent-session-runtime.d.ts.map +1 -1
- package/dist/core/agent-session-runtime.js +5 -1
- package/dist/core/agent-session-runtime.js.map +1 -1
- package/dist/core/agent-session.d.ts +13 -9
- package/dist/core/agent-session.d.ts.map +1 -1
- package/dist/core/agent-session.js +54 -121
- package/dist/core/agent-session.js.map +1 -1
- package/dist/core/cursor-history-admission.d.ts +50 -0
- package/dist/core/cursor-history-admission.d.ts.map +1 -0
- package/dist/core/cursor-history-admission.js +130 -0
- package/dist/core/cursor-history-admission.js.map +1 -0
- package/dist/core/extensions/builtin/cursor-cli-oauth/models.d.ts.map +1 -1
- package/dist/core/extensions/builtin/cursor-cli-oauth/models.js +2 -1
- package/dist/core/extensions/builtin/cursor-cli-oauth/models.js.map +1 -1
- package/dist/core/session-manager.d.ts +2 -0
- package/dist/core/session-manager.d.ts.map +1 -1
- package/dist/core/session-manager.js +22 -13
- package/dist/core/session-manager.js.map +1 -1
- package/dist/core/session-write-reservation.d.ts +9 -0
- package/dist/core/session-write-reservation.d.ts.map +1 -1
- package/dist/core/session-write-reservation.js +33 -0
- package/dist/core/session-write-reservation.js.map +1 -1
- package/dist/modes/interactive/components/ask-user-async-widget.d.ts +2 -0
- package/dist/modes/interactive/components/ask-user-async-widget.d.ts.map +1 -1
- package/dist/modes/interactive/components/ask-user-async-widget.js +17 -1
- package/dist/modes/interactive/components/ask-user-async-widget.js.map +1 -1
- package/dist/modes/interactive/interactive-mode.js +2 -2
- package/dist/modes/interactive/interactive-mode.js.map +1 -1
- package/dist/modes/rpc/rpc-types.d.ts +2 -1
- package/dist/modes/rpc/rpc-types.d.ts.map +1 -1
- package/dist/modes/rpc/rpc-types.js +1 -0
- package/dist/modes/rpc/rpc-types.js.map +1 -1
- package/dist/modes/rpc/session-path-reservations.d.ts +30 -0
- package/dist/modes/rpc/session-path-reservations.d.ts.map +1 -0
- package/dist/modes/rpc/session-path-reservations.js +58 -0
- package/dist/modes/rpc/session-path-reservations.js.map +1 -0
- package/dist/modes/rpc/session-registry.d.ts +3 -1
- package/dist/modes/rpc/session-registry.d.ts.map +1 -1
- package/dist/modes/rpc/session-registry.js.map +1 -1
- package/dist/modes/rpc/session-worker-client.d.ts +10 -8
- package/dist/modes/rpc/session-worker-client.d.ts.map +1 -1
- package/dist/modes/rpc/session-worker-client.js +14 -23
- package/dist/modes/rpc/session-worker-client.js.map +1 -1
- package/dist/modes/rpc/session-worker-credit.d.ts +17 -0
- package/dist/modes/rpc/session-worker-credit.d.ts.map +1 -0
- package/dist/modes/rpc/session-worker-credit.js +39 -0
- package/dist/modes/rpc/session-worker-credit.js.map +1 -0
- package/dist/modes/rpc/session-worker-protocol.d.ts +10 -0
- package/dist/modes/rpc/session-worker-protocol.d.ts.map +1 -1
- package/dist/modes/rpc/session-worker-protocol.js +2 -0
- package/dist/modes/rpc/session-worker-protocol.js.map +1 -1
- package/dist/modes/rpc/session-worker-signals.d.ts +7 -0
- package/dist/modes/rpc/session-worker-signals.d.ts.map +1 -0
- package/dist/modes/rpc/session-worker-signals.js +19 -0
- package/dist/modes/rpc/session-worker-signals.js.map +1 -0
- package/dist/modes/rpc/session-worker.js +12 -16
- package/dist/modes/rpc/session-worker.js.map +1 -1
- package/dist/modes/rpc/worker-session-registry.d.ts +12 -0
- package/dist/modes/rpc/worker-session-registry.d.ts.map +1 -1
- package/dist/modes/rpc/worker-session-registry.js +51 -24
- package/dist/modes/rpc/worker-session-registry.js.map +1 -1
- package/docs/rpc.md +14 -6
- package/node_modules/@code-yeongyu/senpi-codemode/CHANGELOG.md +24 -0
- package/node_modules/@code-yeongyu/senpi-codemode/package.json +4 -4
- package/node_modules/@earendil-works/pi-agent-core/package.json +3 -3
- package/node_modules/@earendil-works/pi-ai/dist/api/cursor-agent/measure.d.ts +11 -0
- package/node_modules/@earendil-works/pi-ai/dist/api/cursor-agent/measure.d.ts.map +1 -1
- package/node_modules/@earendil-works/pi-ai/dist/api/cursor-agent/measure.js +18 -0
- package/node_modules/@earendil-works/pi-ai/dist/api/cursor-agent/measure.js.map +1 -1
- package/node_modules/@earendil-works/pi-ai/dist/api/cursor-agent.d.ts +1 -1
- package/node_modules/@earendil-works/pi-ai/dist/api/cursor-agent.d.ts.map +1 -1
- package/node_modules/@earendil-works/pi-ai/dist/api/cursor-agent.js +5 -1
- package/node_modules/@earendil-works/pi-ai/dist/api/cursor-agent.js.map +1 -1
- package/node_modules/@earendil-works/pi-ai/dist/api/devin-agent/discovery.d.ts +2 -0
- package/node_modules/@earendil-works/pi-ai/dist/api/devin-agent/discovery.d.ts.map +1 -1
- package/node_modules/@earendil-works/pi-ai/dist/api/devin-agent/discovery.js +96 -51
- package/node_modules/@earendil-works/pi-ai/dist/api/devin-agent/discovery.js.map +1 -1
- package/node_modules/@earendil-works/pi-ai/dist/api/devin-agent/gen/cascade_pb.d.ts +389 -1
- package/node_modules/@earendil-works/pi-ai/dist/api/devin-agent/gen/cascade_pb.d.ts.map +1 -1
- package/node_modules/@earendil-works/pi-ai/dist/api/devin-agent/gen/cascade_pb.js +132 -4
- package/node_modules/@earendil-works/pi-ai/dist/api/devin-agent/gen/cascade_pb.js.map +1 -1
- package/node_modules/@earendil-works/pi-ai/dist/api/devin-agent/metadata.d.ts +34 -4
- package/node_modules/@earendil-works/pi-ai/dist/api/devin-agent/metadata.d.ts.map +1 -1
- package/node_modules/@earendil-works/pi-ai/dist/api/devin-agent/metadata.js +41 -8
- package/node_modules/@earendil-works/pi-ai/dist/api/devin-agent/metadata.js.map +1 -1
- package/node_modules/@earendil-works/pi-ai/dist/api/devin-agent/paths.d.ts +20 -0
- package/node_modules/@earendil-works/pi-ai/dist/api/devin-agent/paths.d.ts.map +1 -1
- package/node_modules/@earendil-works/pi-ai/dist/api/devin-agent/paths.js +20 -0
- package/node_modules/@earendil-works/pi-ai/dist/api/devin-agent/paths.js.map +1 -1
- package/node_modules/@earendil-works/pi-ai/dist/api/devin-agent/request.d.ts +18 -6
- package/node_modules/@earendil-works/pi-ai/dist/api/devin-agent/request.d.ts.map +1 -1
- package/node_modules/@earendil-works/pi-ai/dist/api/devin-agent/request.js +77 -35
- package/node_modules/@earendil-works/pi-ai/dist/api/devin-agent/request.js.map +1 -1
- package/node_modules/@earendil-works/pi-ai/dist/api/devin-agent/stream-state.d.ts +9 -3
- package/node_modules/@earendil-works/pi-ai/dist/api/devin-agent/stream-state.d.ts.map +1 -1
- package/node_modules/@earendil-works/pi-ai/dist/api/devin-agent/stream-state.js +30 -38
- package/node_modules/@earendil-works/pi-ai/dist/api/devin-agent/stream-state.js.map +1 -1
- package/node_modules/@earendil-works/pi-ai/dist/api/devin-agent/trailer.d.ts +16 -0
- package/node_modules/@earendil-works/pi-ai/dist/api/devin-agent/trailer.d.ts.map +1 -0
- package/node_modules/@earendil-works/pi-ai/dist/api/devin-agent/trailer.js +69 -0
- package/node_modules/@earendil-works/pi-ai/dist/api/devin-agent/trailer.js.map +1 -0
- package/node_modules/@earendil-works/pi-ai/dist/api/devin-agent/unary.d.ts +26 -0
- package/node_modules/@earendil-works/pi-ai/dist/api/devin-agent/unary.d.ts.map +1 -0
- package/node_modules/@earendil-works/pi-ai/dist/api/devin-agent/unary.js +61 -0
- package/node_modules/@earendil-works/pi-ai/dist/api/devin-agent/unary.js.map +1 -0
- package/node_modules/@earendil-works/pi-ai/dist/api/devin-agent/wire.d.ts +6 -4
- package/node_modules/@earendil-works/pi-ai/dist/api/devin-agent/wire.d.ts.map +1 -1
- package/node_modules/@earendil-works/pi-ai/dist/api/devin-agent/wire.js +6 -4
- package/node_modules/@earendil-works/pi-ai/dist/api/devin-agent/wire.js.map +1 -1
- package/node_modules/@earendil-works/pi-ai/dist/api/devin-agent.d.ts +13 -5
- package/node_modules/@earendil-works/pi-ai/dist/api/devin-agent.d.ts.map +1 -1
- package/node_modules/@earendil-works/pi-ai/dist/api/devin-agent.js +76 -21
- package/node_modules/@earendil-works/pi-ai/dist/api/devin-agent.js.map +1 -1
- package/node_modules/@earendil-works/pi-ai/dist/auth/oauth/devin.d.ts +5 -0
- package/node_modules/@earendil-works/pi-ai/dist/auth/oauth/devin.d.ts.map +1 -1
- package/node_modules/@earendil-works/pi-ai/dist/auth/oauth/devin.js +7 -2
- package/node_modules/@earendil-works/pi-ai/dist/auth/oauth/devin.js.map +1 -1
- package/node_modules/@earendil-works/pi-ai/dist/cursor/context-limit-store.d.ts +32 -0
- package/node_modules/@earendil-works/pi-ai/dist/cursor/context-limit-store.d.ts.map +1 -0
- package/node_modules/@earendil-works/pi-ai/dist/cursor/context-limit-store.js +62 -0
- package/node_modules/@earendil-works/pi-ai/dist/cursor/context-limit-store.js.map +1 -0
- package/node_modules/@earendil-works/pi-ai/dist/cursor/store-migration.d.ts.map +1 -1
- package/node_modules/@earendil-works/pi-ai/dist/cursor/store-migration.js +2 -1
- package/node_modules/@earendil-works/pi-ai/dist/cursor/store-migration.js.map +1 -1
- package/node_modules/@earendil-works/pi-ai/dist/index.d.ts +1 -1
- package/node_modules/@earendil-works/pi-ai/dist/index.d.ts.map +1 -1
- package/node_modules/@earendil-works/pi-ai/dist/index.js +1 -1
- package/node_modules/@earendil-works/pi-ai/dist/index.js.map +1 -1
- package/node_modules/@earendil-works/pi-ai/dist/model.d.ts +11 -1
- package/node_modules/@earendil-works/pi-ai/dist/model.d.ts.map +1 -1
- package/node_modules/@earendil-works/pi-ai/dist/model.js.map +1 -1
- package/node_modules/@earendil-works/pi-ai/dist/providers/cursor.d.ts.map +1 -1
- package/node_modules/@earendil-works/pi-ai/dist/providers/cursor.js +2 -1
- package/node_modules/@earendil-works/pi-ai/dist/providers/cursor.js.map +1 -1
- package/node_modules/@earendil-works/pi-ai/dist/providers/data/.manifest.json +1 -1
- package/node_modules/@earendil-works/pi-ai/dist/providers/data/amazon-bedrock.json +1 -1
- package/node_modules/@earendil-works/pi-ai/dist/providers/data/openrouter.json +1 -1
- package/node_modules/@earendil-works/pi-ai/dist/providers/data/venice.json +1 -1
- package/node_modules/@earendil-works/pi-ai/dist/providers/data/vercel-ai-gateway.json +1 -1
- package/node_modules/@earendil-works/pi-ai/dist/providers/devin.d.ts.map +1 -1
- package/node_modules/@earendil-works/pi-ai/dist/providers/devin.js +3 -3
- package/node_modules/@earendil-works/pi-ai/dist/providers/devin.js.map +1 -1
- package/node_modules/@earendil-works/pi-ai/dist/providers/devin.models.d.ts +4 -2
- package/node_modules/@earendil-works/pi-ai/dist/providers/devin.models.d.ts.map +1 -1
- package/node_modules/@earendil-works/pi-ai/dist/providers/devin.models.js +18 -9
- package/node_modules/@earendil-works/pi-ai/dist/providers/devin.models.js.map +1 -1
- package/node_modules/@earendil-works/pi-ai/dist/utils/cursor-context-limit.d.ts +12 -0
- package/node_modules/@earendil-works/pi-ai/dist/utils/cursor-context-limit.d.ts.map +1 -0
- package/node_modules/@earendil-works/pi-ai/dist/utils/cursor-context-limit.js +93 -0
- package/node_modules/@earendil-works/pi-ai/dist/utils/cursor-context-limit.js.map +1 -0
- package/node_modules/@earendil-works/pi-ai/package.json +2 -2
- package/node_modules/@earendil-works/pi-pty/package.json +1 -1
- package/node_modules/@earendil-works/pi-telemetry/package.json +1 -1
- package/node_modules/@earendil-works/pi-tui/package.json +1 -1
- package/package.json +7 -7
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"devin.d.ts","sourceRoot":"","sources":["../../src/providers/devin.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"devin.d.ts","sourceRoot":"","sources":["../../src/providers/devin.ts"],"names":[],"mappings":"AAKA,OAAO,EAAkB,KAAK,QAAQ,EAAE,MAAM,cAAc,CAAC;AAI7D;;;;;;;;GAQG;AACH,wBAAgB,aAAa,IAAI,QAAQ,CAAC,aAAa,CAAC,CA2CvD"}
|
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
import { fetchDevinModels } from "../api/devin-agent/discovery.js";
|
|
2
|
+
import { DEVIN_DEFAULT_BASE_URL } from "../api/devin-agent/paths.js";
|
|
2
3
|
import { devinAgentApi } from "../api/devin-agent.lazy.js";
|
|
3
4
|
import { lazyOAuth } from "../auth/helpers.js";
|
|
4
5
|
import { loadDevinOAuth } from "../auth/oauth/load.js";
|
|
5
6
|
import { createProvider } from "../models.js";
|
|
6
7
|
import { DEVIN_MODELS } from "./devin.models.js";
|
|
7
|
-
const DEVIN_BASE_URL = "https://server.codeium.com";
|
|
8
8
|
/**
|
|
9
9
|
* Devin (Cognition) Cascade provider.
|
|
10
10
|
*
|
|
@@ -19,7 +19,7 @@ export function devinProvider() {
|
|
|
19
19
|
const provider = createProvider({
|
|
20
20
|
id: "devin",
|
|
21
21
|
name: "Devin",
|
|
22
|
-
baseUrl:
|
|
22
|
+
baseUrl: DEVIN_DEFAULT_BASE_URL,
|
|
23
23
|
auth: {
|
|
24
24
|
oauth: lazyOAuth({ name: "Devin", loginLabel: "Sign in with Devin", load: loadDevinOAuth }),
|
|
25
25
|
},
|
|
@@ -47,7 +47,7 @@ export function devinProvider() {
|
|
|
47
47
|
const apiKey = credential?.type === "oauth" ? credential.access : credential?.key;
|
|
48
48
|
if (!apiKey)
|
|
49
49
|
return;
|
|
50
|
-
const discovered = await fetchDevinModels({ apiKey, baseUrl:
|
|
50
|
+
const discovered = await fetchDevinModels({ apiKey, baseUrl: DEVIN_DEFAULT_BASE_URL, signal: context.signal });
|
|
51
51
|
if (!discovered || context.signal.aborted)
|
|
52
52
|
return;
|
|
53
53
|
await context.publish({
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"devin.js","sourceRoot":"","sources":["../../src/providers/devin.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,gBAAgB,EAAE,MAAM,iCAAiC,CAAC;AACnE,OAAO,EAAE,aAAa,EAAE,MAAM,4BAA4B,CAAC;AAC3D,OAAO,EAAE,SAAS,EAAE,MAAM,oBAAoB,CAAC;AAC/C,OAAO,EAAE,cAAc,EAAE,MAAM,uBAAuB,CAAC;AACvD,OAAO,EAAE,cAAc,EAAiB,MAAM,cAAc,CAAC;AAE7D,OAAO,EAAE,YAAY,EAAE,MAAM,mBAAmB,CAAC;AAEjD
|
|
1
|
+
{"version":3,"file":"devin.js","sourceRoot":"","sources":["../../src/providers/devin.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,gBAAgB,EAAE,MAAM,iCAAiC,CAAC;AACnE,OAAO,EAAE,sBAAsB,EAAE,MAAM,6BAA6B,CAAC;AACrE,OAAO,EAAE,aAAa,EAAE,MAAM,4BAA4B,CAAC;AAC3D,OAAO,EAAE,SAAS,EAAE,MAAM,oBAAoB,CAAC;AAC/C,OAAO,EAAE,cAAc,EAAE,MAAM,uBAAuB,CAAC;AACvD,OAAO,EAAE,cAAc,EAAiB,MAAM,cAAc,CAAC;AAE7D,OAAO,EAAE,YAAY,EAAE,MAAM,mBAAmB,CAAC;AAEjD;;;;;;;;GAQG;AACH,MAAM,UAAU,aAAa;IAC5B,IAAI,MAAM,GAA2B,YAAY,CAAC;IAElD,MAAM,QAAQ,GAAG,cAAc,CAAgB;QAC9C,EAAE,EAAE,OAAO;QACX,IAAI,EAAE,OAAO;QACb,OAAO,EAAE,sBAAsB;QAC/B,IAAI,EAAE;YACL,KAAK,EAAE,SAAS,CAAC,EAAE,IAAI,EAAE,OAAO,EAAE,UAAU,EAAE,oBAAoB,EAAE,IAAI,EAAE,cAAc,EAAE,CAAC;SAC3F;QACD,MAAM,EAAE,YAAY;QACpB,GAAG,EAAE,EAAE,aAAa,EAAE,aAAa,EAAE,EAAE;KACvC,CAAC,CAAC;IAEH,OAAO;QACN,GAAG,QAAQ;QACX,SAAS,EAAE,GAAG,EAAE,CAAC,MAAM;QACvB,aAAa,EAAE,KAAK,EAAE,OAAO,EAAE,EAAE;YAChC,MAAM,MAAM,GAAG,OAAO,CAAC,MAAM,CAAC;YAC9B,IAAI,MAAM,EAAE,CAAC;gBACZ,MAAM,QAAQ,GAAG,MAAM,CAAC,MAAM,CAAC,MAAM,CAAC,CAAC,KAAK,EAAE,EAAE,CAAC,KAAK,CAAC,QAAQ,KAAK,OAAO,CAA2B,CAAC;gBACvG,IAAI,QAAQ,CAAC,MAAM,GAAG,CAAC,EAAE,CAAC;oBACzB,MAAM,OAAO,CAAC,OAAO,CAAC;wBACrB,MAAM,EAAE,GAAG,EAAE;4BACZ,MAAM,GAAG,QAAQ,CAAC;wBACnB,CAAC;qBACD,CAAC,CAAC;gBACJ,CAAC;YACF,CAAC;YACD,IAAI,CAAC,OAAO,CAAC,YAAY,IAAI,OAAO,CAAC,MAAM,CAAC,OAAO;gBAAE,OAAO;YAC5D,MAAM,UAAU,GAAG,OAAO,CAAC,UAAU,CAAC;YACtC,MAAM,MAAM,GAAG,UAAU,EAAE,IAAI,KAAK,OAAO,CAAC,CAAC,CAAC,UAAU,CAAC,MAAM,CAAC,CAAC,CAAC,UAAU,EAAE,GAAG,CAAC;YAClF,IAAI,CAAC,MAAM;gBAAE,OAAO;YACpB,MAAM,UAAU,GAAG,MAAM,gBAAgB,CAAC,EAAE,MAAM,EAAE,OAAO,EAAE,sBAAsB,EAAE,MAAM,EAAE,OAAO,CAAC,MAAM,EAAE,CAAC,CAAC;YAC/G,IAAI,CAAC,UAAU,IAAI,OAAO,CAAC,MAAM,CAAC,OAAO;gBAAE,OAAO;YAClD,MAAM,OAAO,CAAC,OAAO,CAAC;gBACrB,OAAO,EAAE,EAAE,MAAM,EAAE,UAAU,EAAE,SAAS,EAAE,IAAI,CAAC,GAAG,EAAE,EAAE;gBACtD,MAAM,EAAE,GAAG,EAAE;oBACZ,MAAM,GAAG,UAAU,CAAC;gBACrB,CAAC;aACD,CAAC,CAAC;QACJ,CAAC;KACD,CAAC;AACH,CAAC","sourcesContent":["import { fetchDevinModels } from \"../api/devin-agent/discovery.ts\";\nimport { DEVIN_DEFAULT_BASE_URL } from \"../api/devin-agent/paths.ts\";\nimport { devinAgentApi } from \"../api/devin-agent.lazy.ts\";\nimport { lazyOAuth } from \"../auth/helpers.ts\";\nimport { loadDevinOAuth } from \"../auth/oauth/load.ts\";\nimport { createProvider, type Provider } from \"../models.ts\";\nimport type { Model } from \"../types.ts\";\nimport { DEVIN_MODELS } from \"./devin.models.ts\";\n\n/**\n * Devin (Cognition) Cascade provider.\n *\n * Auth is the CLI session token minted by the Devin OAuth flow. Cascade's\n * catalog is credential-scoped, so the static seed is a floor rather than the\n * truth: once a credential exists, `refreshModels` replaces it with the\n * account's real lanes and KEEPS the seed whenever discovery fails or reports\n * nothing, because publishing an empty catalog would strip a working provider.\n */\nexport function devinProvider(): Provider<\"devin-agent\"> {\n\tlet models: Model<\"devin-agent\">[] = DEVIN_MODELS;\n\n\tconst provider = createProvider<\"devin-agent\">({\n\t\tid: \"devin\",\n\t\tname: \"Devin\",\n\t\tbaseUrl: DEVIN_DEFAULT_BASE_URL,\n\t\tauth: {\n\t\t\toauth: lazyOAuth({ name: \"Devin\", loginLabel: \"Sign in with Devin\", load: loadDevinOAuth }),\n\t\t},\n\t\tmodels: DEVIN_MODELS,\n\t\tapi: { \"devin-agent\": devinAgentApi() },\n\t});\n\n\treturn {\n\t\t...provider,\n\t\tgetModels: () => models,\n\t\trefreshModels: async (context) => {\n\t\t\tconst stored = context.stored;\n\t\t\tif (stored) {\n\t\t\t\tconst restored = stored.models.filter((model) => model.provider === \"devin\") as Model<\"devin-agent\">[];\n\t\t\t\tif (restored.length > 0) {\n\t\t\t\t\tawait context.publish({\n\t\t\t\t\t\tupdate: () => {\n\t\t\t\t\t\t\tmodels = restored;\n\t\t\t\t\t\t},\n\t\t\t\t\t});\n\t\t\t\t}\n\t\t\t}\n\t\t\tif (!context.allowNetwork || context.signal.aborted) return;\n\t\t\tconst credential = context.credential;\n\t\t\tconst apiKey = credential?.type === \"oauth\" ? credential.access : credential?.key;\n\t\t\tif (!apiKey) return;\n\t\t\tconst discovered = await fetchDevinModels({ apiKey, baseUrl: DEVIN_DEFAULT_BASE_URL, signal: context.signal });\n\t\t\tif (!discovered || context.signal.aborted) return;\n\t\t\tawait context.publish({\n\t\t\t\tpersist: { models: discovered, checkedAt: Date.now() },\n\t\t\t\tupdate: () => {\n\t\t\t\t\tmodels = discovered;\n\t\t\t\t},\n\t\t\t});\n\t\t},\n\t};\n}\n"]}
|
|
@@ -2,8 +2,10 @@
|
|
|
2
2
|
* Devin's credential-free model seed.
|
|
3
3
|
*
|
|
4
4
|
* Cascade's real catalog is credential-scoped (see api/devin-agent/discovery.ts),
|
|
5
|
-
* so the bundle ships the lanes Devin
|
|
6
|
-
* discovery replace them once an account is signed in.
|
|
5
|
+
* so the bundle ships the lanes the released Devin CLI names and lets runtime
|
|
6
|
+
* discovery replace them once an account is signed in. The bare `swe-2` uid is
|
|
7
|
+
* deliberately absent: Cascade only serves SWE-2 through its effort lanes and
|
|
8
|
+
* answers the bare uid with permission_denied.
|
|
7
9
|
*/
|
|
8
10
|
import type { Model } from "../types.ts";
|
|
9
11
|
export declare const DEVIN_MODELS: Model<"devin-agent">[];
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"devin.models.d.ts","sourceRoot":"","sources":["../../src/providers/devin.models.ts"],"names":[],"mappings":"AAAA
|
|
1
|
+
{"version":3,"file":"devin.models.d.ts","sourceRoot":"","sources":["../../src/providers/devin.models.ts"],"names":[],"mappings":"AAAA;;;;;;;;GAQG;AAEH,OAAO,KAAK,EAAE,KAAK,EAAE,MAAM,aAAa,CAAC;AAuBzC,eAAO,MAAM,YAAY,EAAE,KAAK,CAAC,aAAa,CAAC,EAO9C,CAAC"}
|
|
@@ -2,27 +2,36 @@
|
|
|
2
2
|
* Devin's credential-free model seed.
|
|
3
3
|
*
|
|
4
4
|
* Cascade's real catalog is credential-scoped (see api/devin-agent/discovery.ts),
|
|
5
|
-
* so the bundle ships the lanes Devin
|
|
6
|
-
* discovery replace them once an account is signed in.
|
|
5
|
+
* so the bundle ships the lanes the released Devin CLI names and lets runtime
|
|
6
|
+
* discovery replace them once an account is signed in. The bare `swe-2` uid is
|
|
7
|
+
* deliberately absent: Cascade only serves SWE-2 through its effort lanes and
|
|
8
|
+
* answers the bare uid with permission_denied.
|
|
7
9
|
*/
|
|
8
|
-
|
|
10
|
+
import { DEVIN_DEFAULT_BASE_URL } from "../api/devin-agent/paths.js";
|
|
11
|
+
const SWE_2_CONTEXT_WINDOW = 262_000;
|
|
12
|
+
const SWE_1_6_CONTEXT_WINDOW = 200_000;
|
|
13
|
+
const SWE_MAX_TOKENS = 64_000;
|
|
14
|
+
function devinModel(id, name, contextWindow) {
|
|
9
15
|
return {
|
|
10
16
|
id,
|
|
11
17
|
name,
|
|
12
18
|
api: "devin-agent",
|
|
13
19
|
provider: "devin",
|
|
14
|
-
baseUrl:
|
|
20
|
+
baseUrl: DEVIN_DEFAULT_BASE_URL,
|
|
15
21
|
reasoning: true,
|
|
16
22
|
input: ["text"],
|
|
17
23
|
cost: { input: 0, output: 0, cacheRead: 0, cacheWrite: 0 },
|
|
18
24
|
contextWindow,
|
|
19
|
-
maxTokens,
|
|
25
|
+
maxTokens: SWE_MAX_TOKENS,
|
|
26
|
+
compat: { supportsParallelToolCalls: true },
|
|
20
27
|
};
|
|
21
28
|
}
|
|
22
29
|
export const DEVIN_MODELS = [
|
|
23
|
-
devinModel("swe-2", "SWE-2",
|
|
24
|
-
devinModel("swe-2-
|
|
25
|
-
devinModel("swe-
|
|
26
|
-
devinModel("swe-
|
|
30
|
+
devinModel("swe-2-high", "SWE-2 (high)", SWE_2_CONTEXT_WINDOW),
|
|
31
|
+
devinModel("swe-2-max", "SWE-2 (max)", SWE_2_CONTEXT_WINDOW),
|
|
32
|
+
devinModel("swe-2-low", "SWE-2 (low)", SWE_2_CONTEXT_WINDOW),
|
|
33
|
+
devinModel("swe-2-high-lite", "SWE-2 (high, lite)", SWE_2_CONTEXT_WINDOW),
|
|
34
|
+
devinModel("swe-1-6", "SWE-1.6", SWE_1_6_CONTEXT_WINDOW),
|
|
35
|
+
devinModel("swe-1-6-fast", "SWE-1.6 Fast", SWE_1_6_CONTEXT_WINDOW),
|
|
27
36
|
];
|
|
28
37
|
//# sourceMappingURL=devin.models.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"devin.models.js","sourceRoot":"","sources":["../../src/providers/devin.models.ts"],"names":[],"mappings":"AAAA
|
|
1
|
+
{"version":3,"file":"devin.models.js","sourceRoot":"","sources":["../../src/providers/devin.models.ts"],"names":[],"mappings":"AAAA;;;;;;;;GAQG;AAGH,OAAO,EAAE,sBAAsB,EAAE,MAAM,6BAA6B,CAAC;AAErE,MAAM,oBAAoB,GAAG,OAAO,CAAC;AACrC,MAAM,sBAAsB,GAAG,OAAO,CAAC;AACvC,MAAM,cAAc,GAAG,MAAM,CAAC;AAE9B,SAAS,UAAU,CAAC,EAAU,EAAE,IAAY,EAAE,aAAqB;IAClE,OAAO;QACN,EAAE;QACF,IAAI;QACJ,GAAG,EAAE,aAAa;QAClB,QAAQ,EAAE,OAAO;QACjB,OAAO,EAAE,sBAAsB;QAC/B,SAAS,EAAE,IAAI;QACf,KAAK,EAAE,CAAC,MAAM,CAAC;QACf,IAAI,EAAE,EAAE,KAAK,EAAE,CAAC,EAAE,MAAM,EAAE,CAAC,EAAE,SAAS,EAAE,CAAC,EAAE,UAAU,EAAE,CAAC,EAAE;QAC1D,aAAa;QACb,SAAS,EAAE,cAAc;QACzB,MAAM,EAAE,EAAE,yBAAyB,EAAE,IAAI,EAAE;KAC3C,CAAC;AACH,CAAC;AAED,MAAM,CAAC,MAAM,YAAY,GAA2B;IACnD,UAAU,CAAC,YAAY,EAAE,cAAc,EAAE,oBAAoB,CAAC;IAC9D,UAAU,CAAC,WAAW,EAAE,aAAa,EAAE,oBAAoB,CAAC;IAC5D,UAAU,CAAC,WAAW,EAAE,aAAa,EAAE,oBAAoB,CAAC;IAC5D,UAAU,CAAC,iBAAiB,EAAE,oBAAoB,EAAE,oBAAoB,CAAC;IACzE,UAAU,CAAC,SAAS,EAAE,SAAS,EAAE,sBAAsB,CAAC;IACxD,UAAU,CAAC,cAAc,EAAE,cAAc,EAAE,sBAAsB,CAAC;CAClE,CAAC","sourcesContent":["/**\n * Devin's credential-free model seed.\n *\n * Cascade's real catalog is credential-scoped (see api/devin-agent/discovery.ts),\n * so the bundle ships the lanes the released Devin CLI names and lets runtime\n * discovery replace them once an account is signed in. The bare `swe-2` uid is\n * deliberately absent: Cascade only serves SWE-2 through its effort lanes and\n * answers the bare uid with permission_denied.\n */\n\nimport type { Model } from \"../types.ts\";\nimport { DEVIN_DEFAULT_BASE_URL } from \"../api/devin-agent/paths.ts\";\n\nconst SWE_2_CONTEXT_WINDOW = 262_000;\nconst SWE_1_6_CONTEXT_WINDOW = 200_000;\nconst SWE_MAX_TOKENS = 64_000;\n\nfunction devinModel(id: string, name: string, contextWindow: number): Model<\"devin-agent\"> {\n\treturn {\n\t\tid,\n\t\tname,\n\t\tapi: \"devin-agent\",\n\t\tprovider: \"devin\",\n\t\tbaseUrl: DEVIN_DEFAULT_BASE_URL,\n\t\treasoning: true,\n\t\tinput: [\"text\"],\n\t\tcost: { input: 0, output: 0, cacheRead: 0, cacheWrite: 0 },\n\t\tcontextWindow,\n\t\tmaxTokens: SWE_MAX_TOKENS,\n\t\tcompat: { supportsParallelToolCalls: true },\n\t};\n}\n\nexport const DEVIN_MODELS: Model<\"devin-agent\">[] = [\n\tdevinModel(\"swe-2-high\", \"SWE-2 (high)\", SWE_2_CONTEXT_WINDOW),\n\tdevinModel(\"swe-2-max\", \"SWE-2 (max)\", SWE_2_CONTEXT_WINDOW),\n\tdevinModel(\"swe-2-low\", \"SWE-2 (low)\", SWE_2_CONTEXT_WINDOW),\n\tdevinModel(\"swe-2-high-lite\", \"SWE-2 (high, lite)\", SWE_2_CONTEXT_WINDOW),\n\tdevinModel(\"swe-1-6\", \"SWE-1.6\", SWE_1_6_CONTEXT_WINDOW),\n\tdevinModel(\"swe-1-6-fast\", \"SWE-1.6 Fast\", SWE_1_6_CONTEXT_WINDOW),\n];\n"]}
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Same resolution as the conversation rotation store: an explicit override
|
|
3
|
+
* first, then the agent directory the host configured, then the default one.
|
|
4
|
+
*/
|
|
5
|
+
export declare function resolveCursorContextLimitStorePath(env?: NodeJS.ProcessEnv): string;
|
|
6
|
+
/** Records the ceiling Cursor reported for `modelId`; ignores non-positive values. */
|
|
7
|
+
export declare function recordCursorContextLimit(modelId: string, maxTokens: number | undefined): void;
|
|
8
|
+
export declare function getCursorContextLimit(modelId: string): number | undefined;
|
|
9
|
+
/** The window to trust for `modelId`: what the server reported, else the catalog. */
|
|
10
|
+
export declare function resolveCursorContextWindow(modelId: string, catalogWindow: number): number;
|
|
11
|
+
export declare function resetCursorContextLimitStoreForTest(): void;
|
|
12
|
+
//# sourceMappingURL=cursor-context-limit.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"cursor-context-limit.d.ts","sourceRoot":"","sources":["../../src/utils/cursor-context-limit.ts"],"names":[],"mappings":"AAqBA;;;GAGG;AACH,wBAAgB,kCAAkC,CAAC,GAAG,GAAE,MAAM,CAAC,UAAwB,GAAG,MAAM,CAO/F;AAgDD,sFAAsF;AACtF,wBAAgB,wBAAwB,CAAC,OAAO,EAAE,MAAM,EAAE,SAAS,EAAE,MAAM,GAAG,SAAS,GAAG,IAAI,CAG7F;AAED,wBAAgB,qBAAqB,CAAC,OAAO,EAAE,MAAM,GAAG,MAAM,GAAG,SAAS,CAGzE;AAED,qFAAqF;AACrF,wBAAgB,0BAA0B,CAAC,OAAO,EAAE,MAAM,EAAE,aAAa,EAAE,MAAM,GAAG,MAAM,CAGzF;AAED,wBAAgB,mCAAmC,IAAI,IAAI,CAG1D"}
|
|
@@ -0,0 +1,93 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Node entry point for the observed Cursor context limits.
|
|
3
|
+
*
|
|
4
|
+
* The store itself (`cursor/context-limit-store.ts`) is browser-safe because the
|
|
5
|
+
* catalog builders that read it are bundled for the browser. Persistence needs
|
|
6
|
+
* `node:fs`, so it lives here and is installed on first use rather than as an
|
|
7
|
+
* import side effect, which a bundler is free to drop for a package declared
|
|
8
|
+
* side-effect-free. Node callers - the `cursor-agent` stream and the coding
|
|
9
|
+
* agent - use this module; browser-facing code uses the store directly.
|
|
10
|
+
*/
|
|
11
|
+
import { mkdirSync, readFileSync, renameSync, writeFileSync } from "node:fs";
|
|
12
|
+
import { dirname } from "node:path";
|
|
13
|
+
import { installCursorContextLimitPersistence, getCursorContextLimit as readObservedLimit, recordCursorContextLimit as recordObservedLimit, resetCursorContextLimitStoreForTest as resetObservedLimits, resolveCursorContextWindow as resolveObservedWindow, } from "../cursor/context-limit-store.js";
|
|
14
|
+
/**
|
|
15
|
+
* Same resolution as the conversation rotation store: an explicit override
|
|
16
|
+
* first, then the agent directory the host configured, then the default one.
|
|
17
|
+
*/
|
|
18
|
+
export function resolveCursorContextLimitStorePath(env = process.env) {
|
|
19
|
+
if (env.CURSOR_CONTEXT_LIMIT_STORE) {
|
|
20
|
+
return env.CURSOR_CONTEXT_LIMIT_STORE;
|
|
21
|
+
}
|
|
22
|
+
const agentDir = env.SENPI_CODING_AGENT_DIR ?? env.CODING_AGENT_DIR ?? `${(env.HOME ?? ".").replace(/\/$/, "")}/.senpi/agent`;
|
|
23
|
+
return `${agentDir.replace(/\/$/, "")}/cursor-context-limits.json`;
|
|
24
|
+
}
|
|
25
|
+
let savingEnabled = true;
|
|
26
|
+
const filePersistence = {
|
|
27
|
+
load: () => {
|
|
28
|
+
const limits = new Map();
|
|
29
|
+
let parsed;
|
|
30
|
+
try {
|
|
31
|
+
parsed = JSON.parse(readFileSync(resolveCursorContextLimitStorePath(), "utf8"));
|
|
32
|
+
}
|
|
33
|
+
catch (error) {
|
|
34
|
+
// No file on first run, and a truncated or hand-edited one is the same
|
|
35
|
+
// situation for a cache: the catalog window is the documented fallback.
|
|
36
|
+
if (error instanceof Error)
|
|
37
|
+
return limits;
|
|
38
|
+
throw error;
|
|
39
|
+
}
|
|
40
|
+
if (!parsed || typeof parsed !== "object" || Array.isArray(parsed))
|
|
41
|
+
return limits;
|
|
42
|
+
for (const [modelId, maxTokens] of Object.entries(parsed)) {
|
|
43
|
+
if (typeof maxTokens === "number" && Number.isFinite(maxTokens) && maxTokens > 0) {
|
|
44
|
+
limits.set(modelId, maxTokens);
|
|
45
|
+
}
|
|
46
|
+
}
|
|
47
|
+
return limits;
|
|
48
|
+
},
|
|
49
|
+
save: (limits) => {
|
|
50
|
+
if (!savingEnabled)
|
|
51
|
+
return;
|
|
52
|
+
const path = resolveCursorContextLimitStorePath();
|
|
53
|
+
const record = {};
|
|
54
|
+
for (const [modelId, maxTokens] of limits)
|
|
55
|
+
record[modelId] = maxTokens;
|
|
56
|
+
try {
|
|
57
|
+
mkdirSync(dirname(path), { recursive: true });
|
|
58
|
+
const temporaryPath = `${path}.${process.pid}.tmp`;
|
|
59
|
+
writeFileSync(temporaryPath, `${JSON.stringify(record, null, 2)}\n`);
|
|
60
|
+
renameSync(temporaryPath, path);
|
|
61
|
+
}
|
|
62
|
+
catch (error) {
|
|
63
|
+
// This file is a cache for the next process. A read-only agent directory
|
|
64
|
+
// must not fail the live turn that observed the limit, and one failure
|
|
65
|
+
// disables saving so a broken path cannot cost a write per checkpoint.
|
|
66
|
+
if (!(error instanceof Error))
|
|
67
|
+
throw error;
|
|
68
|
+
savingEnabled = false;
|
|
69
|
+
}
|
|
70
|
+
},
|
|
71
|
+
};
|
|
72
|
+
function ensurePersistenceInstalled() {
|
|
73
|
+
installCursorContextLimitPersistence(filePersistence);
|
|
74
|
+
}
|
|
75
|
+
/** Records the ceiling Cursor reported for `modelId`; ignores non-positive values. */
|
|
76
|
+
export function recordCursorContextLimit(modelId, maxTokens) {
|
|
77
|
+
ensurePersistenceInstalled();
|
|
78
|
+
recordObservedLimit(modelId, maxTokens);
|
|
79
|
+
}
|
|
80
|
+
export function getCursorContextLimit(modelId) {
|
|
81
|
+
ensurePersistenceInstalled();
|
|
82
|
+
return readObservedLimit(modelId);
|
|
83
|
+
}
|
|
84
|
+
/** The window to trust for `modelId`: what the server reported, else the catalog. */
|
|
85
|
+
export function resolveCursorContextWindow(modelId, catalogWindow) {
|
|
86
|
+
ensurePersistenceInstalled();
|
|
87
|
+
return resolveObservedWindow(modelId, catalogWindow);
|
|
88
|
+
}
|
|
89
|
+
export function resetCursorContextLimitStoreForTest() {
|
|
90
|
+
savingEnabled = true;
|
|
91
|
+
resetObservedLimits();
|
|
92
|
+
}
|
|
93
|
+
//# sourceMappingURL=cursor-context-limit.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"cursor-context-limit.js","sourceRoot":"","sources":["../../src/utils/cursor-context-limit.ts"],"names":[],"mappings":"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","sourcesContent":["/**\n * Node entry point for the observed Cursor context limits.\n *\n * The store itself (`cursor/context-limit-store.ts`) is browser-safe because the\n * catalog builders that read it are bundled for the browser. Persistence needs\n * `node:fs`, so it lives here and is installed on first use rather than as an\n * import side effect, which a bundler is free to drop for a package declared\n * side-effect-free. Node callers - the `cursor-agent` stream and the coding\n * agent - use this module; browser-facing code uses the store directly.\n */\nimport { mkdirSync, readFileSync, renameSync, writeFileSync } from \"node:fs\";\nimport { dirname } from \"node:path\";\nimport {\n\ttype CursorContextLimitPersistence,\n\tinstallCursorContextLimitPersistence,\n\tgetCursorContextLimit as readObservedLimit,\n\trecordCursorContextLimit as recordObservedLimit,\n\tresetCursorContextLimitStoreForTest as resetObservedLimits,\n\tresolveCursorContextWindow as resolveObservedWindow,\n} from \"../cursor/context-limit-store.ts\";\n\n/**\n * Same resolution as the conversation rotation store: an explicit override\n * first, then the agent directory the host configured, then the default one.\n */\nexport function resolveCursorContextLimitStorePath(env: NodeJS.ProcessEnv = process.env): string {\n\tif (env.CURSOR_CONTEXT_LIMIT_STORE) {\n\t\treturn env.CURSOR_CONTEXT_LIMIT_STORE;\n\t}\n\tconst agentDir =\n\t\tenv.SENPI_CODING_AGENT_DIR ?? env.CODING_AGENT_DIR ?? `${(env.HOME ?? \".\").replace(/\\/$/, \"\")}/.senpi/agent`;\n\treturn `${agentDir.replace(/\\/$/, \"\")}/cursor-context-limits.json`;\n}\n\nlet savingEnabled = true;\n\nconst filePersistence: CursorContextLimitPersistence = {\n\tload: () => {\n\t\tconst limits = new Map<string, number>();\n\t\tlet parsed: unknown;\n\t\ttry {\n\t\t\tparsed = JSON.parse(readFileSync(resolveCursorContextLimitStorePath(), \"utf8\"));\n\t\t} catch (error) {\n\t\t\t// No file on first run, and a truncated or hand-edited one is the same\n\t\t\t// situation for a cache: the catalog window is the documented fallback.\n\t\t\tif (error instanceof Error) return limits;\n\t\t\tthrow error;\n\t\t}\n\t\tif (!parsed || typeof parsed !== \"object\" || Array.isArray(parsed)) return limits;\n\t\tfor (const [modelId, maxTokens] of Object.entries(parsed)) {\n\t\t\tif (typeof maxTokens === \"number\" && Number.isFinite(maxTokens) && maxTokens > 0) {\n\t\t\t\tlimits.set(modelId, maxTokens);\n\t\t\t}\n\t\t}\n\t\treturn limits;\n\t},\n\tsave: (limits) => {\n\t\tif (!savingEnabled) return;\n\t\tconst path = resolveCursorContextLimitStorePath();\n\t\tconst record: Record<string, number> = {};\n\t\tfor (const [modelId, maxTokens] of limits) record[modelId] = maxTokens;\n\t\ttry {\n\t\t\tmkdirSync(dirname(path), { recursive: true });\n\t\t\tconst temporaryPath = `${path}.${process.pid}.tmp`;\n\t\t\twriteFileSync(temporaryPath, `${JSON.stringify(record, null, 2)}\\n`);\n\t\t\trenameSync(temporaryPath, path);\n\t\t} catch (error) {\n\t\t\t// This file is a cache for the next process. A read-only agent directory\n\t\t\t// must not fail the live turn that observed the limit, and one failure\n\t\t\t// disables saving so a broken path cannot cost a write per checkpoint.\n\t\t\tif (!(error instanceof Error)) throw error;\n\t\t\tsavingEnabled = false;\n\t\t}\n\t},\n};\n\nfunction ensurePersistenceInstalled(): void {\n\tinstallCursorContextLimitPersistence(filePersistence);\n}\n\n/** Records the ceiling Cursor reported for `modelId`; ignores non-positive values. */\nexport function recordCursorContextLimit(modelId: string, maxTokens: number | undefined): void {\n\tensurePersistenceInstalled();\n\trecordObservedLimit(modelId, maxTokens);\n}\n\nexport function getCursorContextLimit(modelId: string): number | undefined {\n\tensurePersistenceInstalled();\n\treturn readObservedLimit(modelId);\n}\n\n/** The window to trust for `modelId`: what the server reported, else the catalog. */\nexport function resolveCursorContextWindow(modelId: string, catalogWindow: number): number {\n\tensurePersistenceInstalled();\n\treturn resolveObservedWindow(modelId, catalogWindow);\n}\n\nexport function resetCursorContextLimitStoreForTest(): void {\n\tsavingEnabled = true;\n\tresetObservedLimits();\n}\n"]}
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@earendil-works/pi-ai",
|
|
3
|
-
"version": "2026.9.
|
|
3
|
+
"version": "2026.9.12-2",
|
|
4
4
|
"description": "Unified LLM API with automatic model discovery and provider configuration",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"main": "./dist/index.js",
|
|
@@ -76,7 +76,7 @@
|
|
|
76
76
|
"dependencies": {
|
|
77
77
|
"@anthropic-ai/sdk": "0.123.0",
|
|
78
78
|
"@aws-sdk/client-bedrock-runtime": "3.1116.0",
|
|
79
|
-
"@earendil-works/pi-telemetry": "npm:@code-yeongyu/senpi-telemetry@2026.9.
|
|
79
|
+
"@earendil-works/pi-telemetry": "npm:@code-yeongyu/senpi-telemetry@2026.9.12-2",
|
|
80
80
|
"@google/genai": "2.18.0",
|
|
81
81
|
"@smithy/node-http-handler": "4.11.3",
|
|
82
82
|
"http-proxy-agent": "9.1.0",
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@code-yeongyu/senpi",
|
|
3
|
-
"version": "2026.9.
|
|
3
|
+
"version": "2026.9.12-2",
|
|
4
4
|
"description": "Coding agent CLI with read, bash, edit, write tools and session management",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"piConfig": {
|
|
@@ -48,9 +48,9 @@
|
|
|
48
48
|
"qa:app-server": "node scripts/qa-app-server/run-all.mjs"
|
|
49
49
|
},
|
|
50
50
|
"dependencies": {
|
|
51
|
-
"@earendil-works/pi-agent-core": "npm:@code-yeongyu/senpi-agent-core@2026.9.
|
|
52
|
-
"@earendil-works/pi-ai": "npm:@code-yeongyu/senpi-ai@2026.9.
|
|
53
|
-
"@earendil-works/pi-tui": "npm:@code-yeongyu/senpi-tui@2026.9.
|
|
51
|
+
"@earendil-works/pi-agent-core": "npm:@code-yeongyu/senpi-agent-core@2026.9.12-2",
|
|
52
|
+
"@earendil-works/pi-ai": "npm:@code-yeongyu/senpi-ai@2026.9.12-2",
|
|
53
|
+
"@earendil-works/pi-tui": "npm:@code-yeongyu/senpi-tui@2026.9.12-2",
|
|
54
54
|
"@silvia-odwyer/photon-node": "0.3.4",
|
|
55
55
|
"chalk": "6.0.0",
|
|
56
56
|
"cross-spawn": "7.0.6",
|
|
@@ -70,8 +70,8 @@
|
|
|
70
70
|
"@anthropic-ai/sdk": "0.123.0",
|
|
71
71
|
"@aws-sdk/client-bedrock-runtime": "3.1116.0",
|
|
72
72
|
"@bufbuild/protobuf": "2.14.0",
|
|
73
|
-
"@code-yeongyu/senpi-codemode": "2026.9.
|
|
74
|
-
"@earendil-works/pi-pty": "npm:@code-yeongyu/senpi-pty@2026.9.
|
|
73
|
+
"@code-yeongyu/senpi-codemode": "2026.9.12-2",
|
|
74
|
+
"@earendil-works/pi-pty": "npm:@code-yeongyu/senpi-pty@2026.9.12-2",
|
|
75
75
|
"@modelcontextprotocol/sdk": "1.30.0",
|
|
76
76
|
"@mozilla/readability": "0.6.0",
|
|
77
77
|
"@opentelemetry/api": "1.9.1",
|
|
@@ -119,7 +119,7 @@
|
|
|
119
119
|
"@csstools/css-parser-algorithms": "4.0.0",
|
|
120
120
|
"@csstools/css-syntax-patches-for-csstree": "1.1.8",
|
|
121
121
|
"@csstools/css-tokenizer": "4.0.0",
|
|
122
|
-
"@earendil-works/pi-telemetry": "npm:@code-yeongyu/senpi-telemetry@2026.9.
|
|
122
|
+
"@earendil-works/pi-telemetry": "npm:@code-yeongyu/senpi-telemetry@2026.9.12-2",
|
|
123
123
|
"@exodus/bytes": "1.15.1",
|
|
124
124
|
"@google/genai": "2.18.0",
|
|
125
125
|
"@hono/node-server": "2.1.1",
|