@excitedjs/agent-runtime-codex 0.6.1-beta.252 → 0.7.0-alpha.ged3454ecaaed
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 +31 -8
- package/dist/activity/cursor.d.ts +0 -1
- package/dist/activity/cursor.d.ts.map +1 -1
- package/dist/activity/cursor.js +4 -8
- package/dist/activity/cursor.js.map +1 -1
- package/dist/activity/opened-file.d.ts.map +1 -1
- package/dist/activity/opened-file.js +13 -10
- package/dist/activity/opened-file.js.map +1 -1
- package/dist/activity/path.d.ts +9 -3
- package/dist/activity/path.d.ts.map +1 -1
- package/dist/activity/path.js +55 -49
- package/dist/activity/path.js.map +1 -1
- package/dist/activity/reader.d.ts +1 -4
- package/dist/activity/reader.d.ts.map +1 -1
- package/dist/activity/reader.js +30 -56
- package/dist/activity/reader.js.map +1 -1
- package/dist/args.d.ts +14 -18
- package/dist/args.d.ts.map +1 -1
- package/dist/args.js +17 -36
- package/dist/args.js.map +1 -1
- package/dist/codex-home.d.ts +10 -6
- package/dist/codex-home.d.ts.map +1 -1
- package/dist/codex-home.js +24 -29
- package/dist/codex-home.js.map +1 -1
- package/dist/config.d.ts +3 -32
- package/dist/config.d.ts.map +1 -1
- package/dist/config.js +12 -46
- package/dist/config.js.map +1 -1
- package/dist/diagnostic.d.ts +7 -3
- package/dist/diagnostic.d.ts.map +1 -1
- package/dist/diagnostic.js +12 -4
- package/dist/diagnostic.js.map +1 -1
- package/dist/events.d.ts +18 -47
- package/dist/events.d.ts.map +1 -1
- package/dist/events.js +29 -198
- package/dist/events.js.map +1 -1
- package/dist/handshake.d.ts +1 -1
- package/dist/handshake.d.ts.map +1 -1
- package/dist/handshake.js.map +1 -1
- package/dist/index.d.ts +9 -18
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +9 -24
- package/dist/index.js.map +1 -1
- package/dist/output-schema-codec.d.ts.map +1 -1
- package/dist/output-schema-codec.js +7 -15
- package/dist/output-schema-codec.js.map +1 -1
- package/dist/paths.d.ts +11 -6
- package/dist/paths.d.ts.map +1 -1
- package/dist/paths.js +25 -18
- package/dist/paths.js.map +1 -1
- package/dist/plugin.d.ts +14 -0
- package/dist/plugin.d.ts.map +1 -0
- package/dist/plugin.js +11 -0
- package/dist/plugin.js.map +1 -0
- package/dist/provider.d.ts +9 -30
- package/dist/provider.d.ts.map +1 -1
- package/dist/provider.js +14 -49
- package/dist/provider.js.map +1 -1
- package/dist/reasoning-effort.d.ts +23 -0
- package/dist/reasoning-effort.d.ts.map +1 -0
- package/dist/reasoning-effort.js +75 -0
- package/dist/reasoning-effort.js.map +1 -0
- package/dist/rpc.d.ts.map +1 -1
- package/dist/rpc.js.map +1 -1
- package/dist/runtime-deps.d.ts +6 -11
- package/dist/runtime-deps.d.ts.map +1 -1
- package/dist/runtime.d.ts +0 -1
- package/dist/runtime.d.ts.map +1 -1
- package/dist/runtime.js +82 -41
- package/dist/runtime.js.map +1 -1
- package/dist/skill-roots.d.ts.map +1 -1
- package/dist/skill-roots.js +1 -3
- package/dist/skill-roots.js.map +1 -1
- package/dist/supervisor.d.ts +1 -1
- package/dist/supervisor.d.ts.map +1 -1
- package/dist/system-prompt.d.ts +9 -0
- package/dist/system-prompt.d.ts.map +1 -0
- package/dist/system-prompt.js +26 -0
- package/dist/system-prompt.js.map +1 -0
- package/dist/tool-display.d.ts.map +1 -1
- package/dist/tool-display.js +70 -19
- package/dist/tool-display.js.map +1 -1
- package/dist/turn-manager.d.ts +8 -1
- package/dist/turn-manager.d.ts.map +1 -1
- package/dist/turn-manager.js +139 -89
- package/dist/turn-manager.js.map +1 -1
- package/dist/types.d.ts +4 -2
- package/dist/types.d.ts.map +1 -1
- package/dist/version.d.ts.map +1 -1
- package/dist/version.js.map +1 -1
- package/package.json +5 -4
- package/dist/activity/budget.d.ts +0 -8
- package/dist/activity/budget.d.ts.map +0 -1
- package/dist/activity/budget.js +0 -9
- package/dist/activity/budget.js.map +0 -1
- package/dist/activity/error.d.ts +0 -16
- package/dist/activity/error.d.ts.map +0 -1
- package/dist/activity/error.js +0 -22
- package/dist/activity/error.js.map +0 -1
- package/dist/approval.d.ts +0 -31
- package/dist/approval.d.ts.map +0 -1
- package/dist/approval.js +0 -43
- package/dist/approval.js.map +0 -1
- package/dist/provider-ref.d.ts +0 -8
- package/dist/provider-ref.d.ts.map +0 -1
- package/dist/provider-ref.js +0 -8
- package/dist/provider-ref.js.map +0 -1
- package/dist/runtime-support.d.ts +0 -14
- package/dist/runtime-support.d.ts.map +0 -1
- package/dist/runtime-support.js +0 -35
- package/dist/runtime-support.js.map +0 -1
package/dist/version.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"version.d.ts","sourceRoot":"","sources":["../src/version.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;GAUG;AAEH,8CAA8C;AAC9C,eAAO,MAAM,iBAAiB,YAAY,CAAC;AAE3C,0EAA0E;AAC1E,wBAAgB,iBAAiB,
|
|
1
|
+
{"version":3,"file":"version.d.ts","sourceRoot":"","sources":["../src/version.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;GAUG;AAEH,8CAA8C;AAC9C,eAAO,MAAM,iBAAiB,YAAY,CAAC;AAE3C,0EAA0E;AAC1E,wBAAgB,iBAAiB,CAC/B,GAAG,EAAE,MAAM,GACV,CAAC,MAAM,EAAE,MAAM,EAAE,MAAM,CAAC,GAAG,IAAI,CAIjC;AAED,qFAAqF;AACrF,wBAAgB,qBAAqB,CAAC,GAAG,EAAE,MAAM,GAAG,OAAO,CAS1D"}
|
package/dist/version.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"version.js","sourceRoot":"","sources":["../src/version.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;GAUG;AAEH,8CAA8C;AAC9C,MAAM,CAAC,MAAM,iBAAiB,GAAG,SAAS,CAAC;AAE3C,0EAA0E;AAC1E,MAAM,UAAU,iBAAiB,
|
|
1
|
+
{"version":3,"file":"version.js","sourceRoot":"","sources":["../src/version.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;GAUG;AAEH,8CAA8C;AAC9C,MAAM,CAAC,MAAM,iBAAiB,GAAG,SAAS,CAAC;AAE3C,0EAA0E;AAC1E,MAAM,UAAU,iBAAiB,CAC/B,GAAW;IAEX,MAAM,KAAK,GAAG,GAAG,CAAC,KAAK,CAAC,qBAAqB,CAAC,CAAC;IAC/C,IAAI,KAAK,KAAK,IAAI;QAAE,OAAO,IAAI,CAAC;IAChC,OAAO,CAAC,MAAM,CAAC,KAAK,CAAC,CAAC,CAAC,CAAC,EAAE,MAAM,CAAC,KAAK,CAAC,CAAC,CAAC,CAAC,EAAE,MAAM,CAAC,KAAK,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC;AAChE,CAAC;AAED,qFAAqF;AACrF,MAAM,UAAU,qBAAqB,CAAC,GAAW;IAC/C,MAAM,GAAG,GAAG,iBAAiB,CAAC,GAAG,CAAC,CAAC;IACnC,IAAI,GAAG,KAAK,IAAI;QAAE,OAAO,KAAK,CAAC;IAC/B,MAAM,GAAG,GAAG,iBAAiB,CAAC,iBAAiB,CAAE,CAAC;IAClD,KAAK,IAAI,CAAC,GAAG,CAAC,EAAE,CAAC,GAAG,CAAC,EAAE,CAAC,IAAI,CAAC,EAAE,CAAC;QAC9B,IAAI,GAAG,CAAC,CAAC,CAAE,GAAG,GAAG,CAAC,CAAC,CAAE;YAAE,OAAO,IAAI,CAAC;QACnC,IAAI,GAAG,CAAC,CAAC,CAAE,GAAG,GAAG,CAAC,CAAC,CAAE;YAAE,OAAO,KAAK,CAAC;IACtC,CAAC;IACD,OAAO,IAAI,CAAC;AACd,CAAC"}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@excitedjs/agent-runtime-codex",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.7.0-alpha.ged3454ecaaed",
|
|
4
4
|
"description": "Built-in Codex Agent Runtime provider for Dreamux (alias builtin:codex). Implements the @excitedjs/dreamux-types AgentRuntimeProvider contract against the Codex app-server; depends only on provider-neutral Dreamux contracts and utilities, never on @excitedjs/dreamux core (issue excitedjs/dreamux#209).",
|
|
5
5
|
"license": "MIT",
|
|
6
6
|
"repository": {
|
|
@@ -32,8 +32,8 @@
|
|
|
32
32
|
"LICENSE"
|
|
33
33
|
],
|
|
34
34
|
"dependencies": {
|
|
35
|
-
"@excitedjs/dreamux-types": "0.11.0-
|
|
36
|
-
"@excitedjs/dreamux-utils": "0.6.0-
|
|
35
|
+
"@excitedjs/dreamux-types": "0.11.0-alpha.ged3454ecaaed",
|
|
36
|
+
"@excitedjs/dreamux-utils": "0.6.0-alpha.ged3454ecaaed",
|
|
37
37
|
"smol-toml": "^1.6.1",
|
|
38
38
|
"ws": "^8.18.0"
|
|
39
39
|
},
|
|
@@ -41,6 +41,7 @@
|
|
|
41
41
|
"@types/node": "^22.10.0",
|
|
42
42
|
"@types/ws": "^8.5.13",
|
|
43
43
|
"eslint": "^9.39.0",
|
|
44
|
+
"prettier": "^3.9.9",
|
|
44
45
|
"typescript": "^5.7.0",
|
|
45
46
|
"vitest": "^2.1.0",
|
|
46
47
|
"@excitedjs/eslint-config": "0.0.0"
|
|
@@ -49,7 +50,7 @@
|
|
|
49
50
|
"build": "tsc -p tsconfig.json",
|
|
50
51
|
"typecheck": "tsc -p tsconfig.json --noEmit",
|
|
51
52
|
"typecheck:tests": "tsc -p tsconfig.tests.json",
|
|
52
|
-
"lint": "eslint .",
|
|
53
|
+
"lint": "eslint . && prettier --check . '!**/*.md' '!**/dist/**' '!**/CHANGELOG.json' '!**/.rush/**'",
|
|
53
54
|
"test": "vitest run",
|
|
54
55
|
"test:watch": "vitest",
|
|
55
56
|
"clean": "rm -rf dist"
|
|
@@ -1,8 +0,0 @@
|
|
|
1
|
-
import { type ScanBudget } from '@excitedjs/dreamux-utils';
|
|
2
|
-
export type CodexScanBudget = ScanBudget;
|
|
3
|
-
export declare function createCodexScanBudget(input?: {
|
|
4
|
-
maxEntries?: number;
|
|
5
|
-
maxElapsedMs?: number;
|
|
6
|
-
now?: () => number;
|
|
7
|
-
}): CodexScanBudget;
|
|
8
|
-
//# sourceMappingURL=budget.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"budget.d.ts","sourceRoot":"","sources":["../../src/activity/budget.ts"],"names":[],"mappings":"AAAA,OAAO,EAEL,KAAK,UAAU,EAChB,MAAM,0BAA0B,CAAC;AAIlC,MAAM,MAAM,eAAe,GAAG,UAAU,CAAC;AAEzC,wBAAgB,qBAAqB,CAAC,KAAK,GAAE;IAC3C,UAAU,CAAC,EAAE,MAAM,CAAC;IACpB,YAAY,CAAC,EAAE,MAAM,CAAC;IACtB,GAAG,CAAC,EAAE,MAAM,MAAM,CAAC;CACf,GAAG,eAAe,CASvB"}
|
package/dist/activity/budget.js
DELETED
|
@@ -1,9 +0,0 @@
|
|
|
1
|
-
import { createScanBudget, } from '@excitedjs/dreamux-utils';
|
|
2
|
-
import { CodexActivityError } from './error.js';
|
|
3
|
-
export function createCodexScanBudget(input = {}) {
|
|
4
|
-
return createScanBudget({
|
|
5
|
-
...input,
|
|
6
|
-
limitError: () => new CodexActivityError('scan_unsupported', 'Codex activity read exceeded its bounded limit'),
|
|
7
|
-
});
|
|
8
|
-
}
|
|
9
|
-
//# sourceMappingURL=budget.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"budget.js","sourceRoot":"","sources":["../../src/activity/budget.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,gBAAgB,GAEjB,MAAM,0BAA0B,CAAC;AAElC,OAAO,EAAE,kBAAkB,EAAE,MAAM,YAAY,CAAC;AAIhD,MAAM,UAAU,qBAAqB,CAAC,QAIlC,EAAE;IACJ,OAAO,gBAAgB,CAAC;QACtB,GAAG,KAAK;QACR,UAAU,EAAE,GAAG,EAAE,CACf,IAAI,kBAAkB,CACpB,kBAAkB,EAClB,gDAAgD,CACjD;KACJ,CAAC,CAAC;AACL,CAAC"}
|
package/dist/activity/error.d.ts
DELETED
|
@@ -1,16 +0,0 @@
|
|
|
1
|
-
import type { AgentActivityError } from '@excitedjs/dreamux-types';
|
|
2
|
-
/**
|
|
3
|
-
* Why a Codex activity read failed, at native granularity. This is internal
|
|
4
|
-
* control-flow vocabulary: only the public {@link AgentActivityError.reason} it
|
|
5
|
-
* projects crosses the provider seam.
|
|
6
|
-
*/
|
|
7
|
-
export type CodexActivityDetail = 'not_found' | 'session_mismatch' | 'locator_outside_root' | 'unreadable' | 'invalid' | 'scan_unsupported' | 'cursor_invalid' | 'cursor_query_mismatch' | 'cursor_stale';
|
|
8
|
-
export declare class CodexActivityError extends Error implements AgentActivityError {
|
|
9
|
-
readonly detail: CodexActivityDetail;
|
|
10
|
-
readonly name = "AgentActivityError";
|
|
11
|
-
readonly reason: AgentActivityError['reason'];
|
|
12
|
-
constructor(detail: CodexActivityDetail, message: string, options?: {
|
|
13
|
-
cause?: unknown;
|
|
14
|
-
});
|
|
15
|
-
}
|
|
16
|
-
//# sourceMappingURL=error.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"error.d.ts","sourceRoot":"","sources":["../../src/activity/error.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,kBAAkB,EAAE,MAAM,0BAA0B,CAAC;AAEnE;;;;GAIG;AACH,MAAM,MAAM,mBAAmB,GAC3B,WAAW,GACX,kBAAkB,GAClB,sBAAsB,GACtB,YAAY,GACZ,SAAS,GACT,kBAAkB,GAClB,gBAAgB,GAChB,uBAAuB,GACvB,cAAc,CAAC;AAiBnB,qBAAa,kBAAmB,SAAQ,KAAM,YAAW,kBAAkB;IAMvE,QAAQ,CAAC,MAAM,EAAE,mBAAmB;IALtC,QAAQ,CAAC,IAAI,wBAAwB;IAErC,QAAQ,CAAC,MAAM,EAAE,kBAAkB,CAAC,QAAQ,CAAC,CAAC;gBAGnC,MAAM,EAAE,mBAAmB,EACpC,OAAO,EAAE,MAAM,EACf,OAAO,GAAE;QAAE,KAAK,CAAC,EAAE,OAAO,CAAA;KAAO;CAKpC"}
|
package/dist/activity/error.js
DELETED
|
@@ -1,22 +0,0 @@
|
|
|
1
|
-
const PUBLIC_REASON = {
|
|
2
|
-
not_found: 'session_unavailable',
|
|
3
|
-
session_mismatch: 'session_unavailable',
|
|
4
|
-
locator_outside_root: 'session_unavailable',
|
|
5
|
-
unreadable: 'session_unavailable',
|
|
6
|
-
invalid: 'activity_corrupt',
|
|
7
|
-
scan_unsupported: 'provider_failure',
|
|
8
|
-
cursor_invalid: 'cursor_invalid',
|
|
9
|
-
cursor_query_mismatch: 'cursor_invalid',
|
|
10
|
-
cursor_stale: 'cursor_invalid',
|
|
11
|
-
};
|
|
12
|
-
export class CodexActivityError extends Error {
|
|
13
|
-
detail;
|
|
14
|
-
name = 'AgentActivityError';
|
|
15
|
-
reason;
|
|
16
|
-
constructor(detail, message, options = {}) {
|
|
17
|
-
super(message, options);
|
|
18
|
-
this.detail = detail;
|
|
19
|
-
this.reason = PUBLIC_REASON[detail];
|
|
20
|
-
}
|
|
21
|
-
}
|
|
22
|
-
//# sourceMappingURL=error.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"error.js","sourceRoot":"","sources":["../../src/activity/error.ts"],"names":[],"mappings":"AAkBA,MAAM,aAAa,GAGf;IACF,SAAS,EAAE,qBAAqB;IAChC,gBAAgB,EAAE,qBAAqB;IACvC,oBAAoB,EAAE,qBAAqB;IAC3C,UAAU,EAAE,qBAAqB;IACjC,OAAO,EAAE,kBAAkB;IAC3B,gBAAgB,EAAE,kBAAkB;IACpC,cAAc,EAAE,gBAAgB;IAChC,qBAAqB,EAAE,gBAAgB;IACvC,YAAY,EAAE,gBAAgB;CAC/B,CAAC;AAEF,MAAM,OAAO,kBAAmB,SAAQ,KAAK;IAMhC;IALF,IAAI,GAAG,oBAAoB,CAAC;IAE5B,MAAM,CAA+B;IAE9C,YACW,MAA2B,EACpC,OAAe,EACf,UAA+B,EAAE;QAEjC,KAAK,CAAC,OAAO,EAAE,OAAO,CAAC,CAAC;QAJf,WAAM,GAAN,MAAM,CAAqB;QAKpC,IAAI,CAAC,MAAM,GAAG,aAAa,CAAC,MAAM,CAAC,CAAC;IACtC,CAAC;CACF"}
|
package/dist/approval.d.ts
DELETED
|
@@ -1,31 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Approval handler for Codex server→client requests.
|
|
3
|
-
*
|
|
4
|
-
* Issue #2, "trust model" and "implementation pitfalls":
|
|
5
|
-
* - MVP runs Codex with approval-policy=never (or auto-approve).
|
|
6
|
-
* - If a server-request still arrives (e.g. because policy was misconfigured
|
|
7
|
-
* or codex escalates anyway), fail loudly — never return null. Silent null
|
|
8
|
-
* is the trap that hangs the daemon.
|
|
9
|
-
*
|
|
10
|
-
* `onReject` is an observer hook for logs or metrics. A runtime package knows
|
|
11
|
-
* nothing about Channels, so this handler must not try to reach a user: the
|
|
12
|
-
* rejection travels back to codex, and Core decides what any Channel says.
|
|
13
|
-
*/
|
|
14
|
-
import type { ServerRequest } from './types.js';
|
|
15
|
-
export interface ApprovalHandlerOptions {
|
|
16
|
-
/**
|
|
17
|
-
* Called when a server-request is rejected. Errors thrown here are swallowed
|
|
18
|
-
* because the rejection itself still propagates to codex.
|
|
19
|
-
*/
|
|
20
|
-
onReject?: (req: ServerRequest) => void | Promise<void>;
|
|
21
|
-
}
|
|
22
|
-
export declare function looksLikeApprovalRequest(method: string): boolean;
|
|
23
|
-
/**
|
|
24
|
-
* Build a fail-fast server-request handler.
|
|
25
|
-
*
|
|
26
|
-
* The handler always throws — i.e. every server-request becomes an `error`
|
|
27
|
-
* response on the wire — but it tags approval-related methods with a
|
|
28
|
-
* user-readable message and notifies `onReject`.
|
|
29
|
-
*/
|
|
30
|
-
export declare function createFailFastApprovalHandler(opts?: ApprovalHandlerOptions): (req: ServerRequest) => Promise<unknown>;
|
|
31
|
-
//# sourceMappingURL=approval.d.ts.map
|
package/dist/approval.d.ts.map
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"approval.d.ts","sourceRoot":"","sources":["../src/approval.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;GAYG;AAEH,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,YAAY,CAAC;AAEhD,MAAM,WAAW,sBAAsB;IACrC;;;OAGG;IACH,QAAQ,CAAC,EAAE,CAAC,GAAG,EAAE,aAAa,KAAK,IAAI,GAAG,OAAO,CAAC,IAAI,CAAC,CAAC;CACzD;AAKD,wBAAgB,wBAAwB,CAAC,MAAM,EAAE,MAAM,GAAG,OAAO,CAGhE;AAED;;;;;;GAMG;AACH,wBAAgB,6BAA6B,CAC3C,IAAI,GAAE,sBAA2B,IAEnB,KAAK,aAAa,KAAG,OAAO,CAAC,OAAO,CAAC,CAiBpD"}
|
package/dist/approval.js
DELETED
|
@@ -1,43 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Approval handler for Codex server→client requests.
|
|
3
|
-
*
|
|
4
|
-
* Issue #2, "trust model" and "implementation pitfalls":
|
|
5
|
-
* - MVP runs Codex with approval-policy=never (or auto-approve).
|
|
6
|
-
* - If a server-request still arrives (e.g. because policy was misconfigured
|
|
7
|
-
* or codex escalates anyway), fail loudly — never return null. Silent null
|
|
8
|
-
* is the trap that hangs the daemon.
|
|
9
|
-
*
|
|
10
|
-
* `onReject` is an observer hook for logs or metrics. A runtime package knows
|
|
11
|
-
* nothing about Channels, so this handler must not try to reach a user: the
|
|
12
|
-
* rejection travels back to codex, and Core decides what any Channel says.
|
|
13
|
-
*/
|
|
14
|
-
/** A method name like `exec_command_approval`, `apply_patch_approval`, etc. */
|
|
15
|
-
const APPROVAL_METHOD_HINTS = ['approval', 'approve', 'confirm', 'review'];
|
|
16
|
-
export function looksLikeApprovalRequest(method) {
|
|
17
|
-
const m = method.toLowerCase();
|
|
18
|
-
return APPROVAL_METHOD_HINTS.some((h) => m.includes(h));
|
|
19
|
-
}
|
|
20
|
-
/**
|
|
21
|
-
* Build a fail-fast server-request handler.
|
|
22
|
-
*
|
|
23
|
-
* The handler always throws — i.e. every server-request becomes an `error`
|
|
24
|
-
* response on the wire — but it tags approval-related methods with a
|
|
25
|
-
* user-readable message and notifies `onReject`.
|
|
26
|
-
*/
|
|
27
|
-
export function createFailFastApprovalHandler(opts = {}) {
|
|
28
|
-
return async (req) => {
|
|
29
|
-
if (opts.onReject !== undefined) {
|
|
30
|
-
try {
|
|
31
|
-
await opts.onReject(req);
|
|
32
|
-
}
|
|
33
|
-
catch {
|
|
34
|
-
/* observer hook, must not mask the rejection itself */
|
|
35
|
-
}
|
|
36
|
-
}
|
|
37
|
-
if (looksLikeApprovalRequest(req.method)) {
|
|
38
|
-
throw new Error(`approvals are not supported in this version (${req.method}). Configure codex approval-policy=never, or deploy this dispatcher in a trusted-local environment.`);
|
|
39
|
-
}
|
|
40
|
-
throw new Error(`dispatcher received an unsupported codex server-request: ${req.method} (id=${req.id})`);
|
|
41
|
-
};
|
|
42
|
-
}
|
|
43
|
-
//# sourceMappingURL=approval.js.map
|
package/dist/approval.js.map
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"approval.js","sourceRoot":"","sources":["../src/approval.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;GAYG;AAYH,+EAA+E;AAC/E,MAAM,qBAAqB,GAAG,CAAC,UAAU,EAAE,SAAS,EAAE,SAAS,EAAE,QAAQ,CAAC,CAAC;AAE3E,MAAM,UAAU,wBAAwB,CAAC,MAAc;IACrD,MAAM,CAAC,GAAG,MAAM,CAAC,WAAW,EAAE,CAAC;IAC/B,OAAO,qBAAqB,CAAC,IAAI,CAAC,CAAC,CAAC,EAAE,EAAE,CAAC,CAAC,CAAC,QAAQ,CAAC,CAAC,CAAC,CAAC,CAAC;AAC1D,CAAC;AAED;;;;;;GAMG;AACH,MAAM,UAAU,6BAA6B,CAC3C,OAA+B,EAAE;IAEjC,OAAO,KAAK,EAAE,GAAkB,EAAoB,EAAE;QACpD,IAAI,IAAI,CAAC,QAAQ,KAAK,SAAS,EAAE,CAAC;YAChC,IAAI,CAAC;gBACH,MAAM,IAAI,CAAC,QAAQ,CAAC,GAAG,CAAC,CAAC;YAC3B,CAAC;YAAC,MAAM,CAAC;gBACP,uDAAuD;YACzD,CAAC;QACH,CAAC;QACD,IAAI,wBAAwB,CAAC,GAAG,CAAC,MAAM,CAAC,EAAE,CAAC;YACzC,MAAM,IAAI,KAAK,CACb,gDAAgD,GAAG,CAAC,MAAM,qGAAqG,CAChK,CAAC;QACJ,CAAC;QACD,MAAM,IAAI,KAAK,CACb,4DAA4D,GAAG,CAAC,MAAM,QAAQ,GAAG,CAAC,EAAE,GAAG,CACxF,CAAC;IACJ,CAAC,CAAC;AACJ,CAAC"}
|
package/dist/provider-ref.d.ts
DELETED
|
@@ -1,8 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* The stable built-in provider ref this package ships behind. Dreamux core maps
|
|
3
|
-
* `builtin:codex` to `@excitedjs/agent-runtime-codex`; the ref string is the
|
|
4
|
-
* package's own public identity, so it is owned here rather than imported from
|
|
5
|
-
* core (which this package must never depend on).
|
|
6
|
-
*/
|
|
7
|
-
export declare const BUILTIN_CODEX_PROVIDER_REF = "builtin:codex";
|
|
8
|
-
//# sourceMappingURL=provider-ref.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"provider-ref.d.ts","sourceRoot":"","sources":["../src/provider-ref.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AACH,eAAO,MAAM,0BAA0B,kBAAkB,CAAC"}
|
package/dist/provider-ref.js
DELETED
|
@@ -1,8 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* The stable built-in provider ref this package ships behind. Dreamux core maps
|
|
3
|
-
* `builtin:codex` to `@excitedjs/agent-runtime-codex`; the ref string is the
|
|
4
|
-
* package's own public identity, so it is owned here rather than imported from
|
|
5
|
-
* core (which this package must never depend on).
|
|
6
|
-
*/
|
|
7
|
-
export const BUILTIN_CODEX_PROVIDER_REF = 'builtin:codex';
|
|
8
|
-
//# sourceMappingURL=provider-ref.js.map
|
package/dist/provider-ref.js.map
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"provider-ref.js","sourceRoot":"","sources":["../src/provider-ref.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AACH,MAAM,CAAC,MAAM,0BAA0B,GAAG,eAAe,CAAC"}
|
|
@@ -1,14 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Build the process env for a Codex app-server child. The neutral env boundary
|
|
3
|
-
* (issue #209 cleanup) is `{ ...process.env, ...injectEnv, ...extraEnv }`:
|
|
4
|
-
* - `injectEnv` is the host's optional neutral env-injection seam from the
|
|
5
|
-
* create context (empty today); core owns what it injects.
|
|
6
|
-
* - `extraEnv` is THIS provider's own `config.extra_env`, merged last so a
|
|
7
|
-
* dispatcher can override an injected value.
|
|
8
|
-
* The child inherits the operator's ambient `CODEX_HOME` like a vanilla
|
|
9
|
-
* `codex` invocation — Dreamux creates no dispatcher-private Codex home (MVP),
|
|
10
|
-
* so there is nothing to strip.
|
|
11
|
-
*/
|
|
12
|
-
export declare function codexProcessEnv(injectEnv?: Record<string, string>, extraEnv?: Record<string, string>): NodeJS.ProcessEnv;
|
|
13
|
-
export declare function renderCodexSystemPromptAppend(append: readonly string[]): string;
|
|
14
|
-
//# sourceMappingURL=runtime-support.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"runtime-support.d.ts","sourceRoot":"","sources":["../src/runtime-support.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;GAUG;AACH,wBAAgB,eAAe,CAC7B,SAAS,GAAE,MAAM,CAAC,MAAM,EAAE,MAAM,CAAM,EACtC,QAAQ,GAAE,MAAM,CAAC,MAAM,EAAE,MAAM,CAAM,GACpC,MAAM,CAAC,UAAU,CAEnB;AAED,wBAAgB,6BAA6B,CAC3C,MAAM,EAAE,SAAS,MAAM,EAAE,GACxB,MAAM,CAQR"}
|
package/dist/runtime-support.js
DELETED
|
@@ -1,35 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Build the process env for a Codex app-server child. The neutral env boundary
|
|
3
|
-
* (issue #209 cleanup) is `{ ...process.env, ...injectEnv, ...extraEnv }`:
|
|
4
|
-
* - `injectEnv` is the host's optional neutral env-injection seam from the
|
|
5
|
-
* create context (empty today); core owns what it injects.
|
|
6
|
-
* - `extraEnv` is THIS provider's own `config.extra_env`, merged last so a
|
|
7
|
-
* dispatcher can override an injected value.
|
|
8
|
-
* The child inherits the operator's ambient `CODEX_HOME` like a vanilla
|
|
9
|
-
* `codex` invocation — Dreamux creates no dispatcher-private Codex home (MVP),
|
|
10
|
-
* so there is nothing to strip.
|
|
11
|
-
*/
|
|
12
|
-
export function codexProcessEnv(injectEnv = {}, extraEnv = {}) {
|
|
13
|
-
return { ...globalThis.process.env, ...injectEnv, ...extraEnv };
|
|
14
|
-
}
|
|
15
|
-
export function renderCodexSystemPromptAppend(append) {
|
|
16
|
-
return append
|
|
17
|
-
.filter((prompt) => prompt !== '')
|
|
18
|
-
.map((prompt) => `<developer-reminder>\n${escapeXmlText(prompt)}\n</developer-reminder>`)
|
|
19
|
-
.join('\n\n');
|
|
20
|
-
}
|
|
21
|
-
function escapeXmlText(text) {
|
|
22
|
-
return text.replace(/[&<>]/g, (char) => {
|
|
23
|
-
switch (char) {
|
|
24
|
-
case '&':
|
|
25
|
-
return '&';
|
|
26
|
-
case '<':
|
|
27
|
-
return '<';
|
|
28
|
-
case '>':
|
|
29
|
-
return '>';
|
|
30
|
-
default:
|
|
31
|
-
return char;
|
|
32
|
-
}
|
|
33
|
-
});
|
|
34
|
-
}
|
|
35
|
-
//# sourceMappingURL=runtime-support.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"runtime-support.js","sourceRoot":"","sources":["../src/runtime-support.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;GAUG;AACH,MAAM,UAAU,eAAe,CAC7B,YAAoC,EAAE,EACtC,WAAmC,EAAE;IAErC,OAAO,EAAE,GAAG,UAAU,CAAC,OAAO,CAAC,GAAG,EAAE,GAAG,SAAS,EAAE,GAAG,QAAQ,EAAE,CAAC;AAClE,CAAC;AAED,MAAM,UAAU,6BAA6B,CAC3C,MAAyB;IAEzB,OAAO,MAAM;SACV,MAAM,CAAC,CAAC,MAAM,EAAE,EAAE,CAAC,MAAM,KAAK,EAAE,CAAC;SACjC,GAAG,CACF,CAAC,MAAM,EAAE,EAAE,CACT,yBAAyB,aAAa,CAAC,MAAM,CAAC,yBAAyB,CAC1E;SACA,IAAI,CAAC,MAAM,CAAC,CAAC;AAClB,CAAC;AAED,SAAS,aAAa,CAAC,IAAY;IACjC,OAAO,IAAI,CAAC,OAAO,CAAC,QAAQ,EAAE,CAAC,IAAI,EAAE,EAAE;QACrC,QAAQ,IAAI,EAAE,CAAC;YACb,KAAK,GAAG;gBACN,OAAO,OAAO,CAAC;YACjB,KAAK,GAAG;gBACN,OAAO,MAAM,CAAC;YAChB,KAAK,GAAG;gBACN,OAAO,MAAM,CAAC;YAChB;gBACE,OAAO,IAAI,CAAC;QAChB,CAAC;IACH,CAAC,CAAC,CAAC;AACL,CAAC"}
|