@matterailab/orbcode 0.1.3
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/LICENSE +21 -0
- package/README.md +471 -0
- package/bin/orbcode.js +2 -0
- package/dist/api/client.js +141 -0
- package/dist/api/headers.js +14 -0
- package/dist/api/models.js +49 -0
- package/dist/api/stream.js +1 -0
- package/dist/auth/auth.js +172 -0
- package/dist/branding.js +31 -0
- package/dist/config/promptHistory.js +33 -0
- package/dist/config/settings.js +112 -0
- package/dist/core/agent.js +459 -0
- package/dist/core/events.js +1 -0
- package/dist/core/sessions.js +44 -0
- package/dist/headless.js +64 -0
- package/dist/index.js +84 -0
- package/dist/prompts/system.js +379 -0
- package/dist/tools/executors/executeCommand.js +58 -0
- package/dist/tools/executors/files.js +197 -0
- package/dist/tools/executors/listFiles.js +65 -0
- package/dist/tools/executors/searchFiles.js +104 -0
- package/dist/tools/executors/web.js +72 -0
- package/dist/tools/index.js +85 -0
- package/dist/tools/schemas/ask_followup_question.js +40 -0
- package/dist/tools/schemas/attempt_completion.js +19 -0
- package/dist/tools/schemas/browser_action.js +60 -0
- package/dist/tools/schemas/check_past_chat_memories.js +23 -0
- package/dist/tools/schemas/codebase_search.js +23 -0
- package/dist/tools/schemas/execute_command.js +31 -0
- package/dist/tools/schemas/fetch_instructions.js +20 -0
- package/dist/tools/schemas/file_edit.js +31 -0
- package/dist/tools/schemas/file_write.js +27 -0
- package/dist/tools/schemas/generate_image.js +27 -0
- package/dist/tools/schemas/index.js +29 -0
- package/dist/tools/schemas/list_code_definition_names.js +19 -0
- package/dist/tools/schemas/list_files.js +23 -0
- package/dist/tools/schemas/lsp.js +46 -0
- package/dist/tools/schemas/multi_file_edit.js +42 -0
- package/dist/tools/schemas/new_task.js +27 -0
- package/dist/tools/schemas/read_file.js +27 -0
- package/dist/tools/schemas/run_slash_command.js +23 -0
- package/dist/tools/schemas/search_files.js +27 -0
- package/dist/tools/schemas/switch_mode.js +23 -0
- package/dist/tools/schemas/update_todo_list.js +19 -0
- package/dist/tools/schemas/use_skill.js +19 -0
- package/dist/tools/schemas/web_fetch.js +19 -0
- package/dist/tools/schemas/web_search.js +19 -0
- package/dist/tools/types.js +7 -0
- package/dist/ui/App.js +569 -0
- package/dist/ui/LoginView.js +82 -0
- package/dist/ui/components/ApprovalPrompt.js +21 -0
- package/dist/ui/components/FollowupPrompt.js +45 -0
- package/dist/ui/components/Header.js +12 -0
- package/dist/ui/components/InputBox.js +220 -0
- package/dist/ui/components/ModelPicker.js +51 -0
- package/dist/ui/components/SessionPicker.js +52 -0
- package/dist/ui/components/Spinner.js +19 -0
- package/dist/ui/components/StatusBar.js +18 -0
- package/dist/ui/components/rows.js +106 -0
- package/dist/ui/markdown.js +64 -0
- package/dist/utils/diff.js +144 -0
- package/dist/utils/shell.js +19 -0
- package/package.json +62 -0
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
export default {
|
|
2
|
+
type: "function",
|
|
3
|
+
function: {
|
|
4
|
+
name: "list_code_definition_names",
|
|
5
|
+
description: "List definition names (classes, functions, methods, etc.) from source files to understand code structure. Works on a single file or across all top-level files in a directory.",
|
|
6
|
+
strict: true,
|
|
7
|
+
parameters: {
|
|
8
|
+
type: "object",
|
|
9
|
+
properties: {
|
|
10
|
+
path: {
|
|
11
|
+
type: "string",
|
|
12
|
+
description: "Path to the file or directory to analyze, relative to the workspace",
|
|
13
|
+
},
|
|
14
|
+
},
|
|
15
|
+
required: ["path"],
|
|
16
|
+
additionalProperties: false,
|
|
17
|
+
},
|
|
18
|
+
},
|
|
19
|
+
};
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
export default {
|
|
2
|
+
type: "function",
|
|
3
|
+
function: {
|
|
4
|
+
name: "list_files",
|
|
5
|
+
description: "List files and directories within a given directory. Optionally recurse into subdirectories. Do not use this tool to confirm file creation; rely on user confirmation instead.",
|
|
6
|
+
strict: true,
|
|
7
|
+
parameters: {
|
|
8
|
+
type: "object",
|
|
9
|
+
properties: {
|
|
10
|
+
path: {
|
|
11
|
+
type: "string",
|
|
12
|
+
description: "Directory path to inspect, relative to the workspace",
|
|
13
|
+
},
|
|
14
|
+
recursive: {
|
|
15
|
+
type: ["boolean", "null"],
|
|
16
|
+
description: "Set true to list contents recursively; omit or false to show only the top level",
|
|
17
|
+
},
|
|
18
|
+
},
|
|
19
|
+
required: ["path"],
|
|
20
|
+
additionalProperties: false,
|
|
21
|
+
},
|
|
22
|
+
},
|
|
23
|
+
};
|
|
@@ -0,0 +1,46 @@
|
|
|
1
|
+
export default {
|
|
2
|
+
type: "function",
|
|
3
|
+
function: {
|
|
4
|
+
name: "lsp",
|
|
5
|
+
description: `Interact with Language Server Protocol (LSP) servers to get code intelligence features like go-to-definition, find-references, hover information, and symbol search.
|
|
6
|
+
|
|
7
|
+
Supported operations:
|
|
8
|
+
- go_to_definition: Find where a symbol is defined
|
|
9
|
+
- find_references: Find all references to a symbol across the codebase
|
|
10
|
+
- hover: Get hover information (documentation, type info) for a symbol
|
|
11
|
+
- document_symbol: Get all symbols (functions, classes, variables) in a document
|
|
12
|
+
- workspace_symbol: Search for symbols across the entire workspace
|
|
13
|
+
|
|
14
|
+
All operations require:
|
|
15
|
+
- file_path: The absolute path to the file to operate on
|
|
16
|
+
- line: The line number (1-based, as shown in editors)
|
|
17
|
+
- character: The character offset (1-based, as shown in editors)
|
|
18
|
+
|
|
19
|
+
Note: LSP servers must be configured for the file type. If no server is available, an error will be returned.`,
|
|
20
|
+
strict: true,
|
|
21
|
+
parameters: {
|
|
22
|
+
type: "object",
|
|
23
|
+
properties: {
|
|
24
|
+
operation: {
|
|
25
|
+
type: "string",
|
|
26
|
+
description: "The LSP operation to perform",
|
|
27
|
+
enum: ["go_to_definition", "find_references", "hover", "document_symbol", "workspace_symbol"],
|
|
28
|
+
},
|
|
29
|
+
file_path: {
|
|
30
|
+
type: "string",
|
|
31
|
+
description: "The absolute path to the file to operate on",
|
|
32
|
+
},
|
|
33
|
+
line: {
|
|
34
|
+
type: "number",
|
|
35
|
+
description: "The line number (1-based, as shown in editors)",
|
|
36
|
+
},
|
|
37
|
+
character: {
|
|
38
|
+
type: "number",
|
|
39
|
+
description: "The character offset (1-based, as shown in editors)",
|
|
40
|
+
},
|
|
41
|
+
},
|
|
42
|
+
required: ["operation", "file_path", "line", "character"],
|
|
43
|
+
additionalProperties: false,
|
|
44
|
+
},
|
|
45
|
+
},
|
|
46
|
+
};
|
|
@@ -0,0 +1,42 @@
|
|
|
1
|
+
export default {
|
|
2
|
+
type: "function",
|
|
3
|
+
function: {
|
|
4
|
+
name: "multi_file_edit",
|
|
5
|
+
description: "Make multiple text replacements across one or more files in a single call. Use this tool whenever you have 2 or more edits to make, even if they are all in the same file. Each edit specifies its own file_path, old_string, and new_string. Edits within the same file are applied bottom-to-top to preserve line offsets. Returns per-edit success/failure results.",
|
|
6
|
+
strict: true,
|
|
7
|
+
parameters: {
|
|
8
|
+
type: "object",
|
|
9
|
+
properties: {
|
|
10
|
+
edits: {
|
|
11
|
+
type: "array",
|
|
12
|
+
description: "Array of edit operations. Each edit must have file_path, old_string, new_string. Optionally include replace_all (boolean).",
|
|
13
|
+
items: {
|
|
14
|
+
type: "object",
|
|
15
|
+
properties: {
|
|
16
|
+
file_path: {
|
|
17
|
+
type: "string",
|
|
18
|
+
description: "Absolute path to the file to modify (e.g., /Users/username/project/src/file.ts)",
|
|
19
|
+
},
|
|
20
|
+
old_string: {
|
|
21
|
+
type: "string",
|
|
22
|
+
description: "Exact text to replace. Provide enough context for a unique match. Use an empty string to replace the entire file.",
|
|
23
|
+
},
|
|
24
|
+
new_string: {
|
|
25
|
+
type: "string",
|
|
26
|
+
description: "Replacement text. This will be inserted in place of the matched section. Can be an empty string to delete the match.",
|
|
27
|
+
},
|
|
28
|
+
replace_all: {
|
|
29
|
+
type: "boolean",
|
|
30
|
+
description: "Set to true to replace every occurrence of the matched text. Defaults to false (replace a single uniquely identified occurrence).",
|
|
31
|
+
},
|
|
32
|
+
},
|
|
33
|
+
required: ["file_path", "old_string", "new_string"],
|
|
34
|
+
additionalProperties: false,
|
|
35
|
+
},
|
|
36
|
+
},
|
|
37
|
+
},
|
|
38
|
+
required: ["edits"],
|
|
39
|
+
additionalProperties: false,
|
|
40
|
+
},
|
|
41
|
+
},
|
|
42
|
+
};
|
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
export default {
|
|
2
|
+
type: "function",
|
|
3
|
+
function: {
|
|
4
|
+
name: "new_task",
|
|
5
|
+
description: "Create a new task instance in a specified mode, supplying the initial instructions and optionally a starting todo list when required by settings.",
|
|
6
|
+
strict: true,
|
|
7
|
+
parameters: {
|
|
8
|
+
type: "object",
|
|
9
|
+
properties: {
|
|
10
|
+
mode: {
|
|
11
|
+
type: "string",
|
|
12
|
+
description: "Slug of the mode to begin the new task in (e.g., code, debug, architect)",
|
|
13
|
+
},
|
|
14
|
+
message: {
|
|
15
|
+
type: "string",
|
|
16
|
+
description: "Initial user instructions or context for the new task",
|
|
17
|
+
},
|
|
18
|
+
todos: {
|
|
19
|
+
type: ["string", "null"],
|
|
20
|
+
description: "Optional initial todo list written as a markdown checklist; required when the workspace mandates todos",
|
|
21
|
+
},
|
|
22
|
+
},
|
|
23
|
+
required: ["mode", "message"],
|
|
24
|
+
additionalProperties: false,
|
|
25
|
+
},
|
|
26
|
+
},
|
|
27
|
+
};
|
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
export const read_file_single = {
|
|
2
|
+
type: "function",
|
|
3
|
+
function: {
|
|
4
|
+
name: "read_file",
|
|
5
|
+
description: "Read a file and return its contents with line numbers. Use offset and limit to read specific portions efficiently. Default and maximum limit is 1000 lines to prevent context overflow.",
|
|
6
|
+
strict: true,
|
|
7
|
+
parameters: {
|
|
8
|
+
type: "object",
|
|
9
|
+
properties: {
|
|
10
|
+
file_path: {
|
|
11
|
+
type: "string",
|
|
12
|
+
description: "Absolute path to the file to read (e.g., /Users/username/project/src/file.ts)",
|
|
13
|
+
},
|
|
14
|
+
offset: {
|
|
15
|
+
type: ["number", "null"],
|
|
16
|
+
description: "Starting line number (1-indexed). Defaults to 1 if not specified.",
|
|
17
|
+
},
|
|
18
|
+
limit: {
|
|
19
|
+
type: ["number", "null"],
|
|
20
|
+
description: "Maximum number of lines to read from offset. Default and maximum limit is 1000 lines.",
|
|
21
|
+
},
|
|
22
|
+
},
|
|
23
|
+
required: ["file_path"],
|
|
24
|
+
additionalProperties: false,
|
|
25
|
+
},
|
|
26
|
+
},
|
|
27
|
+
};
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
export default {
|
|
2
|
+
type: "function",
|
|
3
|
+
function: {
|
|
4
|
+
name: "run_slash_command",
|
|
5
|
+
description: "Execute a predefined slash command to receive detailed instructions or content for a common task.",
|
|
6
|
+
strict: true,
|
|
7
|
+
parameters: {
|
|
8
|
+
type: "object",
|
|
9
|
+
properties: {
|
|
10
|
+
command: {
|
|
11
|
+
type: "string",
|
|
12
|
+
description: "Name of the slash command to run (e.g., init, test, deploy)",
|
|
13
|
+
},
|
|
14
|
+
args: {
|
|
15
|
+
type: ["string", "null"],
|
|
16
|
+
description: "Optional additional context or arguments for the command",
|
|
17
|
+
},
|
|
18
|
+
},
|
|
19
|
+
required: ["command"],
|
|
20
|
+
additionalProperties: false,
|
|
21
|
+
},
|
|
22
|
+
},
|
|
23
|
+
};
|
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
export default {
|
|
2
|
+
type: "function",
|
|
3
|
+
function: {
|
|
4
|
+
name: "search_files",
|
|
5
|
+
description: "Run a regex search across files under a directory, returning matches with surrounding context.",
|
|
6
|
+
strict: true,
|
|
7
|
+
parameters: {
|
|
8
|
+
type: "object",
|
|
9
|
+
properties: {
|
|
10
|
+
path: {
|
|
11
|
+
type: "string",
|
|
12
|
+
description: "Directory to search recursively, relative to the workspace",
|
|
13
|
+
},
|
|
14
|
+
regex: {
|
|
15
|
+
type: "string",
|
|
16
|
+
description: "Rust-compatible regular expression pattern to match",
|
|
17
|
+
},
|
|
18
|
+
file_pattern: {
|
|
19
|
+
type: ["string"],
|
|
20
|
+
description: "String glob to limit which files are searched (e.g., '*.ts')",
|
|
21
|
+
},
|
|
22
|
+
},
|
|
23
|
+
required: ["path", "regex", "file_pattern"],
|
|
24
|
+
additionalProperties: false,
|
|
25
|
+
},
|
|
26
|
+
},
|
|
27
|
+
};
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
export default {
|
|
2
|
+
type: "function",
|
|
3
|
+
function: {
|
|
4
|
+
name: "switch_mode",
|
|
5
|
+
description: "Request a switch to a different assistant mode. The user must approve the change before it takes effect.",
|
|
6
|
+
strict: true,
|
|
7
|
+
parameters: {
|
|
8
|
+
type: "object",
|
|
9
|
+
properties: {
|
|
10
|
+
mode_slug: {
|
|
11
|
+
type: "string",
|
|
12
|
+
description: "Slug of the mode to switch to (e.g., code, ask, architect)",
|
|
13
|
+
},
|
|
14
|
+
reason: {
|
|
15
|
+
type: ["string", "null"],
|
|
16
|
+
description: "Optional explanation for why the mode switch is needed",
|
|
17
|
+
},
|
|
18
|
+
},
|
|
19
|
+
required: ["mode_slug"],
|
|
20
|
+
additionalProperties: false,
|
|
21
|
+
},
|
|
22
|
+
},
|
|
23
|
+
};
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
export default {
|
|
2
|
+
type: "function",
|
|
3
|
+
function: {
|
|
4
|
+
name: "update_todo_list",
|
|
5
|
+
description: "Replace the entire todo list with an updated single-level markdown checklist that reflects the current plan and status. Always confirm completed work, keep unfinished items, add new actionable tasks, and follow the [ ], [x], [-] status rules.",
|
|
6
|
+
strict: true,
|
|
7
|
+
parameters: {
|
|
8
|
+
type: "object",
|
|
9
|
+
properties: {
|
|
10
|
+
todos: {
|
|
11
|
+
type: "string",
|
|
12
|
+
description: "Full markdown checklist in execution order, using [ ] for pending, [x] for completed, and [-] for in progress",
|
|
13
|
+
},
|
|
14
|
+
},
|
|
15
|
+
required: ["todos"],
|
|
16
|
+
additionalProperties: false,
|
|
17
|
+
},
|
|
18
|
+
},
|
|
19
|
+
};
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
export default {
|
|
2
|
+
type: "function",
|
|
3
|
+
function: {
|
|
4
|
+
name: "use_skill",
|
|
5
|
+
description: "Use a specific skill to guide the task execution. This tool allows you to apply predefined skills stored in the workspace's .agent/skills directory. Each skill contains specialized instructions for performing specific tasks or following particular patterns.",
|
|
6
|
+
strict: true,
|
|
7
|
+
parameters: {
|
|
8
|
+
type: "object",
|
|
9
|
+
properties: {
|
|
10
|
+
skill_name: {
|
|
11
|
+
type: "string",
|
|
12
|
+
description: "The name of the skill to use. Must match one of the available skills listed in the tool description.",
|
|
13
|
+
},
|
|
14
|
+
},
|
|
15
|
+
required: ["skill_name"],
|
|
16
|
+
additionalProperties: false,
|
|
17
|
+
},
|
|
18
|
+
},
|
|
19
|
+
};
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
export default {
|
|
2
|
+
type: "function",
|
|
3
|
+
function: {
|
|
4
|
+
name: "web_fetch",
|
|
5
|
+
description: "Fetch content from a URL using curl. Use this when you need to scrape or retrieve content from a web page. Returns the raw HTML/text content from the URL.",
|
|
6
|
+
strict: true,
|
|
7
|
+
parameters: {
|
|
8
|
+
type: "object",
|
|
9
|
+
properties: {
|
|
10
|
+
url: {
|
|
11
|
+
type: "string",
|
|
12
|
+
description: "The URL to fetch content from",
|
|
13
|
+
},
|
|
14
|
+
},
|
|
15
|
+
required: ["url"],
|
|
16
|
+
additionalProperties: false,
|
|
17
|
+
},
|
|
18
|
+
},
|
|
19
|
+
};
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
export default {
|
|
2
|
+
type: "function",
|
|
3
|
+
function: {
|
|
4
|
+
name: "web_search",
|
|
5
|
+
description: "Search the web for information using a query. Returns a list of relevant results with URLs, titles, publish dates, and excerpts. Use this when you need to find specific information on the web.",
|
|
6
|
+
strict: true,
|
|
7
|
+
parameters: {
|
|
8
|
+
type: "object",
|
|
9
|
+
properties: {
|
|
10
|
+
query: {
|
|
11
|
+
type: "string",
|
|
12
|
+
description: "The search query to find information on the web",
|
|
13
|
+
},
|
|
14
|
+
},
|
|
15
|
+
required: ["query"],
|
|
16
|
+
additionalProperties: false,
|
|
17
|
+
},
|
|
18
|
+
},
|
|
19
|
+
};
|