@realqiyan/agent-task 0.0.1-rc.2 → 0.0.1-rc.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.
Files changed (88) hide show
  1. package/README.md +4 -3
  2. package/bin/agent-task.mjs +23 -36
  3. package/dist/{launcher.js → application/launcher.js} +19 -42
  4. package/dist/application/main.js +122 -0
  5. package/dist/{startup.js → application/startup.js} +6 -11
  6. package/dist/application/task-runtime.js +42 -0
  7. package/dist/configuration/contract.js +28 -0
  8. package/dist/{environment.js → configuration/environment.js} +1 -5
  9. package/dist/configuration/files.js +43 -0
  10. package/dist/configuration/management.js +6 -0
  11. package/dist/configuration/model.js +2 -0
  12. package/dist/configuration/policy.js +29 -0
  13. package/dist/configuration/ports.js +2 -0
  14. package/dist/{settings.js → configuration/settings.js} +77 -39
  15. package/dist/executors/environment.js +10 -0
  16. package/dist/executors/model.js +2 -0
  17. package/dist/executors/registry.js +29 -0
  18. package/dist/executors/validation.js +10 -0
  19. package/dist/{lock.js → infrastructure/lock.js} +2 -2
  20. package/dist/{private-files.js → infrastructure/private-files.js} +1 -7
  21. package/dist/infrastructure/sqlite.js +19 -0
  22. package/dist/infrastructure/version.js +3 -0
  23. package/dist/{acp.js → integrations/acp/connection.js} +9 -7
  24. package/dist/{node-execution.js → integrations/acp/execution.js} +1 -1
  25. package/dist/{executor-runtime.js → integrations/acp/runtime.js} +1 -10
  26. package/dist/{worker.js → integrations/acp/worker.js} +3 -2
  27. package/dist/{coordinator.js → integrations/coordinator/coordinator.js} +16 -7
  28. package/dist/{coordinator-provider.js → integrations/coordinator/provider.js} +1 -1
  29. package/dist/{coordinator-storage.js → integrations/coordinator/storage.js} +2 -2
  30. package/dist/integrations/local-service/control.js +33 -0
  31. package/dist/protocol/cli/admin-client.js +45 -0
  32. package/dist/protocol/cli/commands.js +394 -0
  33. package/dist/{http-auth.js → protocol/http/auth.js} +1 -1
  34. package/dist/protocol/http/server.js +111 -0
  35. package/dist/{web.js → protocol/http/web.js} +18 -17
  36. package/dist/{mcp.js → protocol/mcp.js} +13 -13
  37. package/dist/protocol/services.js +2 -0
  38. package/dist/protocol/settings-contract.js +40 -0
  39. package/dist/protocol/task-contract.js +28 -0
  40. package/dist/results/files.js +70 -0
  41. package/dist/results/ports.js +2 -0
  42. package/dist/results/service.js +42 -0
  43. package/dist/shared/errors.js +13 -0
  44. package/dist/shared/limits.js +3 -0
  45. package/dist/shared/time.js +2 -0
  46. package/dist/shared/validation.js +8 -0
  47. package/dist/tasks/definitions.js +83 -0
  48. package/dist/tasks/graph.js +23 -0
  49. package/dist/{human-input.js → tasks/human-input.js} +8 -7
  50. package/dist/tasks/model.js +2 -0
  51. package/dist/tasks/ports.js +2 -0
  52. package/dist/tasks/runs.js +263 -0
  53. package/dist/tasks/schedule.js +36 -0
  54. package/dist/tasks/sessions.js +62 -0
  55. package/dist/tasks/storage/records.js +45 -0
  56. package/dist/{task-storage.js → tasks/storage/store.js} +23 -36
  57. package/dist/tasks/supervisor.js +227 -0
  58. package/dist/tasks/validation.js +24 -0
  59. package/dist/web/settings-view.js +13 -6
  60. package/docs/architecture-guidelines.md +6 -4
  61. package/docs/cli.md +49 -0
  62. package/docs/deployment.md +16 -56
  63. package/docs/design-proposal.md +2 -2
  64. package/docs/release.md +14 -15
  65. package/docs/technical-design.md +47 -26
  66. package/docs/validation.md +49 -17
  67. package/docs/web-console.md +10 -8
  68. package/package.json +7 -7
  69. package/scripts/install-lib.mjs +4 -95
  70. package/scripts/mcp-call.mjs +1 -1
  71. package/scripts/probe-agent.mjs +6 -5
  72. package/scripts/service-runner.mjs +1 -1
  73. package/scripts/setup-wizard.mjs +1 -6
  74. package/scripts/setup.mjs +17 -30
  75. package/deploy/agent-task.service.example +0 -17
  76. package/dist/admin.js +0 -31
  77. package/dist/config.js +0 -72
  78. package/dist/main.js +0 -175
  79. package/dist/model.js +0 -25
  80. package/dist/results.js +0 -79
  81. package/dist/settings-contract.js +0 -16
  82. package/dist/task-contract.js +0 -37
  83. package/dist/task-model.js +0 -2
  84. package/dist/tasks.js +0 -508
  85. package/dist/version.js +0 -3
  86. package/scripts/uninstall.mjs +0 -57
  87. /package/dist/{permissions.js → executors/permissions.js} +0 -0
  88. /package/dist/{workspace.js → infrastructure/workspace.js} +0 -0
@@ -1,57 +0,0 @@
1
- #!/usr/bin/env node
2
- import { existsSync, realpathSync } from "node:fs";
3
- import { join } from "node:path";
4
- import { pathToFileURL } from "node:url";
5
- import { argumentsFor, installRoot, readManifest, saveManifest, operationLock, deactivate, removeInventory, json } from "./install-lib.mjs";
6
-
7
- import { startupPaths } from "../dist/startup.js";
8
- import { acquireLauncherLock } from "../dist/lock.js";
9
-
10
- process.umask(0o077);
11
- const options = argumentsFor(process.argv.slice(2));
12
- if (options.help) {
13
- console.log("Usage: agent-task uninstall [--home ABSOLUTE_PRIVATE_DIR]\nStops/removes the owned service and installed components only. Keeps configuration, credentials, logs, task history and workspaces.");
14
- process.exit(0);
15
- }
16
- let unlock, release, unlockLauncher;
17
- try {
18
- if (Object.keys(options).some(key => key !== "home")) throw new Error("Only --home is accepted");
19
- const root = installRoot(options);
20
- if (!existsSync(root)) { console.log("Nothing installed; nothing removed."); process.exit(0); }
21
- readManifest(root);
22
- unlock = operationLock(root);
23
- const manifest = readManifest(root);
24
- await deactivate(manifest);
25
- manifest.serviceInstalled = false; saveManifest(root, manifest);
26
- unlockLauncher = acquireLauncherLock(root);
27
- if (existsSync(join(root, "launch.json"))) {
28
- const paths = startupPaths(root), config = json(paths.configPath);
29
- const protectedPaths = [paths.dataDir, config.dataDir, ...config.executors.map(executor => executor.cwd)];
30
- // Verify the service is stopped, including any manually started owner.
31
- const lockModule = join(manifest.app, "dist/lock.js");
32
- if (existsSync(lockModule)) {
33
- const { acquireLock } = await import(pathToFileURL(lockModule).href);
34
- release = await acquireLock(paths.dataDir);
35
- const storeModule = join(manifest.app, "dist/task-storage.js");
36
- if (existsSync(join(paths.dataDir, "tasks.sqlite")) && existsSync(storeModule)) {
37
- const { TaskStore } = await import(pathToFileURL(storeModule).href);
38
- const store = new TaskStore(paths.dataDir);
39
- try {
40
- for (const task of store.definitions()) protectedPaths.push(task.workspace, task.input.workspace, ...Object.values(task.executors).map(executor => executor.cwd));
41
- for (const run of store.rounds()) for (const node of run.nodes) protectedPaths.push(node.workspace);
42
- } finally { store.close(); }
43
- }
44
- } else if (manifest.phase !== "uninstalled") throw new Error("Cannot verify data ownership; resume setup before uninstall");
45
- for (const path of protectedPaths.filter(Boolean)) {
46
- const canonical = existsSync(path) ? realpathSync(path) : path;
47
- const components = join(root, "components");
48
- if (canonical === components || canonical.startsWith(components + "/")) {
49
- throw new Error("Installed components are referenced as data/workspace; refusing to delete them");
50
- }
51
- }
52
- }
53
- removeInventory(root, manifest.files);
54
- manifest.phase = "uninstalled"; manifest.files = []; saveManifest(root, manifest);
55
- console.log("Owned service and inventoried components removed. Configuration, environment.json, logs, data, workspaces and all native/shared executor authentication are preserved. Repeated uninstall is safe.");
56
- } catch (error) { console.error(error.message); process.exitCode = 1; }
57
- finally { await release?.(); unlockLauncher?.(); unlock?.(); }