@ai-setting/roy-plugin-task-show 2.5.7 → 2.5.9
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 +0 -0
- package/dist/chat-output-parser.d.ts +0 -0
- package/dist/chat-output-parser.d.ts.map +0 -0
- package/dist/chat-output-parser.js +0 -0
- package/dist/chat-output-parser.js.map +0 -0
- package/dist/chat-panel-html.d.ts +0 -0
- package/dist/chat-panel-html.d.ts.map +0 -0
- package/dist/chat-panel-html.js +0 -0
- package/dist/chat-panel-html.js.map +0 -0
- package/dist/chat-process-manager.d.ts +0 -0
- package/dist/chat-process-manager.d.ts.map +0 -0
- package/dist/chat-process-manager.js +0 -0
- package/dist/chat-process-manager.js.map +0 -0
- package/dist/cli-path-resolver.d.ts +102 -0
- package/dist/cli-path-resolver.d.ts.map +1 -0
- package/dist/cli-path-resolver.js +187 -0
- package/dist/cli-path-resolver.js.map +1 -0
- package/dist/cli-tasks-adapter.d.ts +0 -0
- package/dist/cli-tasks-adapter.d.ts.map +0 -0
- package/dist/cli-tasks-adapter.js +0 -0
- package/dist/cli-tasks-adapter.js.map +0 -0
- package/dist/cli-tasks-tree-adapter.d.ts +0 -0
- package/dist/cli-tasks-tree-adapter.d.ts.map +0 -0
- package/dist/cli-tasks-tree-adapter.js +0 -0
- package/dist/cli-tasks-tree-adapter.js.map +0 -0
- package/dist/collector.d.ts +0 -0
- package/dist/collector.d.ts.map +0 -0
- package/dist/collector.js +0 -0
- package/dist/collector.js.map +0 -0
- package/dist/event-bus.d.ts +0 -0
- package/dist/event-bus.d.ts.map +0 -0
- package/dist/event-bus.js +0 -0
- package/dist/event-bus.js.map +0 -0
- package/dist/file-tree.d.ts +0 -0
- package/dist/file-tree.d.ts.map +0 -0
- package/dist/file-tree.js +0 -0
- package/dist/file-tree.js.map +0 -0
- package/dist/index.d.ts +0 -0
- package/dist/index.d.ts.map +0 -0
- package/dist/index.js +0 -0
- package/dist/index.js.map +0 -0
- package/dist/lan-host.d.ts +0 -0
- package/dist/lan-host.d.ts.map +0 -0
- package/dist/lan-host.js +0 -0
- package/dist/lan-host.js.map +0 -0
- package/dist/operations-cache.d.ts +0 -0
- package/dist/operations-cache.d.ts.map +0 -0
- package/dist/operations-cache.js +0 -0
- package/dist/operations-cache.js.map +0 -0
- package/dist/plugin.d.ts +4 -7
- package/dist/plugin.d.ts.map +1 -1
- package/dist/plugin.js +6 -33
- package/dist/plugin.js.map +1 -1
- package/dist/server.d.ts +8 -0
- package/dist/server.d.ts.map +1 -1
- package/dist/server.js +81 -8
- package/dist/server.js.map +1 -1
- package/dist/task-chat-context-builder.d.ts +0 -0
- package/dist/task-chat-context-builder.d.ts.map +0 -0
- package/dist/task-chat-context-builder.js +0 -0
- package/dist/task-chat-context-builder.js.map +0 -0
- package/dist/task-detail-mermaid.d.ts +0 -0
- package/dist/task-detail-mermaid.d.ts.map +0 -0
- package/dist/task-detail-mermaid.js +0 -0
- package/dist/task-detail-mermaid.js.map +0 -0
- package/dist/task-metadata.d.ts +0 -0
- package/dist/task-metadata.d.ts.map +0 -0
- package/dist/task-metadata.js +0 -0
- package/dist/task-metadata.js.map +0 -0
- package/dist/task-operations-html.d.ts +0 -0
- package/dist/task-operations-html.d.ts.map +0 -0
- package/dist/task-operations-html.js +0 -0
- package/dist/task-operations-html.js.map +0 -0
- package/dist/task-session-store.d.ts +0 -0
- package/dist/task-session-store.d.ts.map +0 -0
- package/dist/task-session-store.js +0 -0
- package/dist/task-session-store.js.map +0 -0
- package/dist/tasks-tree-cache.d.ts +0 -0
- package/dist/tasks-tree-cache.d.ts.map +0 -0
- package/dist/tasks-tree-cache.js +0 -0
- package/dist/tasks-tree-cache.js.map +0 -0
- package/dist/tool-call-detail.d.ts +0 -0
- package/dist/tool-call-detail.d.ts.map +0 -0
- package/dist/tool-call-detail.js +0 -0
- package/dist/tool-call-detail.js.map +0 -0
- package/dist/tracing/decorator.d.ts +0 -0
- package/dist/tracing/decorator.d.ts.map +0 -0
- package/dist/tracing/decorator.js +0 -0
- package/dist/tracing/decorator.js.map +0 -0
- package/dist/types.d.ts +0 -0
- package/dist/types.d.ts.map +0 -0
- package/dist/types.js +0 -0
- package/dist/types.js.map +0 -0
- package/dist/url-injector.d.ts +0 -0
- package/dist/url-injector.d.ts.map +0 -0
- package/dist/url-injector.js +0 -0
- package/dist/url-injector.js.map +0 -0
- package/package.json +1 -1
- package/plugin.json +1 -1
- package/public/app.js +0 -0
- package/public/chat-panel.js +0 -0
- package/public/dompurify.min.js +0 -0
- package/public/file-tree.js +0 -0
- package/public/index.html +0 -0
- package/public/markdown-renderer.js +0 -0
- package/public/marked.min.js +0 -0
- package/public/mermaid-renderer.js +0 -0
- package/public/session-forest.js +0 -0
- package/public/style.css +0 -0
- package/public/task-operations.js +0 -0
- package/public/tasks-tree.js +0 -0
- package/public/tool-call-detail.js +0 -0
package/README.md
CHANGED
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
package/dist/chat-panel-html.js
CHANGED
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
@@ -0,0 +1,102 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @fileoverview `roy-agent` CLI path resolver — Task #2895 (v2 PATH-first).
|
|
3
|
+
*
|
|
4
|
+
* ## User direction
|
|
5
|
+
*
|
|
6
|
+
* User correction (Task #2895 v2): "task-show的实现机制估计是有问题
|
|
7
|
+
* 的,需要用系统的roy-agent命令行,而不需要去特定地方找roy-agent
|
|
8
|
+
* 所需的bin啥的呀"
|
|
9
|
+
*
|
|
10
|
+
* Translation: "task-show's implementation mechanism is likely wrong —
|
|
11
|
+
* it should use the system `roy-agent` CLI, not look for the binary in
|
|
12
|
+
* specific source-layout locations."
|
|
13
|
+
*
|
|
14
|
+
* ## Background (Task #2893)
|
|
15
|
+
*
|
|
16
|
+
* v2.5.8 added a fallback HTML page so the `AdapterError: CLI exited
|
|
17
|
+
* with code 1 and no parseable JSON envelope` error no longer bubbles
|
|
18
|
+
* to the user. The fallback was visible because the underlying CLI
|
|
19
|
+
* call **still exits 1**.
|
|
20
|
+
*
|
|
21
|
+
* The previous resolution logic preferred hardcoded paths:
|
|
22
|
+
* 1. `cfg.royAgentCliPath`
|
|
23
|
+
* 2. `$ROY_AGENT_CLI`
|
|
24
|
+
* 3. `<cwd>/../roy-agent/packages/cli/dist/bin/roy-agent.js`
|
|
25
|
+
* (sibling-repo / monorepo source layout)
|
|
26
|
+
* 4. `roy-agent` on PATH
|
|
27
|
+
*
|
|
28
|
+
* When the user runs `roy-agent run` inside the `roy-agent` monorepo,
|
|
29
|
+
* step #3 picks the monorepo `roy-agent.js` source file. Without a
|
|
30
|
+
* locally-built `better_sqlite3.node` binding, that source crashes on
|
|
31
|
+
* startup with exit 1 and 100+ KiB of stderr — yielding the
|
|
32
|
+
* `AdapterError` users see.
|
|
33
|
+
*
|
|
34
|
+
* ## Resolution order (this module — Task #2895 v2)
|
|
35
|
+
*
|
|
36
|
+
* 1. PATH `roy-agent` (`which`-style lookup, executable-bit check).
|
|
37
|
+
* The bundled `@ai-setting/roy-agent-standalone@1.7.6` binary
|
|
38
|
+
* ships with native bindings embedded — always works regardless
|
|
39
|
+
* of cwd / install layout.
|
|
40
|
+
* 2. Explicit override (`cfg.royAgentCliPath`) when the file exists.
|
|
41
|
+
* Advanced users only.
|
|
42
|
+
* 3. `$ROY_AGENT_CLI` env var when the file exists.
|
|
43
|
+
* 4. Dev hardcoded paths — ONLY when `NODE_ENV !== 'production'`.
|
|
44
|
+
* Lets plugin authors iterate on the `roy-agent` monorepo without
|
|
45
|
+
* installing the standalone binary globally.
|
|
46
|
+
* 5. None of the above → soft fallback: return the literal string
|
|
47
|
+
* `"roy-agent"` (the OS spawn will look it up via `$PATH` at exec
|
|
48
|
+
* time) and emit a one-time `process.stderr` warning. This
|
|
49
|
+
* preserves the v2.5.8 sendIndex failsafe UX (the existing
|
|
50
|
+
* `AdapterError` will trigger the fallback HTML page with the
|
|
51
|
+
* Retry button) **without** throwing out of the plugin
|
|
52
|
+
* constructor — a hard throw would prevent the HTTP server from
|
|
53
|
+
* ever starting, which is strictly worse than letting users see
|
|
54
|
+
* the retry-friendly fallback page. Operators who want a quieter
|
|
55
|
+
* experience can install `@ai-setting/roy-agent-standalone`
|
|
56
|
+
* globally so step #1 finds it.
|
|
57
|
+
*
|
|
58
|
+
* Pure functions only — exported for unit tests.
|
|
59
|
+
*/
|
|
60
|
+
/**
|
|
61
|
+
* Locate `roy-agent` on `$PATH`. Returns the first hit or `undefined`
|
|
62
|
+
* when no executable named `roy-agent` is discoverable.
|
|
63
|
+
*
|
|
64
|
+
* Pure function — exported for tests. Behaviour:
|
|
65
|
+
* - Splits `$PATH` on `path.delimiter` (POSIX `:` / Windows `;`).
|
|
66
|
+
* - For each directory, checks `<dir>/roy-agent`.
|
|
67
|
+
* - Accepts either a regular file or a symlink to one.
|
|
68
|
+
* - Skips directories that don't exist (no throw).
|
|
69
|
+
*
|
|
70
|
+
* This is a *Node-side* check (fs.statSync), not a shell `which`.
|
|
71
|
+
On Linux/macOS we additionally require the executable bit to be
|
|
72
|
+
* set; on Windows we accept anything that's a file or symlink since
|
|
73
|
+
* executable-bit semantics are looser there. The plugin runs on
|
|
74
|
+
* Linux/macOS in practice (verified by the user's report).
|
|
75
|
+
*/
|
|
76
|
+
export declare function findRoyAgentOnPath(pathEnv: string | undefined): string | undefined;
|
|
77
|
+
export interface ResolveRoyAgentCliPathOptions {
|
|
78
|
+
/** Path-style overrides (test seam). Falls back to `process.cwd()`. */
|
|
79
|
+
cwd?: string;
|
|
80
|
+
/** Path-style overrides (test seam). Falls back to `process.env.PATH`. */
|
|
81
|
+
pathEnv?: string;
|
|
82
|
+
/** Path-style overrides (test seam). Falls back to `process.env.ROY_AGENT_CLI`. */
|
|
83
|
+
royAgentCliEnv?: string;
|
|
84
|
+
/**
|
|
85
|
+
* Path-style overrides (test seam). Falls back to
|
|
86
|
+
* `process.env.NODE_ENV`. When `"production"`, the hardcoded
|
|
87
|
+
* dev paths are skipped entirely.
|
|
88
|
+
*/
|
|
89
|
+
nodeEnv?: string | undefined;
|
|
90
|
+
}
|
|
91
|
+
/**
|
|
92
|
+
* Resolve the `roy-agent` executable used by the operations /
|
|
93
|
+
* tasks-tree / chat pipelines. See the file-level JSDoc for the
|
|
94
|
+
* full resolution algorithm.
|
|
95
|
+
*
|
|
96
|
+
* Pure function — accepts an `options` parameter so tests can inject
|
|
97
|
+
* `cwd` / `pathEnv` / `royAgentCliEnv` / `nodeEnv` without mutating
|
|
98
|
+
* `process.*`. Production callers omit the parameter and let it
|
|
99
|
+
* default to the live `process` snapshot.
|
|
100
|
+
*/
|
|
101
|
+
export declare function resolveRoyAgentCliPath(override: string | undefined, options?: ResolveRoyAgentCliPathOptions): string;
|
|
102
|
+
//# sourceMappingURL=cli-path-resolver.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"cli-path-resolver.d.ts","sourceRoot":"","sources":["../src/cli-path-resolver.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA0DG;AAMH;;;;;;;;;;;;;;;GAeG;AACH,wBAAgB,kBAAkB,CAChC,OAAO,EAAE,MAAM,GAAG,SAAS,GAC1B,MAAM,GAAG,SAAS,CAsBpB;AAED,MAAM,WAAW,6BAA6B;IAC5C,uEAAuE;IACvE,GAAG,CAAC,EAAE,MAAM,CAAC;IACb,0EAA0E;IAC1E,OAAO,CAAC,EAAE,MAAM,CAAC;IACjB,mFAAmF;IACnF,cAAc,CAAC,EAAE,MAAM,CAAC;IACxB;;;;OAIG;IACH,OAAO,CAAC,EAAE,MAAM,GAAG,SAAS,CAAC;CAC9B;AAED;;;;;;;;;GASG;AACH,wBAAgB,sBAAsB,CACpC,QAAQ,EAAE,MAAM,GAAG,SAAS,EAC5B,OAAO,GAAE,6BAAkC,GAC1C,MAAM,CAgGR"}
|
|
@@ -0,0 +1,187 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @fileoverview `roy-agent` CLI path resolver — Task #2895 (v2 PATH-first).
|
|
3
|
+
*
|
|
4
|
+
* ## User direction
|
|
5
|
+
*
|
|
6
|
+
* User correction (Task #2895 v2): "task-show的实现机制估计是有问题
|
|
7
|
+
* 的,需要用系统的roy-agent命令行,而不需要去特定地方找roy-agent
|
|
8
|
+
* 所需的bin啥的呀"
|
|
9
|
+
*
|
|
10
|
+
* Translation: "task-show's implementation mechanism is likely wrong —
|
|
11
|
+
* it should use the system `roy-agent` CLI, not look for the binary in
|
|
12
|
+
* specific source-layout locations."
|
|
13
|
+
*
|
|
14
|
+
* ## Background (Task #2893)
|
|
15
|
+
*
|
|
16
|
+
* v2.5.8 added a fallback HTML page so the `AdapterError: CLI exited
|
|
17
|
+
* with code 1 and no parseable JSON envelope` error no longer bubbles
|
|
18
|
+
* to the user. The fallback was visible because the underlying CLI
|
|
19
|
+
* call **still exits 1**.
|
|
20
|
+
*
|
|
21
|
+
* The previous resolution logic preferred hardcoded paths:
|
|
22
|
+
* 1. `cfg.royAgentCliPath`
|
|
23
|
+
* 2. `$ROY_AGENT_CLI`
|
|
24
|
+
* 3. `<cwd>/../roy-agent/packages/cli/dist/bin/roy-agent.js`
|
|
25
|
+
* (sibling-repo / monorepo source layout)
|
|
26
|
+
* 4. `roy-agent` on PATH
|
|
27
|
+
*
|
|
28
|
+
* When the user runs `roy-agent run` inside the `roy-agent` monorepo,
|
|
29
|
+
* step #3 picks the monorepo `roy-agent.js` source file. Without a
|
|
30
|
+
* locally-built `better_sqlite3.node` binding, that source crashes on
|
|
31
|
+
* startup with exit 1 and 100+ KiB of stderr — yielding the
|
|
32
|
+
* `AdapterError` users see.
|
|
33
|
+
*
|
|
34
|
+
* ## Resolution order (this module — Task #2895 v2)
|
|
35
|
+
*
|
|
36
|
+
* 1. PATH `roy-agent` (`which`-style lookup, executable-bit check).
|
|
37
|
+
* The bundled `@ai-setting/roy-agent-standalone@1.7.6` binary
|
|
38
|
+
* ships with native bindings embedded — always works regardless
|
|
39
|
+
* of cwd / install layout.
|
|
40
|
+
* 2. Explicit override (`cfg.royAgentCliPath`) when the file exists.
|
|
41
|
+
* Advanced users only.
|
|
42
|
+
* 3. `$ROY_AGENT_CLI` env var when the file exists.
|
|
43
|
+
* 4. Dev hardcoded paths — ONLY when `NODE_ENV !== 'production'`.
|
|
44
|
+
* Lets plugin authors iterate on the `roy-agent` monorepo without
|
|
45
|
+
* installing the standalone binary globally.
|
|
46
|
+
* 5. None of the above → soft fallback: return the literal string
|
|
47
|
+
* `"roy-agent"` (the OS spawn will look it up via `$PATH` at exec
|
|
48
|
+
* time) and emit a one-time `process.stderr` warning. This
|
|
49
|
+
* preserves the v2.5.8 sendIndex failsafe UX (the existing
|
|
50
|
+
* `AdapterError` will trigger the fallback HTML page with the
|
|
51
|
+
* Retry button) **without** throwing out of the plugin
|
|
52
|
+
* constructor — a hard throw would prevent the HTTP server from
|
|
53
|
+
* ever starting, which is strictly worse than letting users see
|
|
54
|
+
* the retry-friendly fallback page. Operators who want a quieter
|
|
55
|
+
* experience can install `@ai-setting/roy-agent-standalone`
|
|
56
|
+
* globally so step #1 finds it.
|
|
57
|
+
*
|
|
58
|
+
* Pure functions only — exported for unit tests.
|
|
59
|
+
*/
|
|
60
|
+
import * as fs from "node:fs";
|
|
61
|
+
import * as path from "node:path";
|
|
62
|
+
import { fileURLToPath } from "node:url";
|
|
63
|
+
/**
|
|
64
|
+
* Locate `roy-agent` on `$PATH`. Returns the first hit or `undefined`
|
|
65
|
+
* when no executable named `roy-agent` is discoverable.
|
|
66
|
+
*
|
|
67
|
+
* Pure function — exported for tests. Behaviour:
|
|
68
|
+
* - Splits `$PATH` on `path.delimiter` (POSIX `:` / Windows `;`).
|
|
69
|
+
* - For each directory, checks `<dir>/roy-agent`.
|
|
70
|
+
* - Accepts either a regular file or a symlink to one.
|
|
71
|
+
* - Skips directories that don't exist (no throw).
|
|
72
|
+
*
|
|
73
|
+
* This is a *Node-side* check (fs.statSync), not a shell `which`.
|
|
74
|
+
On Linux/macOS we additionally require the executable bit to be
|
|
75
|
+
* set; on Windows we accept anything that's a file or symlink since
|
|
76
|
+
* executable-bit semantics are looser there. The plugin runs on
|
|
77
|
+
* Linux/macOS in practice (verified by the user's report).
|
|
78
|
+
*/
|
|
79
|
+
export function findRoyAgentOnPath(pathEnv) {
|
|
80
|
+
if (!pathEnv)
|
|
81
|
+
return undefined;
|
|
82
|
+
const dirs = pathEnv.split(path.delimiter);
|
|
83
|
+
for (const dir of dirs) {
|
|
84
|
+
if (!dir)
|
|
85
|
+
continue;
|
|
86
|
+
const candidate = path.join(dir, "roy-agent");
|
|
87
|
+
try {
|
|
88
|
+
const st = fs.statSync(candidate);
|
|
89
|
+
if (st.isFile() || st.isSymbolicLink()) {
|
|
90
|
+
// On POSIX, require executable bit; on Windows we accept any
|
|
91
|
+
// file (executable bit semantics are looser there).
|
|
92
|
+
if (process.platform !== "win32") {
|
|
93
|
+
// 0o111 = owner+group+other execute bits
|
|
94
|
+
if ((st.mode & 0o111) === 0)
|
|
95
|
+
continue;
|
|
96
|
+
}
|
|
97
|
+
return candidate;
|
|
98
|
+
}
|
|
99
|
+
}
|
|
100
|
+
catch {
|
|
101
|
+
/* not found here — try next */
|
|
102
|
+
}
|
|
103
|
+
}
|
|
104
|
+
return undefined;
|
|
105
|
+
}
|
|
106
|
+
/**
|
|
107
|
+
* Resolve the `roy-agent` executable used by the operations /
|
|
108
|
+
* tasks-tree / chat pipelines. See the file-level JSDoc for the
|
|
109
|
+
* full resolution algorithm.
|
|
110
|
+
*
|
|
111
|
+
* Pure function — accepts an `options` parameter so tests can inject
|
|
112
|
+
* `cwd` / `pathEnv` / `royAgentCliEnv` / `nodeEnv` without mutating
|
|
113
|
+
* `process.*`. Production callers omit the parameter and let it
|
|
114
|
+
* default to the live `process` snapshot.
|
|
115
|
+
*/
|
|
116
|
+
export function resolveRoyAgentCliPath(override, options = {}) {
|
|
117
|
+
const cwd = options.cwd ?? process.cwd();
|
|
118
|
+
const pathEnv = options.pathEnv ?? process.env?.PATH;
|
|
119
|
+
const royAgentCliEnv = options.royAgentCliEnv ?? process.env?.ROY_AGENT_CLI;
|
|
120
|
+
const nodeEnv = options.nodeEnv !== undefined
|
|
121
|
+
? options.nodeEnv
|
|
122
|
+
: process.env?.NODE_ENV;
|
|
123
|
+
// 1. PATH `roy-agent` — system binary wins.
|
|
124
|
+
const onPath = findRoyAgentOnPath(pathEnv);
|
|
125
|
+
if (onPath)
|
|
126
|
+
return onPath;
|
|
127
|
+
// 2. Explicit override (advanced / power-user knob).
|
|
128
|
+
if (override && fs.existsSync(override))
|
|
129
|
+
return override;
|
|
130
|
+
// 3. Env var override (same escape hatch, env-driven).
|
|
131
|
+
if (royAgentCliEnv && fs.existsSync(royAgentCliEnv))
|
|
132
|
+
return royAgentCliEnv;
|
|
133
|
+
// 4. Developer escape hatch — hardcoded paths ONLY in dev.
|
|
134
|
+
const isDev = nodeEnv !== "production";
|
|
135
|
+
if (isDev) {
|
|
136
|
+
const devPaths = [
|
|
137
|
+
// sibling-repo layout — cwd is `<workspace>/roy-agent/` so
|
|
138
|
+
// `..` gives `<workspace>/` and the resolved path lands at
|
|
139
|
+
// `<workspace>/roy-agent/packages/cli/dist/bin/roy-agent.js`.
|
|
140
|
+
path.resolve(cwd, "..", "roy-agent", "packages", "cli", "dist", "bin", "roy-agent.js"),
|
|
141
|
+
];
|
|
142
|
+
// monorepo layout — derive from `import.meta.url` so the plugin
|
|
143
|
+
// package's own location points at the host monorepo's CLI
|
|
144
|
+
// build. We try-catch because `import.meta.url` is not
|
|
145
|
+
// available in every runtime.
|
|
146
|
+
try {
|
|
147
|
+
const metaUrl = typeof import.meta !== "undefined" ? import.meta.url : undefined;
|
|
148
|
+
if (metaUrl) {
|
|
149
|
+
const here = path.dirname(fileURLToPath(metaUrl));
|
|
150
|
+
devPaths.push(path.resolve(here, "..", "..", "..", "..", "packages", "cli", "dist", "bin", "roy-agent.js"));
|
|
151
|
+
}
|
|
152
|
+
}
|
|
153
|
+
catch {
|
|
154
|
+
/* import.meta unavailable — skip */
|
|
155
|
+
}
|
|
156
|
+
for (const p of devPaths) {
|
|
157
|
+
if (p && fs.existsSync(p))
|
|
158
|
+
return p;
|
|
159
|
+
}
|
|
160
|
+
}
|
|
161
|
+
// 5. Last resort — return the literal string `"roy-agent"` so the
|
|
162
|
+
// OS spawn will look it up via `$PATH` at exec time. This
|
|
163
|
+
// preserves the v2.5.8 failsafe behaviour: if PATH has a
|
|
164
|
+
// `roy-agent` binary at runtime (e.g. the operator installed it
|
|
165
|
+
// between resolve time and spawn time), it still works. If not,
|
|
166
|
+
// `runTasksTree` will throw `AdapterError` and the existing
|
|
167
|
+
// sendIndex fallback page will render — same UX as before this
|
|
168
|
+
// fix, but with the PATH-first ordering in the common case.
|
|
169
|
+
//
|
|
170
|
+
// We deliberately don't throw here. Hard-throwing from the plugin
|
|
171
|
+
// constructor would mean the HTTP server never starts, which is
|
|
172
|
+
// a worse UX than the existing fallback page (the user still
|
|
173
|
+
// gets a working UI with `/task/<id>` pages). Operators see a
|
|
174
|
+
// one-time console message instructing them to install the
|
|
175
|
+
// standalone binary globally for a quieter experience.
|
|
176
|
+
if (typeof process !== "undefined" && process.stderr) {
|
|
177
|
+
process.stderr.write("[roy-plugin-task-show] WARN: cannot locate `roy-agent` CLI " +
|
|
178
|
+
"via $PATH, cfg.royAgentCliPath override, $ROY_AGENT_CLI env var" +
|
|
179
|
+
(isDev ? ", or dev-mode sibling/monorepo paths" : "") +
|
|
180
|
+
". Falling back to literal `roy-agent` (will rely on $PATH at " +
|
|
181
|
+
"spawn time). Install `@ai-setting/roy-agent-standalone` " +
|
|
182
|
+
"globally (`npm i -g @ai-setting/roy-agent-standalone`) for a " +
|
|
183
|
+
"quieter experience.\n");
|
|
184
|
+
}
|
|
185
|
+
return override ?? "roy-agent";
|
|
186
|
+
}
|
|
187
|
+
//# sourceMappingURL=cli-path-resolver.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"cli-path-resolver.js","sourceRoot":"","sources":["../src/cli-path-resolver.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA0DG;AAEH,OAAO,KAAK,EAAE,MAAM,SAAS,CAAC;AAC9B,OAAO,KAAK,IAAI,MAAM,WAAW,CAAC;AAClC,OAAO,EAAE,aAAa,EAAE,MAAM,UAAU,CAAC;AAEzC;;;;;;;;;;;;;;;GAeG;AACH,MAAM,UAAU,kBAAkB,CAChC,OAA2B;IAE3B,IAAI,CAAC,OAAO;QAAE,OAAO,SAAS,CAAC;IAC/B,MAAM,IAAI,GAAG,OAAO,CAAC,KAAK,CAAC,IAAI,CAAC,SAAS,CAAC,CAAC;IAC3C,KAAK,MAAM,GAAG,IAAI,IAAI,EAAE,CAAC;QACvB,IAAI,CAAC,GAAG;YAAE,SAAS;QACnB,MAAM,SAAS,GAAG,IAAI,CAAC,IAAI,CAAC,GAAG,EAAE,WAAW,CAAC,CAAC;QAC9C,IAAI,CAAC;YACH,MAAM,EAAE,GAAG,EAAE,CAAC,QAAQ,CAAC,SAAS,CAAC,CAAC;YAClC,IAAI,EAAE,CAAC,MAAM,EAAE,IAAI,EAAE,CAAC,cAAc,EAAE,EAAE,CAAC;gBACvC,6DAA6D;gBAC7D,oDAAoD;gBACpD,IAAI,OAAO,CAAC,QAAQ,KAAK,OAAO,EAAE,CAAC;oBACjC,yCAAyC;oBACzC,IAAI,CAAC,EAAE,CAAC,IAAI,GAAG,KAAK,CAAC,KAAK,CAAC;wBAAE,SAAS;gBACxC,CAAC;gBACD,OAAO,SAAS,CAAC;YACnB,CAAC;QACH,CAAC;QAAC,MAAM,CAAC;YACP,+BAA+B;QACjC,CAAC;IACH,CAAC;IACD,OAAO,SAAS,CAAC;AACn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CAAC,CAAC,CAAC,MAAM,CAAC,IAAI,CAAC,GAAG,CAAC,CAAC,CAAC,SAAS,CAAC;YACnE,IAAI,OAAO,EAAE,CAAC;gBACZ,MAAM,IAAI,GAAG,IAAI,CAAC,OAAO,CAAC,aAAa,CAAC,OAAO,CAAC,CAAC,CAAC;gBAClD,QAAQ,CAAC,IAAI,CACX,IAAI,CAAC,OAAO,CACV,IAAI,EACJ,IAAI,EACJ,IAAI,EACJ,IAAI,EACJ,IAAI,EACJ,UAAU,EACV,KAAK,EACL,MAAM,EACN,KAAK,EACL,cAAc,CACf,CACF,CAAC;YACJ,CAAC;QACH,CAAC;QAAC,MAAM,CAAC;YACP,oCAAoC;QACtC,CAAC;QACD,KAAK,MAAM,CAAC,IAAI,QAAQ,EAAE,CAAC;YACzB,IAAI,CAAC,IAAI,EAAE,CAAC,UAAU,CAAC,CAAC,CAAC;gBAAE,OAAO,CAAC,CAAC;QACtC,CAAC;IACH,CAAC;IAED,kEAAkE;IAClE,0DAA0D;IAC1D,yDAAyD;IACzD,gEAAgE;IAChE,gEAAgE;IAChE,4DAA4D;IAC5D,+DAA+D;IAC/D,4DAA4D;IAC5D,EAAE;IACF,kEAAkE;IAClE,gEAAgE;IAChE,6DAA6D;IAC7D,8DAA8D;IAC9D,2DAA2D;IAC3D,uDAAuD;IACvD,IAAI,OAAO,OAAO,KAAK,WAAW,IAAI,OAAO,CAAC,MAAM,EAAE,CAAC;QACrD,OAAO,CAAC,MAAM,CAAC,KAAK,CAClB,6DAA6D;YAC3D,iEAAiE;YACjE,CAAC,KAAK,CAAC,CAAC,CAAC,sCAAsC,CAAC,CAAC,CAAC,EAAE,CAAC;YACrD,+DAA+D;YAC/D,0DAA0D;YAC1D,+DAA+D;YAC/D,uBAAuB,CAC1B,CAAC;IACJ,CAAC;IACD,OAAO,QAAQ,IAAI,WAAW,CAAC;AACjC,CAAC"}
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
package/dist/collector.d.ts
CHANGED
|
File without changes
|
package/dist/collector.d.ts.map
CHANGED
|
File without changes
|
package/dist/collector.js
CHANGED
|
File without changes
|
package/dist/collector.js.map
CHANGED
|
File without changes
|
package/dist/event-bus.d.ts
CHANGED
|
File without changes
|
package/dist/event-bus.d.ts.map
CHANGED
|
File without changes
|
package/dist/event-bus.js
CHANGED
|
File without changes
|
package/dist/event-bus.js.map
CHANGED
|
File without changes
|
package/dist/file-tree.d.ts
CHANGED
|
File without changes
|
package/dist/file-tree.d.ts.map
CHANGED
|
File without changes
|
package/dist/file-tree.js
CHANGED
|
File without changes
|
package/dist/file-tree.js.map
CHANGED
|
File without changes
|
package/dist/index.d.ts
CHANGED
|
File without changes
|
package/dist/index.d.ts.map
CHANGED
|
File without changes
|
package/dist/index.js
CHANGED
|
File without changes
|
package/dist/index.js.map
CHANGED
|
File without changes
|
package/dist/lan-host.d.ts
CHANGED
|
File without changes
|
package/dist/lan-host.d.ts.map
CHANGED
|
File without changes
|
package/dist/lan-host.js
CHANGED
|
File without changes
|
package/dist/lan-host.js.map
CHANGED
|
File without changes
|
|
File without changes
|
|
File without changes
|
package/dist/operations-cache.js
CHANGED
|
File without changes
|
|
File without changes
|
package/dist/plugin.d.ts
CHANGED
|
@@ -179,13 +179,10 @@ export declare class TaskShowPlugin implements TaskShowPluginInterface {
|
|
|
179
179
|
private registered;
|
|
180
180
|
constructor(config?: Partial<TaskShowConfig>);
|
|
181
181
|
/**
|
|
182
|
-
*
|
|
183
|
-
*
|
|
184
|
-
*
|
|
185
|
-
*
|
|
186
|
-
* 3. `<cwd>/../roy-agent/packages/cli/dist/bin/roy-agent.js`
|
|
187
|
-
* (the typical layout when both repos live side-by-side)
|
|
188
|
-
* 4. The global `roy-agent` on PATH (best-effort)
|
|
182
|
+
* Thin alias to the module-level `resolveRoyAgentCliPath` in
|
|
183
|
+
* `./cli-path-resolver.js`. Kept as a method so existing callers
|
|
184
|
+
* (and subclasses) keep working. See the cli-path-resolver module
|
|
185
|
+
* for the full Task #2895 PATH-first algorithm.
|
|
189
186
|
*/
|
|
190
187
|
private resolveRoyAgentCliPath;
|
|
191
188
|
/**
|
package/dist/plugin.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"plugin.d.ts","sourceRoot":"","sources":["../src/plugin.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAiCG;AAEH,OAAO,KAAK,EACV,aAAa,EAIb,cAAc,EAGf,MAAM,YAAY,CAAC;AAEpB,OAAO,EAAE,iBAAiB,EAAE,MAAM,gBAAgB,CAAC;AAEnD,OAAO,EAAE,QAAQ,EAAE,MAAM,gBAAgB,CAAC;
|
|
1
|
+
{"version":3,"file":"plugin.d.ts","sourceRoot":"","sources":["../src/plugin.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAiCG;AAEH,OAAO,KAAK,EACV,aAAa,EAIb,cAAc,EAGf,MAAM,YAAY,CAAC;AAEpB,OAAO,EAAE,iBAAiB,EAAE,MAAM,gBAAgB,CAAC;AAEnD,OAAO,EAAE,QAAQ,EAAE,MAAM,gBAAgB,CAAC;AA8C1C;;;;GAIG;AACH,MAAM,MAAM,YAAY,GAAG;IACzB,GAAG,EAAE,CAAC,GAAG,EAAE,MAAM,KAAK,IAAI,CAAC;CAC5B,CAAC;AAEF;;;;;;;;GAQG;AACH,wBAAgB,gBAAgB,CAC9B,OAAO,EAAE,MAAM,EACf,IAAI,EAAE,MAAM,EACZ,MAAM,GAAE,YAAsB,GAC7B,IAAI,CAGN;AAED;;;;;;;;;;;GAWG;AACH,wBAAgB,2BAA2B,CAAC,IAAI,EAAE;IAChD,OAAO,EAAE,MAAM,CAAC;IAChB,IAAI,EAAE,MAAM,CAAC;IACb,MAAM,EAAE,MAAM,CAAC;IACf,aAAa,CAAC,EAAE,MAAM,CAAC;IACvB,MAAM,CAAC,E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AAO,CAAC,IAAI,CAAC;IAyCjD;;;;;;;;OAQG;IACG,iBAAiB,CAAC,GAAG,EAAE,GAAG,GAAG,OAAO,CAAC,IAAI,CAAC;IAoChD;;;;;;;;;;;;;;OAcG;IACG,mBAAmB,CAAC,GAAG,EAAE,GAAG,GAAG,OAAO,CAAC,IAAI,CAAC;IAuFlD;;;;OAIG;IACG,iBAAiB,CAAC,GAAG,EAAE,GAAG,GAAG,OAAO,CAAC,IAAI,CAAC;IAQhD;;;;;;OAMG;IACH,OAAO,CAAC,SAAS;IAYjB;;;;OAIG;IACH,OAAO,CAAC,aAAa;YA2EP,wBAAwB;IAuCtC;;;;OAIG;IACH;;;;;;;OAOG;IACH,OAAO,CAAC,wBAAwB;IA6BhC;;;;;;OAMG;IACH,OAAO,CAAC,mBAAmB;IAI3B,OAAO,CAAC,kBAAkB;CAM3B;AAgCD;;;GAGG;AACH,wBAAgB,oBAAoB,CAAC,MAAM,CAAC,EAAE,OAAO,CAAC,cAAc,CAAC,GAAG,cAAc,CAErF;AAED;;;GAGG;AACH,eAAe,cAAc,CAAC"}
|
package/dist/plugin.js
CHANGED
|
@@ -43,9 +43,7 @@ import { defaultRunner as defaultCliRunner, makeTaskOperationsSource, } from "./
|
|
|
43
43
|
import { defaultRunner as defaultTreeCliRunner, makeTasksTreeSource, } from "./cli-tasks-tree-adapter.js";
|
|
44
44
|
import { TasksTreeCache } from "./tasks-tree-cache.js";
|
|
45
45
|
import { TaskSessionStore, } from "./task-session-store.js";
|
|
46
|
-
import
|
|
47
|
-
import * as path from "node:path";
|
|
48
|
-
import { fileURLToPath } from "node:url";
|
|
46
|
+
import { resolveRoyAgentCliPath as resolveRoyAgentCliPathImpl } from "./cli-path-resolver.js";
|
|
49
47
|
// ============================================================================
|
|
50
48
|
// Logger
|
|
51
49
|
// ============================================================================
|
|
@@ -330,38 +328,13 @@ export class TaskShowPlugin {
|
|
|
330
328
|
});
|
|
331
329
|
}
|
|
332
330
|
/**
|
|
333
|
-
*
|
|
334
|
-
*
|
|
335
|
-
*
|
|
336
|
-
*
|
|
337
|
-
* 3. `<cwd>/../roy-agent/packages/cli/dist/bin/roy-agent.js`
|
|
338
|
-
* (the typical layout when both repos live side-by-side)
|
|
339
|
-
* 4. The global `roy-agent` on PATH (best-effort)
|
|
331
|
+
* Thin alias to the module-level `resolveRoyAgentCliPath` in
|
|
332
|
+
* `./cli-path-resolver.js`. Kept as a method so existing callers
|
|
333
|
+
* (and subclasses) keep working. See the cli-path-resolver module
|
|
334
|
+
* for the full Task #2895 PATH-first algorithm.
|
|
340
335
|
*/
|
|
341
336
|
resolveRoyAgentCliPath(override) {
|
|
342
|
-
|
|
343
|
-
if (override)
|
|
344
|
-
tries.push(override);
|
|
345
|
-
if (process.env?.ROY_AGENT_CLI)
|
|
346
|
-
tries.push(process.env.ROY_AGENT_CLI);
|
|
347
|
-
// sibling-repo layout
|
|
348
|
-
tries.push(path.resolve(process.cwd(), "..", "roy-agent", "packages", "cli", "dist", "bin", "roy-agent.js"));
|
|
349
|
-
// monorepo layout
|
|
350
|
-
try {
|
|
351
|
-
const metaUrl = typeof import.meta !== "undefined" ? import.meta.url : undefined;
|
|
352
|
-
if (metaUrl) {
|
|
353
|
-
const here = path.dirname(fileURLToPath(metaUrl));
|
|
354
|
-
tries.push(path.resolve(here, "..", "..", "..", "..", "packages", "cli", "dist", "bin", "roy-agent.js"));
|
|
355
|
-
}
|
|
356
|
-
}
|
|
357
|
-
catch {
|
|
358
|
-
/* fall through */
|
|
359
|
-
}
|
|
360
|
-
for (const c of tries) {
|
|
361
|
-
if (c && fs.existsSync(c))
|
|
362
|
-
return c;
|
|
363
|
-
}
|
|
364
|
-
return override ?? "roy-agent";
|
|
337
|
+
return resolveRoyAgentCliPathImpl(override);
|
|
365
338
|
}
|
|
366
339
|
/**
|
|
367
340
|
* Called by the loader (or by tests) with the host's `PluginEnv`. We use
|