@bluelovers/opencode-arise 0.1.8 → 0.1.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.
Files changed (49) hide show
  1. package/dist/cli/index.js +35132 -170
  2. package/dist/index.js +35674 -150
  3. package/package.json +57 -31
  4. package/dist/agents/index.d.ts +0 -1
  5. package/dist/agents/index.js +0 -2
  6. package/dist/agents/index.js.map +0 -1
  7. package/dist/agents/shadows.d.ts +0 -28
  8. package/dist/agents/shadows.js +0 -182
  9. package/dist/agents/shadows.js.map +0 -1
  10. package/dist/cli/index.d.ts +0 -2
  11. package/dist/cli/index.js.map +0 -1
  12. package/dist/config/paths.d.ts +0 -91
  13. package/dist/config/paths.js +0 -166
  14. package/dist/config/paths.js.map +0 -1
  15. package/dist/config/schema.d.ts +0 -64
  16. package/dist/config/schema.js +0 -55
  17. package/dist/config/schema.js.map +0 -1
  18. package/dist/hooks/arise-banner.d.ts +0 -6
  19. package/dist/hooks/arise-banner.js +0 -50
  20. package/dist/hooks/arise-banner.js.map +0 -1
  21. package/dist/hooks/compaction-preserver.d.ts +0 -3
  22. package/dist/hooks/compaction-preserver.js +0 -17
  23. package/dist/hooks/compaction-preserver.js.map +0 -1
  24. package/dist/hooks/index.d.ts +0 -4
  25. package/dist/hooks/index.js +0 -5
  26. package/dist/hooks/index.js.map +0 -1
  27. package/dist/hooks/output-shaper.d.ts +0 -4
  28. package/dist/hooks/output-shaper.js +0 -52
  29. package/dist/hooks/output-shaper.js.map +0 -1
  30. package/dist/hooks/todo-enforcer.d.ts +0 -9
  31. package/dist/hooks/todo-enforcer.js +0 -43
  32. package/dist/hooks/todo-enforcer.js.map +0 -1
  33. package/dist/index.d.ts +0 -5
  34. package/dist/index.js.map +0 -1
  35. package/dist/tools/background-manager.d.ts +0 -35
  36. package/dist/tools/background-manager.js +0 -163
  37. package/dist/tools/background-manager.js.map +0 -1
  38. package/dist/tools/background-tools.d.ts +0 -6
  39. package/dist/tools/background-tools.js +0 -121
  40. package/dist/tools/background-tools.js.map +0 -1
  41. package/dist/tools/call-arise-agent.d.ts +0 -3
  42. package/dist/tools/call-arise-agent.js +0 -95
  43. package/dist/tools/call-arise-agent.js.map +0 -1
  44. package/dist/tools/index.d.ts +0 -3
  45. package/dist/tools/index.js +0 -4
  46. package/dist/tools/index.js.map +0 -1
  47. package/dist/utils/bun-shim.d.ts +0 -87
  48. package/dist/utils/bun-shim.js +0 -147
  49. package/dist/utils/bun-shim.js.map +0 -1
@@ -1,121 +0,0 @@
1
- import { tool } from "@opencode-ai/plugin";
2
- const BACKGROUND_SHADOWS = ["beru", "tank", "bellion"];
3
- export function createBackgroundTaskTool(manager) {
4
- return tool({
5
- description: `Launch a shadow soldier as a background task for parallel execution.
6
-
7
- Best for:
8
- - beru: Parallel codebase exploration
9
- - tank: Parallel external research
10
- - bellion: Parallel planning/analysis
11
-
12
- Returns a task_id immediately. Use arise_background_output to get results later.`,
13
- args: {
14
- shadow: tool.schema
15
- .enum(BACKGROUND_SHADOWS)
16
- .describe("Which shadow to run in background"),
17
- prompt: tool.schema
18
- .string()
19
- .describe("The task for the shadow"),
20
- description: tool.schema
21
- .string()
22
- .describe("Short description (3-5 words)"),
23
- },
24
- async execute(args, context) {
25
- const { shadow, prompt, description } = args;
26
- try {
27
- const task = await manager.launch({
28
- shadow,
29
- prompt,
30
- description,
31
- parentSessionId: context.sessionID,
32
- });
33
- return `[arise] Shadow ${shadow} launched in background.
34
-
35
- Task ID: ${task.id}
36
- Description: ${description}
37
-
38
- Use arise_background_output("${task.id}") when you need the result.`;
39
- }
40
- catch (error) {
41
- const msg = error instanceof Error ? error.message : String(error);
42
- return `[arise] Failed to launch background task: ${msg}`;
43
- }
44
- },
45
- });
46
- }
47
- export function createBackgroundOutputTool(manager) {
48
- return tool({
49
- description: `Get the output from a background shadow task.`,
50
- args: {
51
- task_id: tool.schema
52
- .string()
53
- .describe("The task ID from arise_background"),
54
- },
55
- async execute(args) {
56
- const task = manager.getTask(args.task_id);
57
- if (!task) {
58
- return `[arise] Task not found: ${args.task_id}`;
59
- }
60
- const duration = task.completedAt
61
- ? Math.round((task.completedAt - task.startedAt) / 1000)
62
- : Math.round((Date.now() - task.startedAt) / 1000);
63
- if (task.status === "running") {
64
- return `[arise] Task still running (${duration}s). Check again later.`;
65
- }
66
- if (task.status === "error") {
67
- return `[arise] Task failed: ${task.error ?? "Unknown error"}`;
68
- }
69
- return `[arise] ${task.shadow} completed (${duration}s):
70
-
71
- ${task.result ?? "(No output)"}`;
72
- },
73
- });
74
- }
75
- export function createBackgroundStatusTool(manager) {
76
- return tool({
77
- description: "List all background tasks and their status.",
78
- args: {
79
- current_session_only: tool.schema
80
- .boolean()
81
- .optional()
82
- .describe("Only show tasks from current session"),
83
- },
84
- async execute(args, context) {
85
- let tasks = manager.getAllTasks();
86
- if (args.current_session_only) {
87
- tasks = tasks.filter((t) => t.parentSessionId === context.sessionID);
88
- }
89
- if (tasks.length === 0) {
90
- return "[arise] No background tasks.";
91
- }
92
- const lines = tasks.map((t) => {
93
- const duration = t.completedAt
94
- ? Math.round((t.completedAt - t.startedAt) / 1000)
95
- : Math.round((Date.now() - t.startedAt) / 1000);
96
- return `- ${t.id}: ${t.shadow} | ${t.status} | ${t.description} (${duration}s)`;
97
- });
98
- return `[arise] Background tasks:\n${lines.join("\n")}`;
99
- },
100
- });
101
- }
102
- export function createBackgroundCancelTool(manager) {
103
- return tool({
104
- description: "Cancel a running background task.",
105
- args: {
106
- task_id: tool.schema
107
- .string()
108
- .describe("The task ID to cancel"),
109
- },
110
- async execute(args) {
111
- const success = await manager.cancelTask(args.task_id);
112
- if (success) {
113
- return `[arise] Task ${args.task_id} cancelled.`;
114
- }
115
- else {
116
- return `[arise] Could not cancel task (not found or already completed).`;
117
- }
118
- },
119
- });
120
- }
121
- //# sourceMappingURL=background-tools.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"background-tools.js","sourceRoot":"","sources":["../../src/tools/background-tools.ts"],"names":[],"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B,CAAC;SACrC;QAED,KAAK,CAAC,OAAO,CAAC,IAAI;YAChB,MAAM,OAAO,GAAG,MAAM,OAAO,CAAC,UAAU,CAAC,IAAI,CAAC,OAAO,CAAC,CAAC;YAEvD,IAAI,OAAO,EAAE,CAAC;gBACZ,OAAO,gBAAgB,IAAI,CAAC,OAAO,aAAa,CAAC;YACnD,CAAC;iBAAM,CAAC;gBACN,OAAO,iEAAiE,CAAC;YAC3E,CAAC;QACH,CAAC;KACF,CAAC,CAAC;AACL,CAAC"}
@@ -1,3 +0,0 @@
1
- import { tool } from "@opencode-ai/plugin";
2
- import type { PluginInput } from "@opencode-ai/plugin";
3
- export declare function createCallAriseAgentTool(ctx: PluginInput): ReturnType<typeof tool>;
@@ -1,95 +0,0 @@
1
- import { tool } from "@opencode-ai/plugin";
2
- const ALLOWED_SHADOWS = ["beru", "igris", "bellion", "tusk", "tank", "shadow-sovereign"];
3
- export function createCallAriseAgentTool(ctx) {
4
- return tool({
5
- description: `Invoke a shadow soldier to perform a specific task.
6
-
7
- Available shadows:
8
- - beru: Fast codebase scout (exploration, grep, file discovery)
9
- - igris: Precise implementation (code changes, running commands)
10
- - bellion: Strategic planning (architecture, complex analysis)
11
- - tusk: UI/UX specialist (frontend, styling, components)
12
- - tank: External research (docs, web search, examples)
13
- - shadow-sovereign: Deep reasoning (complex debugging, architecture decisions)
14
-
15
- Use run_in_background=true for parallel execution (recommended for exploration/research).
16
- Use run_in_background=false when you need the result immediately.`,
17
- args: {
18
- shadow: tool.schema
19
- .enum(ALLOWED_SHADOWS)
20
- .describe("Which shadow to summon"),
21
- prompt: tool.schema
22
- .string()
23
- .describe("The task/question for the shadow (be specific)"),
24
- run_in_background: tool.schema
25
- .boolean()
26
- .describe("true = async (parallel), false = sync (wait for result)"),
27
- description: tool.schema
28
- .string()
29
- .optional()
30
- .describe("Short description of the task (for tracking)"),
31
- },
32
- async execute(args) {
33
- const { shadow, prompt, run_in_background, description } = args;
34
- const taskDesc = description ?? `${shadow} task`;
35
- try {
36
- // Create session
37
- const session = await ctx.client.session.create({
38
- body: { title: `[arise] ${taskDesc}` },
39
- });
40
- const sessionId = session.data?.id;
41
- if (!sessionId) {
42
- return `[arise] Failed to create session for ${shadow}`;
43
- }
44
- if (run_in_background) {
45
- // Fire and forget - prompt async
46
- ctx.client.session.promptAsync({
47
- path: { id: sessionId },
48
- body: {
49
- agent: shadow,
50
- parts: [{ type: "text", text: prompt }],
51
- },
52
- }).catch(() => { });
53
- return `[arise] Summoned ${shadow} in background.
54
- Task: ${taskDesc}
55
- Session ID: ${sessionId}
56
-
57
- The shadow is working. Continue with your work.`;
58
- }
59
- else {
60
- // Sync: prompt and wait
61
- await ctx.client.session.prompt({
62
- path: { id: sessionId },
63
- body: {
64
- agent: shadow,
65
- parts: [{ type: "text", text: prompt }],
66
- },
67
- });
68
- // Get messages
69
- const messages = await ctx.client.session.messages({
70
- path: { id: sessionId },
71
- });
72
- // Find last assistant message
73
- const lastAssistant = messages.data
74
- ?.filter((m) => m.info.role === "assistant")
75
- .pop();
76
- if (lastAssistant) {
77
- const textParts = lastAssistant.parts
78
- ?.filter((p) => p.type === "text")
79
- .map((p) => p.text ?? "")
80
- .join("\n");
81
- return `[arise] ${shadow} reports:
82
-
83
- ${textParts || "(No text response)"}`;
84
- }
85
- return `[arise] ${shadow} completed but returned no message.`;
86
- }
87
- }
88
- catch (error) {
89
- const message = error instanceof Error ? error.message : String(error);
90
- return `[arise] Failed to summon ${shadow}: ${message}`;
91
- }
92
- },
93
- });
94
- }
95
- //# sourceMappingURL=call-arise-agent.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"call-arise-agent.js","sourceRoot":"","sources":["../../src/tools/call-arise-agent.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,IAAI,EAAE,MAAM,qBAAqB,CAAC;AAI3C,MAAM,eAAe,GAAiB,CAAC,MAAM,EAAE,OAAO,EAAE,SAAS,EAAE,MAAM,EAAE,MAAM,EAAE,kBAAkB,CAAC,CAAC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AS,IAAI,oBAAoB,EAAE,CAAC;oBAC5B,CAAC;oBAED,OAAO,WAAW,MAAM,qCAAqC,CAAC;gBAChE,CAAC;YACH,CAAC;YAAC,OAAO,KAAK,EAAE,CAAC;gBACf,MAAM,OAAO,GAAG,KAAK,YAAY,KAAK,CAAC,CAAC,CAAC,KAAK,CAAC,OAAO,CAAC,CAAC,CAAC,MAAM,CAAC,KAAK,CAAC,CAAC;gBACvE,OAAO,4BAA4B,MAAM,KAAK,OAAO,EAAE,CAAC;YAC1D,CAAC;QACH,CAAC;KACF,CAAC,CAAC;AACL,CAAC"}
@@ -1,3 +0,0 @@
1
- export { createCallAriseAgentTool } from "./call-arise-agent";
2
- export { BackgroundManager } from "./background-manager";
3
- export { createBackgroundTaskTool, createBackgroundOutputTool, createBackgroundStatusTool, createBackgroundCancelTool, } from "./background-tools";
@@ -1,4 +0,0 @@
1
- export { createCallAriseAgentTool } from "./call-arise-agent";
2
- export { BackgroundManager } from "./background-manager";
3
- export { createBackgroundTaskTool, createBackgroundOutputTool, createBackgroundStatusTool, createBackgroundCancelTool, } from "./background-tools";
4
- //# sourceMappingURL=index.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/tools/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,wBAAwB,EAAE,MAAM,oBAAoB,CAAC;AAC9D,OAAO,EAAE,iBAAiB,EAAE,MAAM,sBAAsB,CAAC;AACzD,OAAO,EACL,wBAAwB,EACxB,0BAA0B,EAC1B,0BAA0B,EAC1B,0BAA0B,GAC3B,MAAM,oBAAoB,CAAC"}
@@ -1,87 +0,0 @@
1
- /**
2
- * Bun API 偽裝類
3
- * Bun API Shim - Provides Bun.file() compatibility using fs-extra
4
- *
5
- * 用於在非 Bun 環境中模擬 Bun 的文件操作 API
6
- * Used to simulate Bun's file operations API in non-Bun environments
7
- */
8
- /**
9
- * Bun 文件物件介面
10
- * Bun file object interface
11
- *
12
- * 模擬 Bun.file() 返回的檔案物件
13
- * Simulates the file object returned by Bun.file()
14
- */
15
- export interface IBunFile {
16
- /**
17
- * 檢查檔案是否存在
18
- * Check if file exists
19
- *
20
- * @returns Promise<boolean> - 檔案是否存在
21
- */
22
- exists(): Promise<boolean>;
23
- /**
24
- * 讀取檔案內容為文字
25
- * Read file content as text
26
- *
27
- * @returns Promise<string> - 檔案內容
28
- */
29
- text(): Promise<string>;
30
- /**
31
- * 讀取檔案內容為 JSON
32
- * Read file content as JSON
33
- *
34
- * @returns Promise<unknown> - 解析後的 JSON 物件
35
- */
36
- json(): Promise<unknown>;
37
- /**
38
- * 讀取檔案內容為 ArrayBuffer
39
- * Read file content as ArrayBuffer
40
- *
41
- * @returns Promise<ArrayBuffer> - 檔案內容的 ArrayBuffer
42
- */
43
- arrayBuffer(): Promise<ArrayBuffer>;
44
- /**
45
- * 讀取檔案內容為 Blob
46
- * Read file content as Blob
47
- *
48
- * @returns Promise<Blob> - 檔案內容的 Blob
49
- */
50
- blob(): Promise<Blob>;
51
- }
52
- /**
53
- * Bun 偽裝類
54
- * Bun Shim Class
55
- *
56
- * 提供 Bun 全域物件的相容實現
57
- * Provides compatible implementation of Bun global object
58
- */
59
- declare class BunShim {
60
- /**
61
- * 建立檔案物件
62
- * Create file object
63
- *
64
- * 模擬 Bun.file() 方法,返回具有檔案操作能力的物件
65
- * Simulates Bun.file() method, returns an object with file operations
66
- *
67
- * @param path - 檔案路徑 / File path
68
- * @returns 檔案物件 / File object
69
- */
70
- file(path: string): IBunFile;
71
- }
72
- /**
73
- * 原始 Bun 物件(若存在)
74
- * Original Bun object (if exists)
75
- *
76
- * 若環境中已有 Bun,則導出以供備用
77
- * Exports original Bun if available in environment for backup
78
- */
79
- /**
80
- * 預設導出的 Bun 偽裝實例
81
- * Default export Bun shim instance
82
- *
83
- * 可直接使用 `import { Bun } from "./bun-shim"` 取代原始的 `Bun`
84
- * Can directly use `import { Bun } from "./bun-shim"` to replace original `Bun`
85
- */
86
- export declare const FakeBun: BunShim;
87
- export {};
@@ -1,147 +0,0 @@
1
- /**
2
- * Bun API 偽裝類
3
- * Bun API Shim - Provides Bun.file() compatibility using fs-extra
4
- *
5
- * 用於在非 Bun 環境中模擬 Bun 的文件操作 API
6
- * Used to simulate Bun's file operations API in non-Bun environments
7
- */
8
- import { pathExists, readFile } from "fs-extra";
9
- /**
10
- * Bun 偽裝類
11
- * Bun Shim Class
12
- *
13
- * 提供 Bun 全域物件的相容實現
14
- * Provides compatible implementation of Bun global object
15
- */
16
- class BunShim {
17
- /**
18
- * 建立檔案物件
19
- * Create file object
20
- *
21
- * 模擬 Bun.file() 方法,返回具有檔案操作能力的物件
22
- * Simulates Bun.file() method, returns an object with file operations
23
- *
24
- * @param path - 檔案路徑 / File path
25
- * @returns 檔案物件 / File object
26
- */
27
- file(path) {
28
- return new BunFile(path);
29
- }
30
- }
31
- /**
32
- * 檔案物件實現
33
- * File Object Implementation
34
- *
35
- * 實現 Bun 文件物件的所有必要方法
36
- * Implements all necessary methods of Bun file object
37
- */
38
- class BunFile {
39
- /** 檔案路徑 / File path */
40
- _path;
41
- /**
42
- * 建構子
43
- * Constructor
44
- *
45
- * @param path - 檔案路徑 / File path
46
- */
47
- constructor(path) {
48
- this._path = path;
49
- }
50
- /**
51
- * 取得檔案路徑
52
- * Get file path
53
- */
54
- get path() {
55
- return this._path;
56
- }
57
- /**
58
- * 檢查檔案是否存在
59
- * Check if file exists
60
- *
61
- * 使用 fs-extra 的 pathExists 方法
62
- * Uses fs-extra's pathExists method
63
- *
64
- * @returns Promise<boolean> - 檔案是否存在
65
- */
66
- async exists() {
67
- return pathExists(this._path);
68
- }
69
- /**
70
- * 讀取檔案內容為文字
71
- * Read file content as text
72
- *
73
- * 使用 fs-extra 的 readFile 方法,以 UTF-8 編碼讀取
74
- * Uses fs-extra's readFile method with UTF-8 encoding
75
- *
76
- * @returns Promise<string> - 檔案內容
77
- */
78
- async text() {
79
- return readFile(this._path, "utf-8");
80
- }
81
- /**
82
- * 讀取檔案內容為 JSON
83
- * Read file content as JSON
84
- *
85
- * 讀取檔案後自動解析為 JSON
86
- * Reads file and automatically parses as JSON
87
- *
88
- * @returns Promise<unknown> - 解析後的 JSON 物件
89
- */
90
- async json() {
91
- const content = await this.text();
92
- return JSON.parse(content);
93
- }
94
- /**
95
- * 讀取檔案內容為 ArrayBuffer
96
- * Read file content as ArrayBuffer
97
- *
98
- * 將檔案內容轉換為 ArrayBuffer
99
- * Converts file content to ArrayBuffer
100
- *
101
- * @returns Promise<ArrayBuffer> - 檔案內容的 ArrayBuffer
102
- */
103
- async arrayBuffer() {
104
- const buffer = await readFile(this._path);
105
- return buffer.buffer.slice(buffer.byteOffset, buffer.byteOffset + buffer.byteLength);
106
- }
107
- /**
108
- * 讀取檔案內容為 Blob
109
- * Read file content as Blob
110
- *
111
- * 將檔案內容轉換為 Blob
112
- * Converts file content to Blob
113
- *
114
- * @returns Promise<Blob> - 檔案內容的 Blob
115
- */
116
- async blob() {
117
- const buffer = await readFile(this._path);
118
- return new Blob([buffer]);
119
- }
120
- }
121
- /**
122
- * 建立 Bun 偽裝實例
123
- * Create Bun shim instance
124
- *
125
- * @returns BunShim - Bun 偽裝類實例
126
- */
127
- function createBunShim() {
128
- return new BunShim();
129
- }
130
- /**
131
- * 原始 Bun 物件(若存在)
132
- * Original Bun object (if exists)
133
- *
134
- * 若環境中已有 Bun,則導出以供備用
135
- * Exports original Bun if available in environment for backup
136
- */
137
- // @ts-ignore
138
- // export const OriginalBun = typeof Bun !== "undefined" ? Bun : undefined;
139
- /**
140
- * 預設導出的 Bun 偽裝實例
141
- * Default export Bun shim instance
142
- *
143
- * 可直接使用 `import { Bun } from "./bun-shim"` 取代原始的 `Bun`
144
- * Can directly use `import { Bun } from "./bun-shim"` to replace original `Bun`
145
- */
146
- export const FakeBun = createBunShim();
147
- //# sourceMappingURL=bun-shim.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"bun-shim.js","sourceRoot":"","sources":["../../src/utils/bun-shim.ts"],"names":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