@agent-spaces/server 0.3.67 → 0.4.0

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 (64) hide show
  1. package/dist/adapters/agent-runtime.js +4 -0
  2. package/dist/adapters/codex-function-tool-bridge.js +9 -1
  3. package/dist/adapters/git.js +13 -2
  4. package/dist/adapters/hermes-runtime.js +711 -108
  5. package/dist/adapters/langchain-runtime.js +384 -21
  6. package/dist/adapters/oh-my-pi-runtime.js +858 -0
  7. package/dist/adapters/open-agent-sdk-runtime.js +202 -5
  8. package/dist/adapters/open-agent-sdk-runtime.test.js +35 -0
  9. package/dist/agents/agent-message-parts.js +52 -2
  10. package/dist/agents/issue-task-controller.js +4 -2
  11. package/dist/agents/title-generator-agent.js +120 -0
  12. package/dist/app.js +59 -6
  13. package/dist/routes/agent-sse.js +70 -7
  14. package/dist/routes/channel.js +23 -2
  15. package/dist/routes/chat-run.js +191 -0
  16. package/dist/routes/chat.js +142 -0
  17. package/dist/routes/command.js +16 -0
  18. package/dist/routes/data.js +189 -0
  19. package/dist/routes/git.js +10 -1
  20. package/dist/routes/import.js +199 -0
  21. package/dist/routes/issue.js +16 -4
  22. package/dist/routes/plugin.js +69 -0
  23. package/dist/routes/version.js +2 -1
  24. package/dist/routes/workflow-hook.js +71 -0
  25. package/dist/routes/workflow.js +282 -7
  26. package/dist/routes/workspace.js +13 -4
  27. package/dist/services/agent.js +123 -36
  28. package/dist/services/ai-text.js +185 -0
  29. package/dist/services/builtin-tools/index.js +1 -0
  30. package/dist/services/builtin-tools/workflow-editor-tools.js +509 -0
  31. package/dist/services/builtin-tools/workflow-exec-tools.js +320 -0
  32. package/dist/services/chat.js +134 -0
  33. package/dist/services/command-process-manager.js +16 -0
  34. package/dist/services/execution-manager.js +1346 -0
  35. package/dist/services/generated-title.js +59 -0
  36. package/dist/services/gitignore.js +22 -18
  37. package/dist/services/interaction-manager.js +114 -0
  38. package/dist/services/issue-retry.js +25 -0
  39. package/dist/services/output-style.js +8 -1
  40. package/dist/services/plugin.js +257 -0
  41. package/dist/services/prompt-template.js +8 -1
  42. package/dist/services/pty.js +20 -0
  43. package/dist/services/search.js +16 -6
  44. package/dist/services/skill.js +2 -0
  45. package/dist/services/version.js +17 -7
  46. package/dist/services/workflow-command-runner.js +5 -4
  47. package/dist/services/workflow-trigger-service.js +137 -0
  48. package/dist/services/workflow.js +199 -36
  49. package/dist/storage/agent-store.js +8 -0
  50. package/dist/storage/chat-store.js +151 -0
  51. package/dist/storage/database-store.js +6 -0
  52. package/dist/storage/json-store.js +2 -1
  53. package/dist/storage/kanban-store.js +6 -0
  54. package/dist/storage/workflow-store.js +386 -22
  55. package/dist/ws/agent-prompt.js +6 -2
  56. package/dist/ws/agent-runner.js +29 -18
  57. package/dist/ws/chat-handler.js +89 -0
  58. package/dist/ws/connection-manager.js +49 -2
  59. package/dist/ws/execution-channels.js +88 -0
  60. package/dist/ws/handler.js +32 -5
  61. package/dist/ws/message-parts.js +130 -12
  62. package/dist/ws/terminal-handler.js +26 -0
  63. package/package.json +12 -1
  64. package/public/avatars/user.jpg +0 -0
@@ -5,11 +5,13 @@ import { ClaudeCodeRuntime } from './claude-code-runtime/index.js';
5
5
  import { CodexRuntime } from './codex-runtime.js';
6
6
  import { HermesRuntime } from './hermes-runtime.js';
7
7
  import { LangChainRuntime } from './langchain-runtime.js';
8
+ import { OhMyPiRuntime } from './oh-my-pi-runtime.js';
8
9
  import { OpenAgentSdkRuntime } from './open-agent-sdk-runtime.js';
9
10
  export { ClaudeCodeRuntime } from './claude-code-runtime/index.js';
10
11
  export { CodexRuntime } from './codex-runtime.js';
11
12
  export { HermesRuntime } from './hermes-runtime.js';
12
13
  export { LangChainRuntime } from './langchain-runtime.js';
14
+ export { OhMyPiRuntime } from './oh-my-pi-runtime.js';
13
15
  export { OpenAgentSdkRuntime } from './open-agent-sdk-runtime.js';
14
16
  export function createAgentRuntime(configOrProvider = {}, model) {
15
17
  const config = typeof configOrProvider === 'string'
@@ -26,6 +28,8 @@ export function createAgentRuntime(configOrProvider = {}, model) {
26
28
  return new LangChainRuntime(config);
27
29
  case 'hermes':
28
30
  return new HermesRuntime(config);
31
+ case 'oh-my-pi':
32
+ return new OhMyPiRuntime(config);
29
33
  }
30
34
  }
31
35
  //# sourceMappingURL=agent-runtime.js.map
@@ -22,7 +22,7 @@ export async function startCodexFunctionToolBridge(functionTools, log) {
22
22
  tools: functionTools.map(toMcpTool),
23
23
  }));
24
24
  mcpServer.setRequestHandler(CallToolRequestSchema, async (request) => {
25
- const functionTool = toolsByName.get(request.params.name);
25
+ const functionTool = toolsByName.get(normalizeFunctionToolCallName(request.params.name));
26
26
  if (!functionTool) {
27
27
  throw new McpError(ErrorCode.InvalidParams, `Tool ${request.params.name} not found`);
28
28
  }
@@ -45,6 +45,7 @@ export async function startCodexFunctionToolBridge(functionTools, log) {
45
45
  res.writeHead(404).end('Not found');
46
46
  return;
47
47
  }
48
+ log?.(`function tool bridge request | method=${req.method ?? '-'} path=${url.pathname}`);
48
49
  await transport.handleRequest(req, res);
49
50
  }
50
51
  catch (err) {
@@ -83,6 +84,13 @@ function toMcpTool(functionTool) {
83
84
  annotations: toMcpToolAnnotations(functionTool),
84
85
  };
85
86
  }
87
+ function normalizeFunctionToolCallName(name) {
88
+ const prefixedName = agentSpacesMcpToolNamePrefix();
89
+ return name.startsWith(prefixedName) ? name.slice(prefixedName.length) : name;
90
+ }
91
+ function agentSpacesMcpToolNamePrefix() {
92
+ return `mcp__${AGENT_SPACES_MCP_SERVER_NAME}__`;
93
+ }
86
94
  function normalizeToolInputSchema(schema) {
87
95
  if (schema.type === 'object')
88
96
  return schema;
@@ -273,7 +273,7 @@ export async function gitLog(workspaceId, maxCount = 50) {
273
273
  const status = await git.status();
274
274
  const upstream = await getUpstreamRef(git, status.current || 'HEAD');
275
275
  const refs = upstream ? ['HEAD', upstream] : ['HEAD'];
276
- const pretty = '%H%x1f%s%x1f%an%x1f%aI%x1e';
276
+ const pretty = '%H%x1f%P%x1f%s%x1f%an%x1f%aI%x1f%D%x1e';
277
277
  const logArgs = ['log', `--max-count=${maxCount}`, `--pretty=format:${pretty}`];
278
278
  const raw = await git.raw([...logArgs, ...refs]).catch((err) => {
279
279
  if (!upstream)
@@ -284,12 +284,16 @@ export async function gitLog(workspaceId, maxCount = 50) {
284
284
  .map(record => record.trim())
285
285
  .filter(Boolean)
286
286
  .map(record => {
287
- const [hash = '', message = '', author = '', date = ''] = record.split('\x1f');
287
+ const [hash = '', parentHashes = '', message = '', author = '', date = '', refsRaw = ''] = record.split('\x1f');
288
+ const parents = parentHashes ? parentHashes.split(' ').map(p => p.substring(0, 7)) : [];
289
+ const refs = refsRaw ? refsRaw.split(', ').map(r => r.trim()).filter(Boolean) : [];
288
290
  return {
289
291
  hash: hash.substring(0, 7),
292
+ parents,
290
293
  message,
291
294
  author,
292
295
  date,
296
+ refs,
293
297
  };
294
298
  });
295
299
  }
@@ -497,6 +501,13 @@ export async function gitMergeBase(workspaceId) {
497
501
  const result = await git.raw(['merge-base', 'HEAD', 'origin/HEAD']).catch(() => '');
498
502
  return result.trim();
499
503
  }
504
+ export async function gitReset(workspaceId, commitHash, mode = 'mixed') {
505
+ const ws = getWorkspace(workspaceId);
506
+ if (!ws)
507
+ throw new Error('Workspace not found');
508
+ const git = getGit(ws);
509
+ await git.reset([`--${mode}`, commitHash]);
510
+ }
500
511
  export async function gitGetConfig(scope, workspaceId) {
501
512
  const scopeFlag = scope === 'global' ? '--global' : '--local';
502
513
  const git = workspaceId ? getGit(getWorkspace(workspaceId)) : simpleGit();