@xenosystem/agent-sdk 0.10.36 → 0.10.37

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 (77) hide show
  1. package/dist/agents/index.cjs +9 -9
  2. package/dist/agents/index.d.cts +4 -1
  3. package/dist/agents/index.d.ts +4 -1
  4. package/dist/agents/index.js +16 -16
  5. package/dist/agents/metafile-cjs.json +1 -1
  6. package/dist/agents/metafile-esm.json +1 -1
  7. package/dist/artifacts/index.cjs +1 -1
  8. package/dist/artifacts/index.js +1 -1
  9. package/dist/artifacts/metafile-cjs.json +1 -1
  10. package/dist/artifacts/metafile-esm.json +1 -1
  11. package/dist/automation/index.cjs +35 -24
  12. package/dist/automation/index.d.cts +194 -12
  13. package/dist/automation/index.d.ts +194 -12
  14. package/dist/automation/index.js +35 -24
  15. package/dist/automation/metafile-cjs.json +1 -1
  16. package/dist/automation/metafile-esm.json +1 -1
  17. package/dist/control-plane/index.cjs +8 -8
  18. package/dist/control-plane/index.js +8 -8
  19. package/dist/control-plane/metafile-cjs.json +1 -1
  20. package/dist/control-plane/metafile-esm.json +1 -1
  21. package/dist/coordination/index.cjs +2 -2
  22. package/dist/coordination/index.js +2 -2
  23. package/dist/coordination/metafile-cjs.json +1 -1
  24. package/dist/coordination/metafile-esm.json +1 -1
  25. package/dist/electron/index.cjs +239 -227
  26. package/dist/electron/index.d.cts +158 -1
  27. package/dist/electron/index.d.ts +158 -1
  28. package/dist/electron/index.js +239 -227
  29. package/dist/electron/metafile-cjs.json +1 -1
  30. package/dist/electron/metafile-esm.json +1 -1
  31. package/dist/hosted/metafile-cjs.json +1 -1
  32. package/dist/hosted/metafile-esm.json +1 -1
  33. package/dist/index.cjs +399 -388
  34. package/dist/index.d.cts +323 -172
  35. package/dist/index.d.ts +323 -172
  36. package/dist/index.js +401 -390
  37. package/dist/intelligence/index.cjs +4 -4
  38. package/dist/intelligence/index.js +4 -4
  39. package/dist/intelligence/metafile-cjs.json +1 -1
  40. package/dist/intelligence/metafile-esm.json +1 -1
  41. package/dist/mcp/index.cjs +20 -20
  42. package/dist/mcp/index.d.cts +146 -0
  43. package/dist/mcp/index.d.ts +146 -0
  44. package/dist/mcp/index.js +17 -17
  45. package/dist/mcp/metafile-cjs.json +1 -1
  46. package/dist/mcp/metafile-esm.json +1 -1
  47. package/dist/metafile-cjs.json +1 -1
  48. package/dist/metafile-esm.json +1 -1
  49. package/dist/providers/index.cjs +10 -10
  50. package/dist/providers/index.d.cts +49 -5
  51. package/dist/providers/index.d.ts +49 -5
  52. package/dist/providers/index.js +10 -10
  53. package/dist/providers/metafile-cjs.json +1 -1
  54. package/dist/providers/metafile-esm.json +1 -1
  55. package/dist/recipes/metafile-cjs.json +1 -1
  56. package/dist/recipes/metafile-esm.json +1 -1
  57. package/dist/research/metafile-cjs.json +1 -1
  58. package/dist/research/metafile-esm.json +1 -1
  59. package/dist/session/index.cjs +24 -24
  60. package/dist/session/index.js +16 -16
  61. package/dist/session/metafile-cjs.json +1 -1
  62. package/dist/session/metafile-esm.json +1 -1
  63. package/dist/sharing/index.cjs +1 -1
  64. package/dist/sharing/index.js +3 -3
  65. package/dist/sharing/metafile-cjs.json +1 -1
  66. package/dist/sharing/metafile-esm.json +1 -1
  67. package/dist/skills/index.d.cts +6 -0
  68. package/dist/skills/index.d.ts +6 -0
  69. package/dist/utils/index.cjs +24 -24
  70. package/dist/utils/index.d.cts +14 -2
  71. package/dist/utils/index.d.ts +14 -2
  72. package/dist/utils/index.js +24 -24
  73. package/dist/utils/metafile-cjs.json +1 -1
  74. package/dist/utils/metafile-esm.json +1 -1
  75. package/ownership/evidence/PROPRIETARY-PTY-1/implementation-record.md +1 -1
  76. package/ownership/ownership-policy.json +12 -1
  77. package/package.json +1 -1
@@ -1 +1 @@
1
- {"inputs":{"src/automation/types.ts":{"bytes":7431,"imports":[],"format":"esm"},"src/automation/operations.ts":{"bytes":3367,"imports":[],"format":"esm"},"src/automation/errors.ts":{"bytes":899,"imports":[],"format":"esm"},"src/security/path-policy.ts":{"bytes":5541,"imports":[{"path":"node:fs","kind":"import-statement","external":true},{"path":"node:path","kind":"import-statement","external":true}],"format":"esm"},"src/security/windows-process-containment.ts":{"bytes":51557,"imports":[{"path":"node:fs","kind":"import-statement","external":true},{"path":"node:child_process","kind":"import-statement","external":true},{"path":"node:crypto","kind":"import-statement","external":true},{"path":"node:os","kind":"import-statement","external":true},{"path":"node:path","kind":"import-statement","external":true}],"format":"esm"},"src/security/linux-process-containment.ts":{"bytes":5665,"imports":[{"path":"node:child_process","kind":"import-statement","external":true},{"path":"node:fs","kind":"import-statement","external":true},{"path":"node:path","kind":"import-statement","external":true}],"format":"esm"},"src/security/containment-certification.ts":{"bytes":13312,"imports":[{"path":"node:crypto","kind":"import-statement","external":true},{"path":"node:fs","kind":"import-statement","external":true},{"path":"node:path","kind":"import-statement","external":true}],"format":"esm"},"src/security/environment-policy.ts":{"bytes":1195,"imports":[],"format":"esm"},"src/security/mxc-containment.ts":{"bytes":28272,"imports":[{"path":"node:crypto","kind":"import-statement","external":true},{"path":"node:fs","kind":"import-statement","external":true},{"path":"node:os","kind":"import-statement","external":true},{"path":"node:path","kind":"import-statement","external":true},{"path":"node:child_process","kind":"import-statement","external":true},{"path":"node:url","kind":"import-statement","external":true},{"path":"src/security/environment-policy.ts","kind":"import-statement","original":"./environment-policy.js"},{"path":"src/security/path-policy.ts","kind":"import-statement","original":"./path-policy.js"}],"format":"esm"},"src/security/process-containment.ts":{"bytes":17360,"imports":[{"path":"src/security/windows-process-containment.ts","kind":"import-statement","original":"./windows-process-containment.js"},{"path":"src/security/linux-process-containment.ts","kind":"import-statement","original":"./linux-process-containment.js"},{"path":"src/security/path-policy.ts","kind":"import-statement","original":"./path-policy.js"},{"path":"src/security/containment-certification.ts","kind":"import-statement","original":"./containment-certification.js"},{"path":"src/security/mxc-containment.ts","kind":"import-statement","original":"./mxc-containment.js"}],"format":"esm"},"src/security/secure-execution-contract.ts":{"bytes":24510,"imports":[{"path":"node:crypto","kind":"import-statement","external":true},{"path":"node:os","kind":"import-statement","external":true},{"path":"src/security/path-policy.ts","kind":"import-statement","original":"./path-policy.js"},{"path":"src/security/process-containment.ts","kind":"import-statement","original":"./process-containment.js"}],"format":"esm"},"src/automation/policy.ts":{"bytes":15653,"imports":[{"path":"src/security/secure-execution-contract.ts","kind":"import-statement","original":"../security/secure-execution-contract.js"},{"path":"src/automation/errors.ts","kind":"import-statement","original":"./errors.js"},{"path":"src/automation/operations.ts","kind":"import-statement","original":"./operations.js"},{"path":"src/automation/types.ts","kind":"import-statement","original":"./types.js"}],"format":"esm"},"src/artifacts/types.ts":{"bytes":11227,"imports":[],"format":"esm"},"src/artifacts/hash.ts":{"bytes":1489,"imports":[{"path":"node:crypto","kind":"import-statement","external":true}],"format":"esm"},"src/utils/custom-names.ts":{"bytes":2210,"imports":[],"format":"esm"},"src/artifacts/validation.ts":{"bytes":25271,"imports":[{"path":"src/artifacts/types.ts","kind":"import-statement","original":"./types.js"},{"path":"node:buffer","kind":"import-statement","external":true},{"path":"src/artifacts/hash.ts","kind":"import-statement","original":"./hash.js"},{"path":"src/utils/custom-names.ts","kind":"import-statement","original":"../utils/custom-names.js"},{"path":"src/artifacts/types.ts","kind":"import-statement","original":"./types.js"}],"format":"esm"},"src/artifacts/repository.ts":{"bytes":29289,"imports":[{"path":"src/artifacts/types.ts","kind":"import-statement","original":"./types.js"},{"path":"src/artifacts/validation.ts","kind":"import-statement","original":"./validation.js"}],"format":"esm"},"src/automation/evidence.ts":{"bytes":8618,"imports":[{"path":"node:crypto","kind":"import-statement","external":true},{"path":"src/artifacts/repository.ts","kind":"import-statement","original":"../artifacts/repository.js"},{"path":"src/artifacts/hash.ts","kind":"import-statement","original":"../artifacts/hash.js"},{"path":"src/artifacts/types.ts","kind":"import-statement","original":"../artifacts/types.js"},{"path":"src/automation/errors.ts","kind":"import-statement","original":"./errors.js"}],"format":"esm"},"src/automation/durable-execution.ts":{"bytes":4647,"imports":[{"path":"node:crypto","kind":"import-statement","external":true},{"path":"src/automation/evidence.ts","kind":"import-statement","original":"./evidence.js"},{"path":"src/automation/errors.ts","kind":"import-statement","original":"./errors.js"}],"format":"esm"},"src/automation/executor.ts":{"bytes":16288,"imports":[{"path":"node:crypto","kind":"import-statement","external":true},{"path":"src/automation/errors.ts","kind":"import-statement","original":"./errors.js"},{"path":"src/automation/durable-execution.ts","kind":"import-statement","original":"./durable-execution.js"},{"path":"src/automation/evidence.ts","kind":"import-statement","original":"./evidence.js"},{"path":"src/automation/operations.ts","kind":"import-statement","original":"./operations.js"},{"path":"src/automation/policy.ts","kind":"import-statement","original":"./policy.js"}],"format":"esm"},"src/automation/execution-journal.ts":{"bytes":7254,"imports":[{"path":"node:path","kind":"import-statement","external":true},{"path":"src/automation/errors.ts","kind":"import-statement","original":"./errors.js"},{"path":"node:sqlite","kind":"dynamic-import","external":true}],"format":"esm"},"src/automation/conformance.ts":{"bytes":4331,"imports":[{"path":"src/automation/errors.ts","kind":"import-statement","original":"./errors.js"},{"path":"src/automation/policy.ts","kind":"import-statement","original":"./policy.js"},{"path":"src/automation/types.ts","kind":"import-statement","original":"./types.js"}],"format":"esm"},"src/automation/http-adapter.ts":{"bytes":8862,"imports":[{"path":"src/automation/errors.ts","kind":"import-statement","original":"./errors.js"}],"format":"esm"},"src/automation/browser-control-plane-adapter.ts":{"bytes":17420,"imports":[{"path":"node:crypto","kind":"import-statement","external":true}],"format":"esm"},"src/utils/fs.ts":{"bytes":13355,"imports":[{"path":"node:fs","kind":"import-statement","external":true},{"path":"node:fs","kind":"import-statement","external":true},{"path":"node:fs/promises","kind":"import-statement","external":true},{"path":"node:path","kind":"import-statement","external":true}],"format":"esm"},"src/control-plane/lock.ts":{"bytes":2496,"imports":[{"path":"node:fs","kind":"import-statement","external":true},{"path":"node:os","kind":"import-statement","external":true},{"path":"node:path","kind":"import-statement","external":true}],"format":"esm"},"src/version.ts":{"bytes":195,"imports":[],"format":"esm"},"src/artifacts/file-repository.ts":{"bytes":16401,"imports":[{"path":"node:crypto","kind":"import-statement","external":true},{"path":"node:fs/promises","kind":"import-statement","external":true},{"path":"node:path","kind":"import-statement","external":true},{"path":"src/utils/fs.ts","kind":"import-statement","original":"../utils/fs.js"},{"path":"src/control-plane/lock.ts","kind":"import-statement","original":"../control-plane/lock.js"},{"path":"src/version.ts","kind":"import-statement","original":"../version.js"},{"path":"src/artifacts/hash.ts","kind":"import-statement","original":"./hash.js"},{"path":"src/artifacts/repository.ts","kind":"import-statement","original":"./repository.js"},{"path":"src/artifacts/types.ts","kind":"import-statement","original":"./types.js"}],"format":"esm"},"src/utils/yaml.ts":{"bytes":5506,"imports":[],"format":"esm"},"src/utils/platform.ts":{"bytes":5600,"imports":[{"path":"node:os","kind":"import-statement","external":true},{"path":"node:child_process","kind":"import-statement","external":true},{"path":"node:path","kind":"import-statement","external":true}],"format":"esm"},"src/agents/definitions.ts":{"bytes":23563,"imports":[{"path":"node:fs","kind":"import-statement","external":true},{"path":"node:path","kind":"import-statement","external":true},{"path":"src/utils/yaml.ts","kind":"import-statement","original":"../utils/yaml.js"},{"path":"src/utils/platform.ts","kind":"import-statement","original":"../utils/platform.js"}],"format":"esm"},"src/agents/profiles.ts":{"bytes":33625,"imports":[{"path":"node:crypto","kind":"import-statement","external":true},{"path":"src/agents/definitions.ts","kind":"import-statement","original":"./definitions.js"}],"format":"esm"},"src/security/capability-lease.ts":{"bytes":29318,"imports":[{"path":"src/agents/profiles.ts","kind":"import-statement","original":"../agents/profiles.js"},{"path":"src/utils/custom-names.ts","kind":"import-statement","original":"../utils/custom-names.js"}],"format":"esm"},"src/automation/tool-pack.ts":{"bytes":19206,"imports":[{"path":"node:crypto","kind":"import-statement","external":true},{"path":"src/automation/operations.ts","kind":"import-statement","original":"./operations.js"}],"format":"esm"},"src/automation/host-runtime.ts":{"bytes":30630,"imports":[{"path":"node:fs","kind":"import-statement","external":true},{"path":"node:os","kind":"import-statement","external":true},{"path":"node:path","kind":"import-statement","external":true},{"path":"src/artifacts/file-repository.ts","kind":"import-statement","original":"../artifacts/file-repository.js"},{"path":"src/security/capability-lease.ts","kind":"import-statement","original":"../security/capability-lease.js"},{"path":"src/security/secure-execution-contract.ts","kind":"import-statement","original":"../security/secure-execution-contract.js"},{"path":"src/automation/types.ts","kind":"import-statement","original":"./types.js"},{"path":"src/automation/executor.ts","kind":"import-statement","original":"./executor.js"},{"path":"src/automation/operations.ts","kind":"import-statement","original":"./operations.js"},{"path":"src/automation/tool-pack.ts","kind":"import-statement","original":"./tool-pack.js"},{"path":"src/automation/browser-control-plane-adapter.ts","kind":"import-statement","original":"./browser-control-plane-adapter.js"}],"format":"esm"},"src/automation/index.ts":{"bytes":449,"imports":[{"path":"src/automation/types.ts","kind":"import-statement","original":"./types.js"},{"path":"src/automation/operations.ts","kind":"import-statement","original":"./operations.js"},{"path":"src/automation/errors.ts","kind":"import-statement","original":"./errors.js"},{"path":"src/automation/policy.ts","kind":"import-statement","original":"./policy.js"},{"path":"src/automation/evidence.ts","kind":"import-statement","original":"./evidence.js"},{"path":"src/automation/executor.ts","kind":"import-statement","original":"./executor.js"},{"path":"src/automation/execution-journal.ts","kind":"import-statement","original":"./execution-journal.js"},{"path":"src/automation/durable-execution.ts","kind":"import-statement","original":"./durable-execution.js"},{"path":"src/automation/conformance.ts","kind":"import-statement","original":"./conformance.js"},{"path":"src/automation/http-adapter.ts","kind":"import-statement","original":"./http-adapter.js"},{"path":"src/automation/browser-control-plane-adapter.ts","kind":"import-statement","original":"./browser-control-plane-adapter.js"},{"path":"src/automation/host-runtime.ts","kind":"import-statement","original":"./host-runtime.js"},{"path":"src/automation/tool-pack.ts","kind":"import-statement","original":"./tool-pack.js"}],"format":"esm"}},"outputs":{"dist/automation/index.cjs":{"imports":[{"path":"node:crypto","kind":"require-call","external":true},{"path":"node:os","kind":"require-call","external":true},{"path":"node:fs","kind":"require-call","external":true},{"path":"node:path","kind":"require-call","external":true},{"path":"node:fs","kind":"require-call","external":true},{"path":"node:path","kind":"require-call","external":true},{"path":"node:child_process","kind":"require-call","external":true},{"path":"node:fs","kind":"require-call","external":true},{"path":"node:path","kind":"require-call","external":true},{"path":"node:crypto","kind":"require-call","external":true},{"path":"node:fs","kind":"require-call","external":true},{"path":"node:path","kind":"require-call","external":true},{"path":"node:crypto","kind":"require-call","external":true},{"path":"node:fs","kind":"require-call","external":true},{"path":"node:os","kind":"require-call","external":true},{"path":"node:path","kind":"require-call","external":true},{"path":"node:child_process","kind":"require-call","external":true},{"path":"node:url","kind":"require-call","external":true},{"path":"node:crypto","kind":"require-call","external":true},{"path":"node:buffer","kind":"require-call","external":true},{"path":"node:crypto","kind":"require-call","external":true},{"path":"node:crypto","kind":"require-call","external":true},{"path":"node:crypto","kind":"require-call","external":true},{"path":"node:path","kind":"require-call","external":true},{"path":"node:sqlite","kind":"dynamic-import","external":true},{"path":"node:crypto","kind":"require-call","external":true},{"path":"node:fs","kind":"require-call","external":true},{"path":"node:os","kind":"require-call","external":true},{"path":"node:path","kind":"require-call","external":true},{"path":"node:crypto","kind":"require-call","external":true},{"path":"node:fs/promises","kind":"require-call","external":true},{"path":"node:path","kind":"require-call","external":true},{"path":"node:fs/promises","kind":"require-call","external":true},{"path":"node:fs","kind":"require-call","external":true},{"path":"node:os","kind":"require-call","external":true},{"path":"node:path","kind":"require-call","external":true},{"path":"node:os","kind":"require-call","external":true},{"path":"node:crypto","kind":"require-call","external":true}],"exports":[],"entryPoint":"src/automation/index.ts","inputs":{"src/automation/index.ts":{"bytesInOutput":1420},"src/automation/types.ts":{"bytesInOutput":8},"src/automation/operations.ts":{"bytesInOutput":1656},"src/automation/errors.ts":{"bytesInOutput":129},"src/security/secure-execution-contract.ts":{"bytesInOutput":10455},"src/security/path-policy.ts":{"bytesInOutput":2595},"src/security/windows-process-containment.ts":{"bytesInOutput":47581},"src/security/linux-process-containment.ts":{"bytesInOutput":1926},"src/security/containment-certification.ts":{"bytesInOutput":6147},"src/security/mxc-containment.ts":{"bytesInOutput":6578},"src/security/process-containment.ts":{"bytesInOutput":6527},"src/automation/policy.ts":{"bytesInOutput":7901},"src/automation/evidence.ts":{"bytesInOutput":4454},"src/artifacts/types.ts":{"bytesInOutput":825},"src/artifacts/validation.ts":{"bytesInOutput":13385},"src/artifacts/hash.ts":{"bytesInOutput":130},"src/utils/custom-names.ts":{"bytesInOutput":125},"src/artifacts/repository.ts":{"bytesInOutput":13761},"src/automation/executor.ts":{"bytesInOutput":7134},"src/automation/durable-execution.ts":{"bytesInOutput":2222},"src/automation/execution-journal.ts":{"bytesInOutput":4239},"src/automation/conformance.ts":{"bytesInOutput":2208},"src/automation/http-adapter.ts":{"bytesInOutput":4320},"src/automation/browser-control-plane-adapter.ts":{"bytesInOutput":9665},"src/automation/host-runtime.ts":{"bytesInOutput":12873},"src/artifacts/file-repository.ts":{"bytesInOutput":6752},"src/utils/fs.ts":{"bytesInOutput":319},"src/control-plane/lock.ts":{"bytesInOutput":1067},"src/version.ts":{"bytesInOutput":17},"src/utils/platform.ts":{"bytesInOutput":95},"src/agents/definitions.ts":{"bytesInOutput":20},"src/agents/profiles.ts":{"bytesInOutput":8624},"src/security/capability-lease.ts":{"bytesInOutput":14569},"src/automation/tool-pack.ts":{"bytesInOutput":10038}},"bytes":211510}}}
1
+ {"inputs":{"src/automation/types.ts":{"bytes":7650,"imports":[],"format":"esm"},"src/automation/operations.ts":{"bytes":3367,"imports":[],"format":"esm"},"src/automation/errors.ts":{"bytes":899,"imports":[],"format":"esm"},"src/security/path-policy.ts":{"bytes":5541,"imports":[{"path":"node:fs","kind":"import-statement","external":true},{"path":"node:path","kind":"import-statement","external":true}],"format":"esm"},"src/security/windows-process-containment.ts":{"bytes":56741,"imports":[{"path":"node:fs","kind":"import-statement","external":true},{"path":"node:child_process","kind":"import-statement","external":true},{"path":"node:crypto","kind":"import-statement","external":true},{"path":"node:os","kind":"import-statement","external":true},{"path":"node:path","kind":"import-statement","external":true}],"format":"esm"},"src/security/linux-process-containment.ts":{"bytes":5665,"imports":[{"path":"node:child_process","kind":"import-statement","external":true},{"path":"node:fs","kind":"import-statement","external":true},{"path":"node:path","kind":"import-statement","external":true}],"format":"esm"},"src/security/containment-certification.ts":{"bytes":13312,"imports":[{"path":"node:crypto","kind":"import-statement","external":true},{"path":"node:fs","kind":"import-statement","external":true},{"path":"node:path","kind":"import-statement","external":true}],"format":"esm"},"src/security/environment-policy.ts":{"bytes":1195,"imports":[],"format":"esm"},"src/security/mxc-containment.ts":{"bytes":28272,"imports":[{"path":"node:crypto","kind":"import-statement","external":true},{"path":"node:fs","kind":"import-statement","external":true},{"path":"node:os","kind":"import-statement","external":true},{"path":"node:path","kind":"import-statement","external":true},{"path":"node:child_process","kind":"import-statement","external":true},{"path":"node:url","kind":"import-statement","external":true},{"path":"src/security/environment-policy.ts","kind":"import-statement","original":"./environment-policy.js"},{"path":"src/security/path-policy.ts","kind":"import-statement","original":"./path-policy.js"}],"format":"esm"},"src/security/process-containment.ts":{"bytes":17360,"imports":[{"path":"src/security/windows-process-containment.ts","kind":"import-statement","original":"./windows-process-containment.js"},{"path":"src/security/linux-process-containment.ts","kind":"import-statement","original":"./linux-process-containment.js"},{"path":"src/security/path-policy.ts","kind":"import-statement","original":"./path-policy.js"},{"path":"src/security/containment-certification.ts","kind":"import-statement","original":"./containment-certification.js"},{"path":"src/security/mxc-containment.ts","kind":"import-statement","original":"./mxc-containment.js"}],"format":"esm"},"src/security/secure-execution-contract.ts":{"bytes":24510,"imports":[{"path":"node:crypto","kind":"import-statement","external":true},{"path":"node:os","kind":"import-statement","external":true},{"path":"src/security/path-policy.ts","kind":"import-statement","original":"./path-policy.js"},{"path":"src/security/process-containment.ts","kind":"import-statement","original":"./process-containment.js"}],"format":"esm"},"src/automation/policy.ts":{"bytes":16203,"imports":[{"path":"src/security/secure-execution-contract.ts","kind":"import-statement","original":"../security/secure-execution-contract.js"},{"path":"src/automation/errors.ts","kind":"import-statement","original":"./errors.js"},{"path":"src/automation/operations.ts","kind":"import-statement","original":"./operations.js"},{"path":"src/automation/types.ts","kind":"import-statement","original":"./types.js"}],"format":"esm"},"src/artifacts/types.ts":{"bytes":11227,"imports":[],"format":"esm"},"src/artifacts/hash.ts":{"bytes":1489,"imports":[{"path":"node:crypto","kind":"import-statement","external":true}],"format":"esm"},"src/utils/custom-names.ts":{"bytes":2210,"imports":[],"format":"esm"},"src/artifacts/validation.ts":{"bytes":25271,"imports":[{"path":"src/artifacts/types.ts","kind":"import-statement","original":"./types.js"},{"path":"node:buffer","kind":"import-statement","external":true},{"path":"src/artifacts/hash.ts","kind":"import-statement","original":"./hash.js"},{"path":"src/utils/custom-names.ts","kind":"import-statement","original":"../utils/custom-names.js"},{"path":"src/artifacts/types.ts","kind":"import-statement","original":"./types.js"}],"format":"esm"},"src/artifacts/repository.ts":{"bytes":29289,"imports":[{"path":"src/artifacts/types.ts","kind":"import-statement","original":"./types.js"},{"path":"src/artifacts/validation.ts","kind":"import-statement","original":"./validation.js"}],"format":"esm"},"src/automation/evidence.ts":{"bytes":8618,"imports":[{"path":"node:crypto","kind":"import-statement","external":true},{"path":"src/artifacts/repository.ts","kind":"import-statement","original":"../artifacts/repository.js"},{"path":"src/artifacts/hash.ts","kind":"import-statement","original":"../artifacts/hash.js"},{"path":"src/artifacts/types.ts","kind":"import-statement","original":"../artifacts/types.js"},{"path":"src/automation/errors.ts","kind":"import-statement","original":"./errors.js"}],"format":"esm"},"src/automation/durable-execution.ts":{"bytes":4647,"imports":[{"path":"node:crypto","kind":"import-statement","external":true},{"path":"src/automation/evidence.ts","kind":"import-statement","original":"./evidence.js"},{"path":"src/automation/errors.ts","kind":"import-statement","original":"./errors.js"}],"format":"esm"},"src/automation/executor.ts":{"bytes":19396,"imports":[{"path":"node:crypto","kind":"import-statement","external":true},{"path":"src/automation/errors.ts","kind":"import-statement","original":"./errors.js"},{"path":"src/automation/durable-execution.ts","kind":"import-statement","original":"./durable-execution.js"},{"path":"src/automation/evidence.ts","kind":"import-statement","original":"./evidence.js"},{"path":"src/automation/operations.ts","kind":"import-statement","original":"./operations.js"},{"path":"src/automation/policy.ts","kind":"import-statement","original":"./policy.js"}],"format":"esm"},"src/automation/execution-journal.ts":{"bytes":7254,"imports":[{"path":"node:path","kind":"import-statement","external":true},{"path":"src/automation/errors.ts","kind":"import-statement","original":"./errors.js"},{"path":"node:sqlite","kind":"dynamic-import","external":true}],"format":"esm"},"src/automation/conformance.ts":{"bytes":4331,"imports":[{"path":"src/automation/errors.ts","kind":"import-statement","original":"./errors.js"},{"path":"src/automation/policy.ts","kind":"import-statement","original":"./policy.js"},{"path":"src/automation/types.ts","kind":"import-statement","original":"./types.js"}],"format":"esm"},"src/automation/http-adapter.ts":{"bytes":13925,"imports":[{"path":"src/automation/errors.ts","kind":"import-statement","original":"./errors.js"},{"path":"src/automation/policy.ts","kind":"import-statement","original":"./policy.js"}],"format":"esm"},"src/automation/browser-control-plane-adapter.ts":{"bytes":2368,"imports":[{"path":"src/automation/errors.ts","kind":"import-statement","original":"./errors.js"},{"path":"src/automation/http-adapter.ts","kind":"import-statement","original":"./http-adapter.js"},{"path":"src/automation/policy.ts","kind":"import-statement","original":"./policy.js"}],"format":"esm"},"src/utils/fs.ts":{"bytes":13746,"imports":[{"path":"node:fs","kind":"import-statement","external":true},{"path":"node:fs","kind":"import-statement","external":true},{"path":"node:fs/promises","kind":"import-statement","external":true},{"path":"node:path","kind":"import-statement","external":true}],"format":"esm"},"src/control-plane/lock.ts":{"bytes":2496,"imports":[{"path":"node:fs","kind":"import-statement","external":true},{"path":"node:os","kind":"import-statement","external":true},{"path":"node:path","kind":"import-statement","external":true}],"format":"esm"},"src/version.ts":{"bytes":195,"imports":[],"format":"esm"},"src/artifacts/file-repository.ts":{"bytes":16401,"imports":[{"path":"node:crypto","kind":"import-statement","external":true},{"path":"node:fs/promises","kind":"import-statement","external":true},{"path":"node:path","kind":"import-statement","external":true},{"path":"src/utils/fs.ts","kind":"import-statement","original":"../utils/fs.js"},{"path":"src/control-plane/lock.ts","kind":"import-statement","original":"../control-plane/lock.js"},{"path":"src/version.ts","kind":"import-statement","original":"../version.js"},{"path":"src/artifacts/hash.ts","kind":"import-statement","original":"./hash.js"},{"path":"src/artifacts/repository.ts","kind":"import-statement","original":"./repository.js"},{"path":"src/artifacts/types.ts","kind":"import-statement","original":"./types.js"}],"format":"esm"},"src/utils/yaml.ts":{"bytes":5506,"imports":[],"format":"esm"},"src/runtime/process-tree-kill.ts":{"bytes":9124,"imports":[{"path":"node:child_process","kind":"import-statement","external":true}],"format":"esm"},"src/utils/platform.ts":{"bytes":9633,"imports":[{"path":"node:os","kind":"import-statement","external":true},{"path":"node:child_process","kind":"import-statement","external":true},{"path":"node:fs","kind":"import-statement","external":true},{"path":"node:path","kind":"import-statement","external":true},{"path":"src/runtime/process-tree-kill.ts","kind":"import-statement","original":"../runtime/process-tree-kill.js"}],"format":"esm"},"src/agents/definitions.ts":{"bytes":25020,"imports":[{"path":"node:fs","kind":"import-statement","external":true},{"path":"node:path","kind":"import-statement","external":true},{"path":"src/utils/yaml.ts","kind":"import-statement","original":"../utils/yaml.js"},{"path":"src/utils/platform.ts","kind":"import-statement","original":"../utils/platform.js"}],"format":"esm"},"src/agents/profiles.ts":{"bytes":33891,"imports":[{"path":"node:crypto","kind":"import-statement","external":true},{"path":"src/agents/definitions.ts","kind":"import-statement","original":"./definitions.js"}],"format":"esm"},"src/security/capability-lease.ts":{"bytes":29318,"imports":[{"path":"src/agents/profiles.ts","kind":"import-statement","original":"../agents/profiles.js"},{"path":"src/utils/custom-names.ts","kind":"import-statement","original":"../utils/custom-names.js"}],"format":"esm"},"src/automation/tool-pack.ts":{"bytes":19556,"imports":[{"path":"node:crypto","kind":"import-statement","external":true},{"path":"src/automation/operations.ts","kind":"import-statement","original":"./operations.js"}],"format":"esm"},"src/security/tool-authorization.ts":{"bytes":2746,"imports":[{"path":"node:crypto","kind":"import-statement","external":true}],"format":"esm"},"src/automation/host-runtime.ts":{"bytes":41060,"imports":[{"path":"node:fs","kind":"import-statement","external":true},{"path":"node:crypto","kind":"import-statement","external":true},{"path":"node:os","kind":"import-statement","external":true},{"path":"node:path","kind":"import-statement","external":true},{"path":"src/artifacts/file-repository.ts","kind":"import-statement","original":"../artifacts/file-repository.js"},{"path":"src/security/capability-lease.ts","kind":"import-statement","original":"../security/capability-lease.js"},{"path":"src/security/secure-execution-contract.ts","kind":"import-statement","original":"../security/secure-execution-contract.js"},{"path":"src/automation/types.ts","kind":"import-statement","original":"./types.js"},{"path":"src/automation/executor.ts","kind":"import-statement","original":"./executor.js"},{"path":"src/automation/operations.ts","kind":"import-statement","original":"./operations.js"},{"path":"src/automation/tool-pack.ts","kind":"import-statement","original":"./tool-pack.js"},{"path":"src/automation/browser-control-plane-adapter.ts","kind":"import-statement","original":"./browser-control-plane-adapter.js"},{"path":"src/automation/policy.ts","kind":"import-statement","original":"./policy.js"},{"path":"src/security/tool-authorization.ts","kind":"import-statement","original":"../security/tool-authorization.js"}],"format":"esm"},"src/automation/index.ts":{"bytes":449,"imports":[{"path":"src/automation/types.ts","kind":"import-statement","original":"./types.js"},{"path":"src/automation/operations.ts","kind":"import-statement","original":"./operations.js"},{"path":"src/automation/errors.ts","kind":"import-statement","original":"./errors.js"},{"path":"src/automation/policy.ts","kind":"import-statement","original":"./policy.js"},{"path":"src/automation/evidence.ts","kind":"import-statement","original":"./evidence.js"},{"path":"src/automation/executor.ts","kind":"import-statement","original":"./executor.js"},{"path":"src/automation/execution-journal.ts","kind":"import-statement","original":"./execution-journal.js"},{"path":"src/automation/durable-execution.ts","kind":"import-statement","original":"./durable-execution.js"},{"path":"src/automation/conformance.ts","kind":"import-statement","original":"./conformance.js"},{"path":"src/automation/http-adapter.ts","kind":"import-statement","original":"./http-adapter.js"},{"path":"src/automation/browser-control-plane-adapter.ts","kind":"import-statement","original":"./browser-control-plane-adapter.js"},{"path":"src/automation/host-runtime.ts","kind":"import-statement","original":"./host-runtime.js"},{"path":"src/automation/tool-pack.ts","kind":"import-statement","original":"./tool-pack.js"}],"format":"esm"}},"outputs":{"dist/automation/index.cjs":{"imports":[{"path":"node:crypto","kind":"require-call","external":true},{"path":"node:os","kind":"require-call","external":true},{"path":"node:fs","kind":"require-call","external":true},{"path":"node:path","kind":"require-call","external":true},{"path":"node:fs","kind":"require-call","external":true},{"path":"node:path","kind":"require-call","external":true},{"path":"node:child_process","kind":"require-call","external":true},{"path":"node:fs","kind":"require-call","external":true},{"path":"node:path","kind":"require-call","external":true},{"path":"node:crypto","kind":"require-call","external":true},{"path":"node:fs","kind":"require-call","external":true},{"path":"node:path","kind":"require-call","external":true},{"path":"node:crypto","kind":"require-call","external":true},{"path":"node:fs","kind":"require-call","external":true},{"path":"node:os","kind":"require-call","external":true},{"path":"node:path","kind":"require-call","external":true},{"path":"node:child_process","kind":"require-call","external":true},{"path":"node:url","kind":"require-call","external":true},{"path":"node:crypto","kind":"require-call","external":true},{"path":"node:buffer","kind":"require-call","external":true},{"path":"node:crypto","kind":"require-call","external":true},{"path":"node:crypto","kind":"require-call","external":true},{"path":"node:crypto","kind":"require-call","external":true},{"path":"node:path","kind":"require-call","external":true},{"path":"node:sqlite","kind":"dynamic-import","external":true},{"path":"node:fs","kind":"require-call","external":true},{"path":"node:crypto","kind":"require-call","external":true},{"path":"node:os","kind":"require-call","external":true},{"path":"node:path","kind":"require-call","external":true},{"path":"node:crypto","kind":"require-call","external":true},{"path":"node:fs/promises","kind":"require-call","external":true},{"path":"node:path","kind":"require-call","external":true},{"path":"node:fs/promises","kind":"require-call","external":true},{"path":"node:fs","kind":"require-call","external":true},{"path":"node:os","kind":"require-call","external":true},{"path":"node:path","kind":"require-call","external":true},{"path":"node:os","kind":"require-call","external":true},{"path":"node:crypto","kind":"require-call","external":true},{"path":"node:crypto","kind":"require-call","external":true}],"exports":[],"entryPoint":"src/automation/index.ts","inputs":{"src/automation/index.ts":{"bytesInOutput":1466},"src/automation/types.ts":{"bytesInOutput":9},"src/automation/operations.ts":{"bytesInOutput":1656},"src/automation/errors.ts":{"bytesInOutput":129},"src/security/secure-execution-contract.ts":{"bytesInOutput":10453},"src/security/path-policy.ts":{"bytesInOutput":2595},"src/security/windows-process-containment.ts":{"bytesInOutput":48432},"src/security/linux-process-containment.ts":{"bytesInOutput":1931},"src/security/containment-certification.ts":{"bytesInOutput":6152},"src/security/mxc-containment.ts":{"bytesInOutput":6578},"src/security/process-containment.ts":{"bytesInOutput":6527},"src/automation/policy.ts":{"bytesInOutput":8211},"src/automation/evidence.ts":{"bytesInOutput":4454},"src/artifacts/types.ts":{"bytesInOutput":825},"src/artifacts/validation.ts":{"bytesInOutput":13385},"src/artifacts/hash.ts":{"bytesInOutput":130},"src/utils/custom-names.ts":{"bytesInOutput":125},"src/artifacts/repository.ts":{"bytesInOutput":13761},"src/automation/executor.ts":{"bytesInOutput":8390},"src/automation/durable-execution.ts":{"bytesInOutput":2222},"src/automation/execution-journal.ts":{"bytesInOutput":4239},"src/automation/conformance.ts":{"bytesInOutput":2207},"src/automation/http-adapter.ts":{"bytesInOutput":7343},"src/automation/browser-control-plane-adapter.ts":{"bytesInOutput":861},"src/automation/host-runtime.ts":{"bytesInOutput":17687},"src/artifacts/file-repository.ts":{"bytesInOutput":6752},"src/utils/fs.ts":{"bytesInOutput":319},"src/control-plane/lock.ts":{"bytesInOutput":1067},"src/version.ts":{"bytesInOutput":17},"src/utils/platform.ts":{"bytesInOutput":95},"src/agents/definitions.ts":{"bytesInOutput":20},"src/agents/profiles.ts":{"bytesInOutput":8624},"src/security/capability-lease.ts":{"bytesInOutput":14569},"src/automation/tool-pack.ts":{"bytesInOutput":10303},"src/security/tool-authorization.ts":{"bytesInOutput":1117}},"bytes":214436}}}
@@ -1 +1 @@
1
- {"inputs":{"src/automation/types.ts":{"bytes":7431,"imports":[],"format":"esm"},"src/automation/operations.ts":{"bytes":3367,"imports":[],"format":"esm"},"src/automation/errors.ts":{"bytes":899,"imports":[],"format":"esm"},"src/security/path-policy.ts":{"bytes":5541,"imports":[{"path":"node:fs","kind":"import-statement","external":true},{"path":"node:path","kind":"import-statement","external":true}],"format":"esm"},"src/security/windows-process-containment.ts":{"bytes":51557,"imports":[{"path":"node:fs","kind":"import-statement","external":true},{"path":"node:child_process","kind":"import-statement","external":true},{"path":"node:crypto","kind":"import-statement","external":true},{"path":"node:os","kind":"import-statement","external":true},{"path":"node:path","kind":"import-statement","external":true}],"format":"esm"},"src/security/linux-process-containment.ts":{"bytes":5665,"imports":[{"path":"node:child_process","kind":"import-statement","external":true},{"path":"node:fs","kind":"import-statement","external":true},{"path":"node:path","kind":"import-statement","external":true}],"format":"esm"},"src/security/containment-certification.ts":{"bytes":13312,"imports":[{"path":"node:crypto","kind":"import-statement","external":true},{"path":"node:fs","kind":"import-statement","external":true},{"path":"node:path","kind":"import-statement","external":true}],"format":"esm"},"src/security/environment-policy.ts":{"bytes":1195,"imports":[],"format":"esm"},"src/security/mxc-containment.ts":{"bytes":28272,"imports":[{"path":"node:crypto","kind":"import-statement","external":true},{"path":"node:fs","kind":"import-statement","external":true},{"path":"node:os","kind":"import-statement","external":true},{"path":"node:path","kind":"import-statement","external":true},{"path":"node:child_process","kind":"import-statement","external":true},{"path":"node:url","kind":"import-statement","external":true},{"path":"src/security/environment-policy.ts","kind":"import-statement","original":"./environment-policy.js"},{"path":"src/security/path-policy.ts","kind":"import-statement","original":"./path-policy.js"}],"format":"esm"},"src/security/process-containment.ts":{"bytes":17360,"imports":[{"path":"src/security/windows-process-containment.ts","kind":"import-statement","original":"./windows-process-containment.js"},{"path":"src/security/linux-process-containment.ts","kind":"import-statement","original":"./linux-process-containment.js"},{"path":"src/security/path-policy.ts","kind":"import-statement","original":"./path-policy.js"},{"path":"src/security/containment-certification.ts","kind":"import-statement","original":"./containment-certification.js"},{"path":"src/security/mxc-containment.ts","kind":"import-statement","original":"./mxc-containment.js"}],"format":"esm"},"src/security/secure-execution-contract.ts":{"bytes":24510,"imports":[{"path":"node:crypto","kind":"import-statement","external":true},{"path":"node:os","kind":"import-statement","external":true},{"path":"src/security/path-policy.ts","kind":"import-statement","original":"./path-policy.js"},{"path":"src/security/process-containment.ts","kind":"import-statement","original":"./process-containment.js"}],"format":"esm"},"src/automation/policy.ts":{"bytes":15653,"imports":[{"path":"src/security/secure-execution-contract.ts","kind":"import-statement","original":"../security/secure-execution-contract.js"},{"path":"src/automation/errors.ts","kind":"import-statement","original":"./errors.js"},{"path":"src/automation/operations.ts","kind":"import-statement","original":"./operations.js"},{"path":"src/automation/types.ts","kind":"import-statement","original":"./types.js"}],"format":"esm"},"src/artifacts/types.ts":{"bytes":11227,"imports":[],"format":"esm"},"src/artifacts/hash.ts":{"bytes":1489,"imports":[{"path":"node:crypto","kind":"import-statement","external":true}],"format":"esm"},"src/utils/custom-names.ts":{"bytes":2210,"imports":[],"format":"esm"},"src/artifacts/validation.ts":{"bytes":25271,"imports":[{"path":"src/artifacts/types.ts","kind":"import-statement","original":"./types.js"},{"path":"node:buffer","kind":"import-statement","external":true},{"path":"src/artifacts/hash.ts","kind":"import-statement","original":"./hash.js"},{"path":"src/utils/custom-names.ts","kind":"import-statement","original":"../utils/custom-names.js"},{"path":"src/artifacts/types.ts","kind":"import-statement","original":"./types.js"}],"format":"esm"},"src/artifacts/repository.ts":{"bytes":29289,"imports":[{"path":"src/artifacts/types.ts","kind":"import-statement","original":"./types.js"},{"path":"src/artifacts/validation.ts","kind":"import-statement","original":"./validation.js"}],"format":"esm"},"src/automation/evidence.ts":{"bytes":8618,"imports":[{"path":"node:crypto","kind":"import-statement","external":true},{"path":"src/artifacts/repository.ts","kind":"import-statement","original":"../artifacts/repository.js"},{"path":"src/artifacts/hash.ts","kind":"import-statement","original":"../artifacts/hash.js"},{"path":"src/artifacts/types.ts","kind":"import-statement","original":"../artifacts/types.js"},{"path":"src/automation/errors.ts","kind":"import-statement","original":"./errors.js"}],"format":"esm"},"src/automation/durable-execution.ts":{"bytes":4647,"imports":[{"path":"node:crypto","kind":"import-statement","external":true},{"path":"src/automation/evidence.ts","kind":"import-statement","original":"./evidence.js"},{"path":"src/automation/errors.ts","kind":"import-statement","original":"./errors.js"}],"format":"esm"},"src/automation/executor.ts":{"bytes":16288,"imports":[{"path":"node:crypto","kind":"import-statement","external":true},{"path":"src/automation/errors.ts","kind":"import-statement","original":"./errors.js"},{"path":"src/automation/durable-execution.ts","kind":"import-statement","original":"./durable-execution.js"},{"path":"src/automation/evidence.ts","kind":"import-statement","original":"./evidence.js"},{"path":"src/automation/operations.ts","kind":"import-statement","original":"./operations.js"},{"path":"src/automation/policy.ts","kind":"import-statement","original":"./policy.js"}],"format":"esm"},"src/automation/execution-journal.ts":{"bytes":7254,"imports":[{"path":"node:path","kind":"import-statement","external":true},{"path":"src/automation/errors.ts","kind":"import-statement","original":"./errors.js"},{"path":"node:sqlite","kind":"dynamic-import","external":true}],"format":"esm"},"src/automation/conformance.ts":{"bytes":4331,"imports":[{"path":"src/automation/errors.ts","kind":"import-statement","original":"./errors.js"},{"path":"src/automation/policy.ts","kind":"import-statement","original":"./policy.js"},{"path":"src/automation/types.ts","kind":"import-statement","original":"./types.js"}],"format":"esm"},"src/automation/http-adapter.ts":{"bytes":8862,"imports":[{"path":"src/automation/errors.ts","kind":"import-statement","original":"./errors.js"}],"format":"esm"},"src/automation/browser-control-plane-adapter.ts":{"bytes":17420,"imports":[{"path":"node:crypto","kind":"import-statement","external":true}],"format":"esm"},"src/utils/fs.ts":{"bytes":13355,"imports":[{"path":"node:fs","kind":"import-statement","external":true},{"path":"node:fs","kind":"import-statement","external":true},{"path":"node:fs/promises","kind":"import-statement","external":true},{"path":"node:path","kind":"import-statement","external":true}],"format":"esm"},"src/control-plane/lock.ts":{"bytes":2496,"imports":[{"path":"node:fs","kind":"import-statement","external":true},{"path":"node:os","kind":"import-statement","external":true},{"path":"node:path","kind":"import-statement","external":true}],"format":"esm"},"src/version.ts":{"bytes":195,"imports":[],"format":"esm"},"src/artifacts/file-repository.ts":{"bytes":16401,"imports":[{"path":"node:crypto","kind":"import-statement","external":true},{"path":"node:fs/promises","kind":"import-statement","external":true},{"path":"node:path","kind":"import-statement","external":true},{"path":"src/utils/fs.ts","kind":"import-statement","original":"../utils/fs.js"},{"path":"src/control-plane/lock.ts","kind":"import-statement","original":"../control-plane/lock.js"},{"path":"src/version.ts","kind":"import-statement","original":"../version.js"},{"path":"src/artifacts/hash.ts","kind":"import-statement","original":"./hash.js"},{"path":"src/artifacts/repository.ts","kind":"import-statement","original":"./repository.js"},{"path":"src/artifacts/types.ts","kind":"import-statement","original":"./types.js"}],"format":"esm"},"src/utils/yaml.ts":{"bytes":5506,"imports":[],"format":"esm"},"src/utils/platform.ts":{"bytes":5600,"imports":[{"path":"node:os","kind":"import-statement","external":true},{"path":"node:child_process","kind":"import-statement","external":true},{"path":"node:path","kind":"import-statement","external":true}],"format":"esm"},"src/agents/definitions.ts":{"bytes":23563,"imports":[{"path":"node:fs","kind":"import-statement","external":true},{"path":"node:path","kind":"import-statement","external":true},{"path":"src/utils/yaml.ts","kind":"import-statement","original":"../utils/yaml.js"},{"path":"src/utils/platform.ts","kind":"import-statement","original":"../utils/platform.js"}],"format":"esm"},"src/agents/profiles.ts":{"bytes":33625,"imports":[{"path":"node:crypto","kind":"import-statement","external":true},{"path":"src/agents/definitions.ts","kind":"import-statement","original":"./definitions.js"}],"format":"esm"},"src/security/capability-lease.ts":{"bytes":29318,"imports":[{"path":"src/agents/profiles.ts","kind":"import-statement","original":"../agents/profiles.js"},{"path":"src/utils/custom-names.ts","kind":"import-statement","original":"../utils/custom-names.js"}],"format":"esm"},"src/automation/tool-pack.ts":{"bytes":19206,"imports":[{"path":"node:crypto","kind":"import-statement","external":true},{"path":"src/automation/operations.ts","kind":"import-statement","original":"./operations.js"}],"format":"esm"},"src/automation/host-runtime.ts":{"bytes":30630,"imports":[{"path":"node:fs","kind":"import-statement","external":true},{"path":"node:os","kind":"import-statement","external":true},{"path":"node:path","kind":"import-statement","external":true},{"path":"src/artifacts/file-repository.ts","kind":"import-statement","original":"../artifacts/file-repository.js"},{"path":"src/security/capability-lease.ts","kind":"import-statement","original":"../security/capability-lease.js"},{"path":"src/security/secure-execution-contract.ts","kind":"import-statement","original":"../security/secure-execution-contract.js"},{"path":"src/automation/types.ts","kind":"import-statement","original":"./types.js"},{"path":"src/automation/executor.ts","kind":"import-statement","original":"./executor.js"},{"path":"src/automation/operations.ts","kind":"import-statement","original":"./operations.js"},{"path":"src/automation/tool-pack.ts","kind":"import-statement","original":"./tool-pack.js"},{"path":"src/automation/browser-control-plane-adapter.ts","kind":"import-statement","original":"./browser-control-plane-adapter.js"}],"format":"esm"},"src/automation/index.ts":{"bytes":449,"imports":[{"path":"src/automation/types.ts","kind":"import-statement","original":"./types.js"},{"path":"src/automation/operations.ts","kind":"import-statement","original":"./operations.js"},{"path":"src/automation/errors.ts","kind":"import-statement","original":"./errors.js"},{"path":"src/automation/policy.ts","kind":"import-statement","original":"./policy.js"},{"path":"src/automation/evidence.ts","kind":"import-statement","original":"./evidence.js"},{"path":"src/automation/executor.ts","kind":"import-statement","original":"./executor.js"},{"path":"src/automation/execution-journal.ts","kind":"import-statement","original":"./execution-journal.js"},{"path":"src/automation/durable-execution.ts","kind":"import-statement","original":"./durable-execution.js"},{"path":"src/automation/conformance.ts","kind":"import-statement","original":"./conformance.js"},{"path":"src/automation/http-adapter.ts","kind":"import-statement","original":"./http-adapter.js"},{"path":"src/automation/browser-control-plane-adapter.ts","kind":"import-statement","original":"./browser-control-plane-adapter.js"},{"path":"src/automation/host-runtime.ts","kind":"import-statement","original":"./host-runtime.js"},{"path":"src/automation/tool-pack.ts","kind":"import-statement","original":"./tool-pack.js"}],"format":"esm"}},"outputs":{"dist/automation/index.js":{"imports":[{"path":"node:crypto","kind":"import-statement","external":true},{"path":"node:os","kind":"import-statement","external":true},{"path":"node:fs","kind":"import-statement","external":true},{"path":"node:path","kind":"import-statement","external":true},{"path":"node:fs","kind":"import-statement","external":true},{"path":"node:path","kind":"import-statement","external":true},{"path":"node:child_process","kind":"import-statement","external":true},{"path":"node:fs","kind":"import-statement","external":true},{"path":"node:path","kind":"import-statement","external":true},{"path":"node:crypto","kind":"import-statement","external":true},{"path":"node:fs","kind":"import-statement","external":true},{"path":"node:path","kind":"import-statement","external":true},{"path":"node:crypto","kind":"import-statement","external":true},{"path":"node:fs","kind":"import-statement","external":true},{"path":"node:os","kind":"import-statement","external":true},{"path":"node:path","kind":"import-statement","external":true},{"path":"node:child_process","kind":"import-statement","external":true},{"path":"node:url","kind":"import-statement","external":true},{"path":"node:crypto","kind":"import-statement","external":true},{"path":"node:buffer","kind":"import-statement","external":true},{"path":"node:crypto","kind":"import-statement","external":true},{"path":"node:crypto","kind":"import-statement","external":true},{"path":"node:crypto","kind":"import-statement","external":true},{"path":"node:path","kind":"import-statement","external":true},{"path":"node:sqlite","kind":"dynamic-import","external":true},{"path":"node:crypto","kind":"import-statement","external":true},{"path":"node:fs","kind":"import-statement","external":true},{"path":"node:os","kind":"import-statement","external":true},{"path":"node:path","kind":"import-statement","external":true},{"path":"node:crypto","kind":"import-statement","external":true},{"path":"node:fs/promises","kind":"import-statement","external":true},{"path":"node:path","kind":"import-statement","external":true},{"path":"node:fs/promises","kind":"import-statement","external":true},{"path":"node:fs","kind":"import-statement","external":true},{"path":"node:os","kind":"import-statement","external":true},{"path":"node:path","kind":"import-statement","external":true},{"path":"node:os","kind":"import-statement","external":true},{"path":"node:crypto","kind":"import-statement","external":true}],"exports":["CliGovernedAutomationRuntime","SqliteAutomationExecutionJournal","XENO_AUTOMATION_OPERATIONS","XENO_AUTOMATION_PROTOCOL_VERSION","XENO_BROWSER_CONTROL_PLANE_OPERATIONS","XenoAutomationError","XenoBrowserControlPlaneAdapter","XenoGovernedAutomationExecutor","XenoHostGovernedAutomationRuntime","XenoLoopbackAutomationAdapter","assertRequiredXenoAutomationEvidence","assertValidXenoAutomationAdapterManifest","assertValidXenoAutomationRequest","assertXenoAutomationAdapterConformant","assertXenoAutomationAuthority","buildXenoAutomationCapabilityUse","createCliAutomationAuditSink","createCliGovernedAutomationRuntime","createXenoAutomationConformanceReport","createXenoGovernedAutomationTools","createXenoHostAutomationAuditSink","createXenoHostGovernedAutomationRuntime","describeXenoAutomationOperation","inspectCliAutomationStatus","inspectXenoHostAutomationStatus","isXenoAutomationOperation","materializeXenoAutomationEvidence","openSqliteAutomationExecutionJournal","pending","persistXenoAutomationEvidence","readCliAutomationEnvironment","readXenoHostAutomationEnvironment","renderCliAutomationStatus","renderXenoHostAutomationStatus","resolveXenoAutomationEvidencePolicy","runDurableAutomation"],"entryPoint":"src/automation/index.ts","inputs":{"src/automation/types.ts":{"bytesInOutput":8},"src/automation/index.ts":{"bytesInOutput":0},"src/automation/operations.ts":{"bytesInOutput":1656},"src/automation/errors.ts":{"bytesInOutput":129},"src/security/secure-execution-contract.ts":{"bytesInOutput":10453},"src/security/path-policy.ts":{"bytesInOutput":2570},"src/security/windows-process-containment.ts":{"bytesInOutput":47621},"src/security/linux-process-containment.ts":{"bytesInOutput":1948},"src/security/containment-certification.ts":{"bytesInOutput":6156},"src/security/mxc-containment.ts":{"bytesInOutput":6366},"src/security/process-containment.ts":{"bytesInOutput":6520},"src/automation/policy.ts":{"bytesInOutput":7893},"src/automation/evidence.ts":{"bytesInOutput":4449},"src/artifacts/types.ts":{"bytesInOutput":825},"src/artifacts/validation.ts":{"bytesInOutput":13370},"src/artifacts/hash.ts":{"bytesInOutput":126},"src/utils/custom-names.ts":{"bytesInOutput":125},"src/artifacts/repository.ts":{"bytesInOutput":13753},"src/automation/executor.ts":{"bytesInOutput":7132},"src/automation/durable-execution.ts":{"bytesInOutput":2222},"src/automation/execution-journal.ts":{"bytesInOutput":4236},"src/automation/conformance.ts":{"bytesInOutput":2199},"src/automation/http-adapter.ts":{"bytesInOutput":4320},"src/automation/browser-control-plane-adapter.ts":{"bytesInOutput":9666},"src/automation/host-runtime.ts":{"bytesInOutput":12795},"src/artifacts/file-repository.ts":{"bytesInOutput":6720},"src/utils/fs.ts":{"bytesInOutput":314},"src/control-plane/lock.ts":{"bytesInOutput":1054},"src/version.ts":{"bytesInOutput":17},"src/utils/platform.ts":{"bytesInOutput":96},"src/agents/definitions.ts":{"bytesInOutput":20},"src/agents/profiles.ts":{"bytesInOutput":8624},"src/security/capability-lease.ts":{"bytesInOutput":14560},"src/automation/tool-pack.ts":{"bytesInOutput":10038}},"bytes":209333}}}
1
+ {"inputs":{"src/automation/types.ts":{"bytes":7650,"imports":[],"format":"esm"},"src/automation/operations.ts":{"bytes":3367,"imports":[],"format":"esm"},"src/automation/errors.ts":{"bytes":899,"imports":[],"format":"esm"},"src/security/path-policy.ts":{"bytes":5541,"imports":[{"path":"node:fs","kind":"import-statement","external":true},{"path":"node:path","kind":"import-statement","external":true}],"format":"esm"},"src/security/windows-process-containment.ts":{"bytes":56741,"imports":[{"path":"node:fs","kind":"import-statement","external":true},{"path":"node:child_process","kind":"import-statement","external":true},{"path":"node:crypto","kind":"import-statement","external":true},{"path":"node:os","kind":"import-statement","external":true},{"path":"node:path","kind":"import-statement","external":true}],"format":"esm"},"src/security/linux-process-containment.ts":{"bytes":5665,"imports":[{"path":"node:child_process","kind":"import-statement","external":true},{"path":"node:fs","kind":"import-statement","external":true},{"path":"node:path","kind":"import-statement","external":true}],"format":"esm"},"src/security/containment-certification.ts":{"bytes":13312,"imports":[{"path":"node:crypto","kind":"import-statement","external":true},{"path":"node:fs","kind":"import-statement","external":true},{"path":"node:path","kind":"import-statement","external":true}],"format":"esm"},"src/security/environment-policy.ts":{"bytes":1195,"imports":[],"format":"esm"},"src/security/mxc-containment.ts":{"bytes":28272,"imports":[{"path":"node:crypto","kind":"import-statement","external":true},{"path":"node:fs","kind":"import-statement","external":true},{"path":"node:os","kind":"import-statement","external":true},{"path":"node:path","kind":"import-statement","external":true},{"path":"node:child_process","kind":"import-statement","external":true},{"path":"node:url","kind":"import-statement","external":true},{"path":"src/security/environment-policy.ts","kind":"import-statement","original":"./environment-policy.js"},{"path":"src/security/path-policy.ts","kind":"import-statement","original":"./path-policy.js"}],"format":"esm"},"src/security/process-containment.ts":{"bytes":17360,"imports":[{"path":"src/security/windows-process-containment.ts","kind":"import-statement","original":"./windows-process-containment.js"},{"path":"src/security/linux-process-containment.ts","kind":"import-statement","original":"./linux-process-containment.js"},{"path":"src/security/path-policy.ts","kind":"import-statement","original":"./path-policy.js"},{"path":"src/security/containment-certification.ts","kind":"import-statement","original":"./containment-certification.js"},{"path":"src/security/mxc-containment.ts","kind":"import-statement","original":"./mxc-containment.js"}],"format":"esm"},"src/security/secure-execution-contract.ts":{"bytes":24510,"imports":[{"path":"node:crypto","kind":"import-statement","external":true},{"path":"node:os","kind":"import-statement","external":true},{"path":"src/security/path-policy.ts","kind":"import-statement","original":"./path-policy.js"},{"path":"src/security/process-containment.ts","kind":"import-statement","original":"./process-containment.js"}],"format":"esm"},"src/automation/policy.ts":{"bytes":16203,"imports":[{"path":"src/security/secure-execution-contract.ts","kind":"import-statement","original":"../security/secure-execution-contract.js"},{"path":"src/automation/errors.ts","kind":"import-statement","original":"./errors.js"},{"path":"src/automation/operations.ts","kind":"import-statement","original":"./operations.js"},{"path":"src/automation/types.ts","kind":"import-statement","original":"./types.js"}],"format":"esm"},"src/artifacts/types.ts":{"bytes":11227,"imports":[],"format":"esm"},"src/artifacts/hash.ts":{"bytes":1489,"imports":[{"path":"node:crypto","kind":"import-statement","external":true}],"format":"esm"},"src/utils/custom-names.ts":{"bytes":2210,"imports":[],"format":"esm"},"src/artifacts/validation.ts":{"bytes":25271,"imports":[{"path":"src/artifacts/types.ts","kind":"import-statement","original":"./types.js"},{"path":"node:buffer","kind":"import-statement","external":true},{"path":"src/artifacts/hash.ts","kind":"import-statement","original":"./hash.js"},{"path":"src/utils/custom-names.ts","kind":"import-statement","original":"../utils/custom-names.js"},{"path":"src/artifacts/types.ts","kind":"import-statement","original":"./types.js"}],"format":"esm"},"src/artifacts/repository.ts":{"bytes":29289,"imports":[{"path":"src/artifacts/types.ts","kind":"import-statement","original":"./types.js"},{"path":"src/artifacts/validation.ts","kind":"import-statement","original":"./validation.js"}],"format":"esm"},"src/automation/evidence.ts":{"bytes":8618,"imports":[{"path":"node:crypto","kind":"import-statement","external":true},{"path":"src/artifacts/repository.ts","kind":"import-statement","original":"../artifacts/repository.js"},{"path":"src/artifacts/hash.ts","kind":"import-statement","original":"../artifacts/hash.js"},{"path":"src/artifacts/types.ts","kind":"import-statement","original":"../artifacts/types.js"},{"path":"src/automation/errors.ts","kind":"import-statement","original":"./errors.js"}],"format":"esm"},"src/automation/durable-execution.ts":{"bytes":4647,"imports":[{"path":"node:crypto","kind":"import-statement","external":true},{"path":"src/automation/evidence.ts","kind":"import-statement","original":"./evidence.js"},{"path":"src/automation/errors.ts","kind":"import-statement","original":"./errors.js"}],"format":"esm"},"src/automation/executor.ts":{"bytes":19396,"imports":[{"path":"node:crypto","kind":"import-statement","external":true},{"path":"src/automation/errors.ts","kind":"import-statement","original":"./errors.js"},{"path":"src/automation/durable-execution.ts","kind":"import-statement","original":"./durable-execution.js"},{"path":"src/automation/evidence.ts","kind":"import-statement","original":"./evidence.js"},{"path":"src/automation/operations.ts","kind":"import-statement","original":"./operations.js"},{"path":"src/automation/policy.ts","kind":"import-statement","original":"./policy.js"}],"format":"esm"},"src/automation/execution-journal.ts":{"bytes":7254,"imports":[{"path":"node:path","kind":"import-statement","external":true},{"path":"src/automation/errors.ts","kind":"import-statement","original":"./errors.js"},{"path":"node:sqlite","kind":"dynamic-import","external":true}],"format":"esm"},"src/automation/conformance.ts":{"bytes":4331,"imports":[{"path":"src/automation/errors.ts","kind":"import-statement","original":"./errors.js"},{"path":"src/automation/policy.ts","kind":"import-statement","original":"./policy.js"},{"path":"src/automation/types.ts","kind":"import-statement","original":"./types.js"}],"format":"esm"},"src/automation/http-adapter.ts":{"bytes":13925,"imports":[{"path":"src/automation/errors.ts","kind":"import-statement","original":"./errors.js"},{"path":"src/automation/policy.ts","kind":"import-statement","original":"./policy.js"}],"format":"esm"},"src/automation/browser-control-plane-adapter.ts":{"bytes":2368,"imports":[{"path":"src/automation/errors.ts","kind":"import-statement","original":"./errors.js"},{"path":"src/automation/http-adapter.ts","kind":"import-statement","original":"./http-adapter.js"},{"path":"src/automation/policy.ts","kind":"import-statement","original":"./policy.js"}],"format":"esm"},"src/utils/fs.ts":{"bytes":13746,"imports":[{"path":"node:fs","kind":"import-statement","external":true},{"path":"node:fs","kind":"import-statement","external":true},{"path":"node:fs/promises","kind":"import-statement","external":true},{"path":"node:path","kind":"import-statement","external":true}],"format":"esm"},"src/control-plane/lock.ts":{"bytes":2496,"imports":[{"path":"node:fs","kind":"import-statement","external":true},{"path":"node:os","kind":"import-statement","external":true},{"path":"node:path","kind":"import-statement","external":true}],"format":"esm"},"src/version.ts":{"bytes":195,"imports":[],"format":"esm"},"src/artifacts/file-repository.ts":{"bytes":16401,"imports":[{"path":"node:crypto","kind":"import-statement","external":true},{"path":"node:fs/promises","kind":"import-statement","external":true},{"path":"node:path","kind":"import-statement","external":true},{"path":"src/utils/fs.ts","kind":"import-statement","original":"../utils/fs.js"},{"path":"src/control-plane/lock.ts","kind":"import-statement","original":"../control-plane/lock.js"},{"path":"src/version.ts","kind":"import-statement","original":"../version.js"},{"path":"src/artifacts/hash.ts","kind":"import-statement","original":"./hash.js"},{"path":"src/artifacts/repository.ts","kind":"import-statement","original":"./repository.js"},{"path":"src/artifacts/types.ts","kind":"import-statement","original":"./types.js"}],"format":"esm"},"src/utils/yaml.ts":{"bytes":5506,"imports":[],"format":"esm"},"src/runtime/process-tree-kill.ts":{"bytes":9124,"imports":[{"path":"node:child_process","kind":"import-statement","external":true}],"format":"esm"},"src/utils/platform.ts":{"bytes":9633,"imports":[{"path":"node:os","kind":"import-statement","external":true},{"path":"node:child_process","kind":"import-statement","external":true},{"path":"node:fs","kind":"import-statement","external":true},{"path":"node:path","kind":"import-statement","external":true},{"path":"src/runtime/process-tree-kill.ts","kind":"import-statement","original":"../runtime/process-tree-kill.js"}],"format":"esm"},"src/agents/definitions.ts":{"bytes":25020,"imports":[{"path":"node:fs","kind":"import-statement","external":true},{"path":"node:path","kind":"import-statement","external":true},{"path":"src/utils/yaml.ts","kind":"import-statement","original":"../utils/yaml.js"},{"path":"src/utils/platform.ts","kind":"import-statement","original":"../utils/platform.js"}],"format":"esm"},"src/agents/profiles.ts":{"bytes":33891,"imports":[{"path":"node:crypto","kind":"import-statement","external":true},{"path":"src/agents/definitions.ts","kind":"import-statement","original":"./definitions.js"}],"format":"esm"},"src/security/capability-lease.ts":{"bytes":29318,"imports":[{"path":"src/agents/profiles.ts","kind":"import-statement","original":"../agents/profiles.js"},{"path":"src/utils/custom-names.ts","kind":"import-statement","original":"../utils/custom-names.js"}],"format":"esm"},"src/automation/tool-pack.ts":{"bytes":19556,"imports":[{"path":"node:crypto","kind":"import-statement","external":true},{"path":"src/automation/operations.ts","kind":"import-statement","original":"./operations.js"}],"format":"esm"},"src/security/tool-authorization.ts":{"bytes":2746,"imports":[{"path":"node:crypto","kind":"import-statement","external":true}],"format":"esm"},"src/automation/host-runtime.ts":{"bytes":41060,"imports":[{"path":"node:fs","kind":"import-statement","external":true},{"path":"node:crypto","kind":"import-statement","external":true},{"path":"node:os","kind":"import-statement","external":true},{"path":"node:path","kind":"import-statement","external":true},{"path":"src/artifacts/file-repository.ts","kind":"import-statement","original":"../artifacts/file-repository.js"},{"path":"src/security/capability-lease.ts","kind":"import-statement","original":"../security/capability-lease.js"},{"path":"src/security/secure-execution-contract.ts","kind":"import-statement","original":"../security/secure-execution-contract.js"},{"path":"src/automation/types.ts","kind":"import-statement","original":"./types.js"},{"path":"src/automation/executor.ts","kind":"import-statement","original":"./executor.js"},{"path":"src/automation/operations.ts","kind":"import-statement","original":"./operations.js"},{"path":"src/automation/tool-pack.ts","kind":"import-statement","original":"./tool-pack.js"},{"path":"src/automation/browser-control-plane-adapter.ts","kind":"import-statement","original":"./browser-control-plane-adapter.js"},{"path":"src/automation/policy.ts","kind":"import-statement","original":"./policy.js"},{"path":"src/security/tool-authorization.ts","kind":"import-statement","original":"../security/tool-authorization.js"}],"format":"esm"},"src/automation/index.ts":{"bytes":449,"imports":[{"path":"src/automation/types.ts","kind":"import-statement","original":"./types.js"},{"path":"src/automation/operations.ts","kind":"import-statement","original":"./operations.js"},{"path":"src/automation/errors.ts","kind":"import-statement","original":"./errors.js"},{"path":"src/automation/policy.ts","kind":"import-statement","original":"./policy.js"},{"path":"src/automation/evidence.ts","kind":"import-statement","original":"./evidence.js"},{"path":"src/automation/executor.ts","kind":"import-statement","original":"./executor.js"},{"path":"src/automation/execution-journal.ts","kind":"import-statement","original":"./execution-journal.js"},{"path":"src/automation/durable-execution.ts","kind":"import-statement","original":"./durable-execution.js"},{"path":"src/automation/conformance.ts","kind":"import-statement","original":"./conformance.js"},{"path":"src/automation/http-adapter.ts","kind":"import-statement","original":"./http-adapter.js"},{"path":"src/automation/browser-control-plane-adapter.ts","kind":"import-statement","original":"./browser-control-plane-adapter.js"},{"path":"src/automation/host-runtime.ts","kind":"import-statement","original":"./host-runtime.js"},{"path":"src/automation/tool-pack.ts","kind":"import-statement","original":"./tool-pack.js"}],"format":"esm"}},"outputs":{"dist/automation/index.js":{"imports":[{"path":"node:crypto","kind":"import-statement","external":true},{"path":"node:os","kind":"import-statement","external":true},{"path":"node:fs","kind":"import-statement","external":true},{"path":"node:path","kind":"import-statement","external":true},{"path":"node:fs","kind":"import-statement","external":true},{"path":"node:path","kind":"import-statement","external":true},{"path":"node:child_process","kind":"import-statement","external":true},{"path":"node:fs","kind":"import-statement","external":true},{"path":"node:path","kind":"import-statement","external":true},{"path":"node:crypto","kind":"import-statement","external":true},{"path":"node:fs","kind":"import-statement","external":true},{"path":"node:path","kind":"import-statement","external":true},{"path":"node:crypto","kind":"import-statement","external":true},{"path":"node:fs","kind":"import-statement","external":true},{"path":"node:os","kind":"import-statement","external":true},{"path":"node:path","kind":"import-statement","external":true},{"path":"node:child_process","kind":"import-statement","external":true},{"path":"node:url","kind":"import-statement","external":true},{"path":"node:crypto","kind":"import-statement","external":true},{"path":"node:buffer","kind":"import-statement","external":true},{"path":"node:crypto","kind":"import-statement","external":true},{"path":"node:crypto","kind":"import-statement","external":true},{"path":"node:crypto","kind":"import-statement","external":true},{"path":"node:path","kind":"import-statement","external":true},{"path":"node:sqlite","kind":"dynamic-import","external":true},{"path":"node:fs","kind":"import-statement","external":true},{"path":"node:crypto","kind":"import-statement","external":true},{"path":"node:os","kind":"import-statement","external":true},{"path":"node:path","kind":"import-statement","external":true},{"path":"node:crypto","kind":"import-statement","external":true},{"path":"node:fs/promises","kind":"import-statement","external":true},{"path":"node:path","kind":"import-statement","external":true},{"path":"node:fs/promises","kind":"import-statement","external":true},{"path":"node:fs","kind":"import-statement","external":true},{"path":"node:os","kind":"import-statement","external":true},{"path":"node:path","kind":"import-statement","external":true},{"path":"node:os","kind":"import-statement","external":true},{"path":"node:crypto","kind":"import-statement","external":true},{"path":"node:crypto","kind":"import-statement","external":true}],"exports":["CliGovernedAutomationRuntime","SqliteAutomationExecutionJournal","XENO_AUTOMATION_OPERATIONS","XENO_AUTOMATION_PROTOCOL_VERSION","XENO_BROWSER_CONTROL_PLANE_OPERATIONS","XenoAutomationError","XenoBrowserControlPlaneAdapter","XenoGovernedAutomationExecutor","XenoHostGovernedAutomationRuntime","XenoLoopbackAutomationAdapter","assertRequiredXenoAutomationEvidence","assertValidXenoAutomationAdapterManifest","assertValidXenoAutomationRequest","assertXenoAutomationAdapterConformant","assertXenoAutomationAdapterRequirements","assertXenoAutomationAuthority","buildXenoAutomationCapabilityUse","createCliAutomationAuditSink","createCliGovernedAutomationRuntime","createXenoAutomationConformanceReport","createXenoGovernedAutomationTools","createXenoHostAutomationAuditSink","createXenoHostGovernedAutomationRuntime","describeXenoAutomationOperation","inspectCliAutomationStatus","inspectXenoHostAutomationStatus","isXenoAutomationOperation","materializeXenoAutomationEvidence","openSqliteAutomationExecutionJournal","pending","persistXenoAutomationEvidence","readCliAutomationEnvironment","readXenoHostAutomationEnvironment","renderCliAutomationStatus","renderXenoHostAutomationStatus","resolveXenoAutomationEvidencePolicy","runDurableAutomation"],"entryPoint":"src/automation/index.ts","inputs":{"src/automation/types.ts":{"bytesInOutput":8},"src/automation/index.ts":{"bytesInOutput":0},"src/automation/operations.ts":{"bytesInOutput":1656},"src/automation/errors.ts":{"bytesInOutput":129},"src/security/secure-execution-contract.ts":{"bytesInOutput":10448},"src/security/path-policy.ts":{"bytesInOutput":2570},"src/security/windows-process-containment.ts":{"bytesInOutput":48472},"src/security/linux-process-containment.ts":{"bytesInOutput":1948},"src/security/containment-certification.ts":{"bytesInOutput":6150},"src/security/mxc-containment.ts":{"bytesInOutput":6366},"src/security/process-containment.ts":{"bytesInOutput":6526},"src/automation/policy.ts":{"bytesInOutput":8211},"src/automation/evidence.ts":{"bytesInOutput":4451},"src/artifacts/types.ts":{"bytesInOutput":825},"src/artifacts/validation.ts":{"bytesInOutput":13379},"src/artifacts/hash.ts":{"bytesInOutput":127},"src/utils/custom-names.ts":{"bytesInOutput":125},"src/artifacts/repository.ts":{"bytesInOutput":13761},"src/automation/executor.ts":{"bytesInOutput":8388},"src/automation/durable-execution.ts":{"bytesInOutput":2222},"src/automation/execution-journal.ts":{"bytesInOutput":4236},"src/automation/conformance.ts":{"bytesInOutput":2198},"src/automation/http-adapter.ts":{"bytesInOutput":7343},"src/automation/browser-control-plane-adapter.ts":{"bytesInOutput":861},"src/automation/host-runtime.ts":{"bytesInOutput":17599},"src/artifacts/file-repository.ts":{"bytesInOutput":6721},"src/utils/fs.ts":{"bytesInOutput":314},"src/control-plane/lock.ts":{"bytesInOutput":1054},"src/version.ts":{"bytesInOutput":17},"src/utils/platform.ts":{"bytesInOutput":96},"src/agents/definitions.ts":{"bytesInOutput":20},"src/agents/profiles.ts":{"bytesInOutput":8624},"src/security/capability-lease.ts":{"bytesInOutput":14560},"src/automation/tool-pack.ts":{"bytesInOutput":10303},"src/security/tool-authorization.ts":{"bytesInOutput":1119}},"bytes":212223}}}
@@ -1,8 +1,8 @@
1
- "use strict";var ne=Object.defineProperty;var qe=Object.getOwnPropertyDescriptor;var Fe=Object.getOwnPropertyNames;var je=Object.prototype.hasOwnProperty;var He=(s,e)=>{for(var t in e)ne(s,t,{get:e[t],enumerable:!0})},Je=(s,e,t,r)=>{if(e&&typeof e=="object"||typeof e=="function")for(let n of Fe(e))!je.call(s,n)&&n!==t&&ne(s,n,{get:()=>e[n],enumerable:!(r=qe(e,n))||r.enumerable});return s};var Ke=s=>Je(ne({},"__esModule",{value:!0}),s);var vt={};He(vt,{AGENT_DAEMON_PROTOCOL_VERSION:()=>O,AgentDaemonClient:()=>le,AgentDaemonServer:()=>de,AgentEventStore:()=>W,AgentRunController:()=>ce,AgentRunStore:()=>L,MonitorManager:()=>fe,MonitorStopTool:()=>we,MonitorTool:()=>he,OtelExporter:()=>Re,PEER_MESSAGE_DEFAULT_TTL_MS:()=>Ue,PEER_PRESENCE_TTL_MS:()=>Ne,PEER_SCHEMA_VERSION:()=>P,PEER_TASK_TERMINAL_STATUSES:()=>Ve,PeerMessagingStore:()=>ve,UsageAccumulator:()=>Q,UsageLedger:()=>ke,WorkflowPlanner:()=>$,WorkflowRuntime:()=>me,WorkflowStore:()=>B,acquireControlPlaneLock:()=>M,createAgentRunId:()=>Te,defaultPeerDirectory:()=>Le,getAgentRunDir:()=>dt,getAgentRunStoreDir:()=>ct,isPeerTaskTerminal:()=>j,movesTrustUpward:()=>We,peerShortId:()=>ye,renderPeerLabel:()=>ee,resolvePeerTarget:()=>ht,toPeerPosture:()=>ft});module.exports=Ke(vt);var De=require("node:crypto"),f=require("node:fs"),m=require("node:path");var V="0.10.36";var A=require("node:fs"),se=require("node:os"),Ae=require("node:path");function ze(){return new Date().toISOString()}function Be(){return new Date(Date.now()-Math.floor(process.uptime()*1e3)).toISOString()}function Se(s){try{return JSON.parse((0,A.readFileSync)(s,"utf8"))}catch{return null}}function Qe(s){if(!s||s<=0)return!1;try{return process.kill(s,0),!0}catch{return!1}}function Ge(s){return s.hostname!==(0,se.hostname)()?!0:Qe(s.pid)}function Pe(s,e){(0,A.mkdirSync)((0,Ae.dirname)(s),{recursive:!0}),(0,A.writeFileSync)(s,JSON.stringify(e,null,2)+`
2
- `,{encoding:"utf8",flag:"wx"})}function Xe(s,e){let t=Se(s);t?.pid!==e.pid||t.hostname!==e.hostname||(0,A.rmSync)(s,{force:!0})}function M(s,e,t){let r=ze(),n={schemaVersion:1,name:e,pid:process.pid,hostname:(0,se.hostname)(),processStartedAt:Be(),version:t,acquiredAt:r,updatedAt:r};try{Pe(s,n)}catch(o){if(o.code!=="EEXIST")throw o;let a=Se(s);if(a&&Ge(a))throw new Error(`${e} is already locked by PID ${a.pid} on ${a.hostname}.`);(0,A.rmSync)(s,{force:!0}),Pe(s,n)}return{record:n,release:()=>{Xe(s,n)}}}var Ee=require("node:crypto"),S=require("node:fs"),C=require("node:path");function xe(s){return(0,C.basename)(s).replace(/[^A-Za-z0-9_.-]/g,"_").slice(0,96)}function Ie(s){return(0,S.existsSync)(s)?(0,S.readFileSync)(s,"utf8").split(/\r?\n/).map(e=>e.trim()).filter(Boolean).map(e=>{try{return JSON.parse(e)}catch{return null}}).filter(e=>e!==null):[]}var W=class{constructor(e){this.runsDir=e;(0,S.mkdirSync)(this.runsDir,{recursive:!0})}runsDir;pathFor(e){return(0,C.join)(this.runsDir,xe(e),"events.jsonl")}append(e,t,r={},n=new Date().toISOString()){let o=this.pathFor(e);(0,S.mkdirSync)((0,C.dirname)(o),{recursive:!0});let i=M(`${o}.lock`,`events:${xe(e)}`,V);try{let a=Ie(o).reduce((x,p,d)=>Math.max(x,p.sequence??d),-1)+1,c={schemaVersion:1,eventId:`event_${(0,Ee.randomUUID)()}`,sequence:a,runId:e,type:t,timestamp:n,payload:r};return(0,S.appendFileSync)(o,`${JSON.stringify(c)}
3
- `,"utf8"),c}finally{i.release()}}read(e){return Ie(this.pathFor(e))}tail(e,t=100){let r=Math.max(0,Math.min(1e4,Math.trunc(t)));return r===0?[]:this.read(e).slice(-r)}};var _=require("node:os");var oe=require("node:path"),Et=(0,_.platform)();var bt=(0,_.release)(),Dt=(0,_.homedir)();function I(){let s=process.env.XENO_AGENT_HOME?.trim();return s?(0,oe.resolve)(s):(0,oe.resolve)((0,_.homedir)(),".xeno-agent")}var Ze=1,Ye=(0,m.join)(I(),"daemon"),ae=(0,m.join)(Ye,"runs");function k(){return new Date().toISOString()}function et(s=new Date){return s.toISOString().replace(/[^0-9]/g,"").slice(0,14)}function ie(s){return s.replace(/[^A-Za-z0-9_.-]/g,"_").slice(0,80)}function ue(s){return(0,m.resolve)(s)}function J(s){return ue(s).toLowerCase()}function be(s,e){let t=J(s),r=J(e);return t===r||t.startsWith(`${r}\\`)||t.startsWith(`${r}/`)}function tt(s,e){return!!(J(s.cwd)===J(e)||s.git?.root&&be(e,s.git.root)||s.git?.worktree&&be(e,s.git.worktree))}function rt(s){return ie(Buffer.from(ue(s)).toString("base64url"))}function nt(){return{input:0,output:0,total:0}}function H(s){try{return JSON.parse((0,f.readFileSync)(s,"utf8"))}catch{return null}}function st(s){return s instanceof Error&&/\balready locked by PID\b/.test(s.message)}function ot(s,e){(0,f.mkdirSync)((0,m.dirname)(s),{recursive:!0});let t=`${s}.${process.pid}.${Date.now()}.tmp`;(0,f.writeFileSync)(t,JSON.stringify(e,null,2)+`
4
- `,"utf8"),(0,f.renameSync)(t,s)}function it(s){if(!s||s<=0)return!1;try{return process.kill(s,0),!0}catch{return!1}}function at(s){return s==="completed"||s==="failed"||s==="cancelled"||s==="interrupted"}function ut(s,e){return s.pinned!==e.pinned?s.pinned?-1:1:Date.parse(e.updatedAt)-Date.parse(s.updatedAt)}function ct(){return ae}function dt(s){return(0,m.join)(ae,s)}function Te(s=new Date){return`run_${et(s)}_${(0,De.randomUUID)().slice(0,8)}`}var L=class{constructor(e=ae){this.runsDir=e;(0,f.mkdirSync)(this.runsDir,{recursive:!0}),this.eventStore=new W(this.runsDir)}runsDir;eventStore;create(e){let t=Te(),r=(0,m.join)(this.runsDir,t);(0,f.mkdirSync)(r,{recursive:!0});let n=k(),o=(0,m.join)(r,"events.jsonl"),i={schemaVersion:Ze,runId:t,sessionId:t,rootRunId:t,cwd:ue(e.cwd),workspaceId:rt(e.cwd),prompt:e.prompt,...e.title?{title:e.title}:{},status:"starting",model:e.model,...e.effort?{effort:e.effort}:{},...e.agent?{agent:e.agent}:{},...e.git?{git:e.git}:{},permissionMode:e.permissionMode,...e.cliVersion?{createdByCliVersion:e.cliVersion}:{},createdBySdkVersion:e.sdkVersion??V,createdAt:n,updatedAt:n,lastActivityAt:n,pinned:!!e.pinned,attachedClients:0,...e.cliVersion?{cliVersion:e.cliVersion}:{},...e.sdkVersion?{sdkVersion:e.sdkVersion}:{},stdoutPath:(0,m.join)(r,"stdout.log"),stderrPath:(0,m.join)(r,"stderr.log"),eventsPath:o,usage:nt(),children:[],tags:[]};return(0,f.writeFileSync)(i.stdoutPath,"","utf8"),(0,f.writeFileSync)(i.stderrPath,"","utf8"),(0,f.writeFileSync)(i.eventsPath,"","utf8"),this.write(i),this.appendEvent(t,"run_created",{cwd:i.cwd,model:i.model,...i.agent?{agent:i.agent}:{},...i.git?{git:i.git}:{},permissionMode:i.permissionMode,pinned:i.pinned}),i}get(e){let t=H(this.recordPath(e));return t?this.refreshRecordStatus(t):null}list(e={}){if(!(0,f.existsSync)(this.runsDir))return[];let t=(0,f.readdirSync)(this.runsDir,{withFileTypes:!0}).filter(r=>r.isDirectory()).map(r=>{try{return this.get(r.name)}catch(n){if(st(n))return H(this.recordPath(r.name));throw n}}).filter(r=>r!==null).filter(r=>e.all||!e.cwd||tt(r,e.cwd)).filter(r=>!e.status||e.status.includes(r.status)).sort(ut);return typeof e.limit=="number"&&e.limit>0?t.slice(0,e.limit):t}markSpawned(e,t,r){return this.update(e,n=>({...n,status:"running",workerPid:t,...r?{workerVersion:r}:{},startedAt:n.startedAt??k(),lastActivityAt:k()}))}markStarted(e,t){return this.update(e,r=>({...r,status:"running",workerPid:t.pid,...t.workerVersion?{workerVersion:t.workerVersion}:{},...t.model?{model:t.model}:{},...t.effort?{effort:t.effort}:{},startedAt:r.startedAt??k(),lastActivityAt:k()}))}markCompleted(e,t){return this.update(e,r=>({...r,status:t.status,...t.statusReason?{statusReason:t.statusReason}:{},exitCode:t.exitCode??null,usage:t.usage??r.usage,endedAt:k(),lastActivityAt:k()}))}markCancelled(e,t){return this.update(e,r=>({...r,status:"cancelled",statusReason:t,endedAt:k(),lastActivityAt:k()}))}markPaused(e,t="Paused by user."){let r=this.update(e,n=>({...n,status:"paused",statusReason:t,lastActivityAt:k()}));return r&&this.appendEvent(e,"run_paused",{reason:t}),r}markResumed(e,t="Resumed by user."){let r=this.update(e,n=>{let o={...n,status:"running",statusReason:t,lastActivityAt:k()};return delete o.endedAt,delete o.exitCode,o});return r&&this.appendEvent(e,"run_resumed",{reason:t}),r}setPinned(e,t){let r=this.update(e,n=>({...n,pinned:t,lastActivityAt:k()}));return r&&this.appendEvent(e,t?"run_pinned":"run_unpinned",{pinned:t}),r}appendEvent(e,t,r={}){let n=H(this.recordPath(e)),o=this.eventStore.append(e,t,r);n&&this.update(e,i=>({...i,lastActivityAt:o.timestamp}))}readEvents(e){return this.get(e)?this.eventStore.read(e):[]}delete(e){(0,f.rmSync)((0,m.join)(this.runsDir,e),{recursive:!0,force:!0})}refreshRecordStatus(e){if(at(e.status))return e;if(e.workerPid&&!it(e.workerPid)){let t={...e,status:"failed",statusReason:"Worker process is no longer running and did not record a terminal status.",endedAt:e.endedAt??k(),updatedAt:k()};return this.write(t),t}return e}update(e,t){let r=H(this.recordPath(e));if(!r)return null;let n=t(r);return n.updatedAt=k(),this.write(n),n}write(e){let t=M((0,m.join)(this.runDir(e.runId),"run.lock"),`run:${e.runId}`,V);try{ot(this.recordPath(e.runId),e)}finally{t.release()}}recordPath(e){return(0,m.join)(this.runsDir,ie((0,m.basename)(e)),"run.json")}runDir(e){return(0,m.join)(this.runsDir,ie((0,m.basename)(e)))}};function Me(s){return s==="completed"||s==="failed"||s==="cancelled"||s==="interrupted"}var ce=class{constructor(e={}){this.options=e;this.store=e.store??new L}options;store;create(e){return this.store.create(e)}async start(e){let t=this.create(e);if(!this.options.spawn)return t;try{let r=await this.options.spawn(t),n=this.store.markSpawned(t.runId,r.pid,r.workerVersion);if(!n)throw new Error(`Run disappeared during spawn: ${t.runId}`);return this.store.appendEvent(t.runId,"run_started",{pid:r.pid}),n}catch(r){let n=r instanceof Error?r.message:String(r);throw this.store.markCompleted(t.runId,{status:"failed",statusReason:n,exitCode:null}),this.store.appendEvent(t.runId,"run_start_failed",{reason:n}),r}}get(e){return this.store.get(e)}list(e={}){return this.store.list(e)}events(e,t){let r=this.store.readEvents(e);return t===void 0?r:r.slice(-Math.max(0,Math.trunc(t)))}async stop(e,t="Stopped by user."){let r=this.store.get(e);if(!r||Me(r.status))return r;await this.options.stop?.(r,t);let n=this.store.markCancelled(e,t);return n&&this.store.appendEvent(e,"run_cancelled",{reason:t}),n}async pause(e,t="Paused by user."){let r=this.store.get(e);return!r||Me(r.status)||r.status==="paused"?r:(await this.options.pause?.(r,t),this.store.markPaused(e,t))}async resume(e,t="Resumed by user."){let r=this.store.get(e);return!r||r.status!=="paused"?r:(await this.options.resume?.(r,t),this.store.markResumed(e,t))}complete(e,t,r={}){let n=this.store.markCompleted(e,{status:t,...r.reason?{statusReason:r.reason}:{},...r.exitCode!==void 0?{exitCode:r.exitCode}:{},...r.usage?{usage:r.usage}:{}});return n&&this.store.appendEvent(e,`run_${t}`,{...r.reason?{reason:r.reason}:{}}),n}};var K=require("node:crypto"),O=1;function lt(s,e){if(!s)return!1;let t=Buffer.from(s),r=Buffer.from(e);return t.length===r.length&&(0,K.timingSafeEqual)(t,r)}var de=class{constructor(e={}){this.options=e}options;handlers=new Map;register(e,t){let r=e.trim();if(!r)throw new Error("Daemon method name cannot be empty.");if(this.handlers.has(r))throw new Error(`Daemon method already registered: ${r}`);return this.handlers.set(r,t),this}registerController(e){return this.register("runs.start",t=>e.start(t)).register("runs.get",t=>e.get(t.runId)).register("runs.list",t=>e.list(t??{})).register("runs.events",t=>{let r=t;return e.events(r.runId,r.limit)}).register("runs.stop",t=>{let r=t;return e.stop(r.runId,r.reason)}).register("runs.pause",t=>{let r=t;return e.pause(r.runId,r.reason)}).register("runs.resume",t=>{let r=t;return e.resume(r.runId,r.reason)})}async handle(e){if(e.protocolVersion!==O)return this.error(e.id,"PROTOCOL_MISMATCH",`Unsupported protocol version: ${e.protocolVersion}`);if(this.options.authToken&&!lt(e.authToken,this.options.authToken))return this.error(e.id,"UNAUTHORIZED","Daemon authentication failed.");let t=this.handlers.get(e.method);if(!t)return this.error(e.id,"METHOD_NOT_FOUND",`Unknown daemon method: ${e.method}`);try{return{protocolVersion:O,id:e.id,result:await t(e.params,e)}}catch(r){return this.error(e.id,"INTERNAL_ERROR",r instanceof Error?r.message:String(r))}}error(e,t,r){return{protocolVersion:O,id:e,error:{code:t,message:r}}}},le=class{constructor(e,t={}){this.transport=e;this.options=t}transport;options;async request(e,t){let r={protocolVersion:O,id:`request_${(0,K.randomUUID)()}`,method:e,params:t,...this.options.authToken?{authToken:this.options.authToken}:{}},n=await this.transport(r);if(n.protocolVersion!==O||n.id!==r.id)throw new Error("Invalid daemon response identity.");if("error"in n){let o=new Error(n.error.message);throw o.code=n.error.code,o}return n.result}};var pe=require("node:crypto"),h=require("node:fs"),v=require("node:path");function z(s){return(0,v.basename)(s).replace(/[^A-Za-z0-9_.-]/g,"_").slice(0,96)}function ge(s){try{return JSON.parse((0,h.readFileSync)(s,"utf8"))}catch{return null}}function _e(s,e){(0,h.mkdirSync)((0,v.dirname)(s),{recursive:!0});let t=`${s}.${process.pid}.${Date.now()}.tmp`;(0,h.writeFileSync)(t,`${JSON.stringify(e,null,2)}
5
- `,"utf8"),(0,h.renameSync)(t,s)}var $=class{plan(e){if(e.schemaVersion!==1)throw new Error("Unsupported workflow schema version.");if(!e.id.trim()||!e.name.trim())throw new Error("Workflow id and name are required.");let t=new Map;for(let i of e.nodes){if(!i.id.trim())throw new Error("Workflow node id cannot be empty.");if(t.has(i.id))throw new Error(`Duplicate workflow node: ${i.id}`);t.set(i.id,i)}for(let i of e.nodes)for(let a of i.dependsOn??[]){if(!t.has(a))throw new Error(`Workflow node ${i.id} depends on unknown node ${a}.`);if(a===i.id)throw new Error(`Workflow node ${i.id} cannot depend on itself.`)}let r=new Set(t.keys()),n=new Set,o=[];for(;r.size>0;){let i=[...r].filter(a=>(t.get(a)?.dependsOn??[]).every(c=>n.has(c))).sort();if(i.length===0)throw new Error("Workflow dependency graph contains a cycle.");o.push(i);for(let a of i)r.delete(a),n.add(a)}return{workflowId:e.id,waves:o}}},B=class{constructor(e=(0,v.join)(I(),"workflows")){this.rootDir=e;(0,h.mkdirSync)(this.definitionsDir(),{recursive:!0}),(0,h.mkdirSync)(this.runsDir(),{recursive:!0})}rootDir;saveDefinition(e){return new $().plan(e),_e((0,v.join)(this.definitionsDir(),`${z(e.id)}.json`),e),e}getDefinition(e){return ge((0,v.join)(this.definitionsDir(),`${z(e)}.json`))}listDefinitions(){return(0,h.readdirSync)(this.definitionsDir(),{withFileTypes:!0}).filter(e=>e.isFile()&&e.name.endsWith(".json")).map(e=>ge((0,v.join)(this.definitionsDir(),e.name))).filter(e=>e!==null)}createRun(e){new $().plan(e);let t=new Date().toISOString(),r={schemaVersion:1,runId:`workflow_run_${(0,pe.randomUUID)()}`,workflowId:e.id,status:"queued",createdAt:t,updatedAt:t,nodes:Object.fromEntries(e.nodes.map(n=>[n.id,{status:"pending"}]))};return this.writeRun(r),this.appendEvent(r.runId,"workflow_created",{}),r}getRun(e){return ge(this.runPath(e))}updateRun(e,t){let r=this.getRun(e);if(!r)throw new Error(`Workflow run not found: ${e}`);let n=t(r);return n.updatedAt=new Date().toISOString(),this.writeRun(n),n}appendEvent(e,t,r,n){let o={schemaVersion:1,eventId:`workflow_event_${(0,pe.randomUUID)()}`,runId:e,type:t,timestamp:new Date().toISOString(),...n?{nodeId:n}:{},payload:r},i=this.eventsPath(e);return(0,h.mkdirSync)((0,v.dirname)(i),{recursive:!0}),(0,h.appendFileSync)(i,`${JSON.stringify(o)}
6
- `,"utf8"),o}readEvents(e){let t=this.eventsPath(e);return(0,h.existsSync)(t)?(0,h.readFileSync)(t,"utf8").split(/\r?\n/).filter(Boolean).flatMap(r=>{try{return[JSON.parse(r)]}catch{return[]}}):[]}writeRun(e){_e(this.runPath(e.runId),e)}definitionsDir(){return(0,v.join)(this.rootDir,"definitions")}runsDir(){return(0,v.join)(this.rootDir,"runs")}runPath(e){return(0,v.join)(this.runsDir(),z(e),"run.json")}eventsPath(e){return(0,v.join)(this.runsDir(),z(e),"events.jsonl")}},me=class{constructor(e=new B,t=new $){this.store=e;this.planner=t}store;planner;async run(e,t){let r=this.planner.plan(e),n=this.store.createRun(e);n=this.store.updateRun(n.runId,a=>({...a,status:"running"})),this.store.appendEvent(n.runId,"workflow_started",{waves:r.waves.length});let o=Math.max(1,Math.trunc(e.maxConcurrency??4)),i=!1;for(let a of r.waves)for(let c=0;c<a.length;c+=o){let x=a.slice(c,c+o);await Promise.all(x.map(async p=>{let d=e.nodes.find(l=>l.id===p);if((d.dependsOn??[]).some(l=>this.store.getRun(n.runId)?.nodes[l]?.status!=="completed")||i&&e.failFast!==!1){this.store.updateRun(n.runId,l=>({...l,nodes:{...l.nodes,[p]:{status:"skipped",completedAt:new Date().toISOString()}}})),this.store.appendEvent(n.runId,"node_skipped",{},p);return}let y=new Date().toISOString();n=this.store.updateRun(n.runId,l=>({...l,nodes:{...l.nodes,[p]:{status:"running",startedAt:y}}})),this.store.appendEvent(n.runId,"node_started",{},p);try{let l=await t(d,{run:n,definition:e});this.store.updateRun(n.runId,g=>({...g,nodes:{...g.nodes,[p]:{status:"completed",startedAt:y,completedAt:new Date().toISOString(),output:l}}})),this.store.appendEvent(n.runId,"node_completed",{},p)}catch(l){i=!0;let g=l instanceof Error?l.message:String(l);this.store.updateRun(n.runId,U=>({...U,nodes:{...U.nodes,[p]:{status:"failed",startedAt:y,completedAt:new Date().toISOString(),error:g}}})),this.store.appendEvent(n.runId,"node_failed",{error:g},p)}}))}return n=this.store.updateRun(n.runId,a=>({...a,status:i?"failed":"completed",completedAt:new Date().toISOString()})),this.store.appendEvent(n.runId,i?"workflow_failed":"workflow_completed",{}),n}};var Ce=require("node:crypto"),fe=class{constructor(e=1e4){this.maxEvents=e;if(!Number.isInteger(e)||e<1)throw new Error("maxEvents must be a positive integer.")}maxEvents;sources=new Map;events=[];register(e){if(!e.id.trim())throw new Error("Monitor source id cannot be empty.");if(this.sources.has(e.id))throw new Error(`Monitor source already registered: ${e.id}`);return this.sources.set(e.id,{source:e,running:!1}),this}async start(e,t=1e3){let r=this.require(e);if(r.running)return this.snapshot(e);await r.source.start?.(),r.running=!0,await this.poll(e);let n=Math.max(25,Math.trunc(t));return r.timer=setInterval(()=>{this.poll(e).catch(()=>{})},n),r.timer.unref?.(),this.snapshot(e)}async poll(e){let n=(await this.require(e).source.poll()).map(o=>({schemaVersion:1,eventId:`monitor_event_${(0,Ce.randomUUID)()}`,sourceId:e,type:o.type,timestamp:o.timestamp??new Date().toISOString(),payload:o.payload}));return this.events.push(...n),this.events.length>this.maxEvents&&this.events.splice(0,this.events.length-this.maxEvents),n}async stop(e){let t=this.require(e);return t.timer&&clearInterval(t.timer),t.timer=void 0,t.running&&await t.source.stop?.(),t.running=!1,this.snapshot(e)}async stopAll(){await Promise.all([...this.sources.keys()].map(e=>this.stop(e)))}snapshot(e,t=100){let r=this.require(e);return{sourceId:e,running:r.running,events:this.events.filter(n=>n.sourceId===e).slice(-Math.max(0,Math.trunc(t)))}}list(){return[...this.sources].map(([e,t])=>({sourceId:e,running:t.running}))}require(e){let t=this.sources.get(e);if(!t)throw new Error(`Monitor source not found: ${e}`);return t}},he=class{constructor(e){this.manager=e}manager;execute(e){return this.manager.start(e.sourceId,e.intervalMs)}},we=class{constructor(e){this.manager=e}manager;execute(e){return this.manager.stop(e.sourceId)}};var Oe=require("node:crypto"),b=require("node:fs"),G=require("node:path");function E(s){return Number.isFinite(s)?Math.max(0,s??0):0}var Q=class{totalsValue={inputTokens:0,outputTokens:0,totalTokens:0,cachedInputTokens:0,estimatedCostUsd:0,events:0};add(e){let t=E(e.inputTokens),r=E(e.outputTokens);return this.totalsValue.inputTokens+=t,this.totalsValue.outputTokens+=r,this.totalsValue.totalTokens+=t+r,this.totalsValue.cachedInputTokens+=E(e.cachedInputTokens),this.totalsValue.estimatedCostUsd+=E(e.estimatedCostUsd),this.totalsValue.events+=1,this}snapshot(){return{...this.totalsValue}}};function gt(s,e){if(["runId","sessionId","workflowRunId","agentId","provider","model"].some(n=>e[n]!==void 0&&s[n]!==e[n]))return!1;let r=Date.parse(s.timestamp);return!(e.from&&r<Date.parse(e.from)||e.to&&r>Date.parse(e.to))}var ke=class{path;constructor(e=(0,G.join)(I(),"usage","events.jsonl")){this.path=e,(0,b.mkdirSync)((0,G.dirname)(e),{recursive:!0})}append(e){let t={...e,schemaVersion:1,eventId:`usage_${(0,Oe.randomUUID)()}`,timestamp:e.timestamp??new Date().toISOString(),inputTokens:E(e.inputTokens),outputTokens:E(e.outputTokens),...e.cachedInputTokens!==void 0?{cachedInputTokens:E(e.cachedInputTokens)}:{},...e.estimatedCostUsd!==void 0?{estimatedCostUsd:E(e.estimatedCostUsd)}:{}};return(0,b.appendFileSync)(this.path,`${JSON.stringify(t)}
7
- `,"utf8"),t}query(e={}){return(0,b.existsSync)(this.path)?(0,b.readFileSync)(this.path,"utf8").split(/\r?\n/).filter(Boolean).flatMap(t=>{try{let r=JSON.parse(t);return gt(r,e)?[r]:[]}catch{return[]}}):[]}summarize(e={}){let t=new Q;for(let r of this.query(e))t.add(r);return t.snapshot()}},Re=class{constructor(e){this.adapter=e}adapter;export(e){for(let t of e){let r={...t.provider?{provider:t.provider}:{},...t.model?{model:t.model}:{}};this.adapter.addCounter("xeno.usage.input_tokens",t.inputTokens,r),this.adapter.addCounter("xeno.usage.output_tokens",t.outputTokens,r),t.cachedInputTokens&&this.adapter.addCounter("xeno.usage.cached_input_tokens",t.cachedInputTokens,r),t.estimatedCostUsd&&this.adapter.addCounter("xeno.usage.estimated_cost_usd",t.estimatedCostUsd,r),this.adapter.recordEvent?.("xeno.usage.recorded",r)}}};var te=require("node:crypto"),u=require("node:fs"),re=require("node:os"),w=require("node:path");var P=2,Ne=3e4,Ue=1440*60*1e3,$e={unknown:0,plan:0,default:1,acceptEdits:2,bypassPermissions:3},q={maxPerSenderPerWindow:20,windowMs:6e4,maxQueuedPerRecipient:50,maxHeldPerRecipient:20,maxChainDepth:8},pt={queued:["held","received","refused","expired","cancelled"],held:["queued","received","refused","expired","cancelled"],received:[],refused:[],expired:[],cancelled:[]},mt={offered:["accepted","cancelled","blocked"],accepted:["running","cancelled","blocked"],running:["completed","failed","cancelled","recovery-required"],blocked:["accepted","cancelled"],"recovery-required":["cancelled"],completed:[],failed:[],cancelled:[]},Ve=["completed","failed","cancelled"];function j(s){return Ve.includes(s)}function We(s,e){return $e[s]>$e[e]}function ft(s){switch((s??"").trim()){case"plan":case"default":case"acceptEdits":case"bypassPermissions":return s;case"full-access":return"bypassPermissions";default:return"unknown"}}function ye(s){return s.replace(/[^a-z0-9]/giu,"").slice(-6).toLowerCase()||s}function ee(s){let e=`[${ye(s.sessionId)}]`;return s.name?`${s.name} \u2442 ${e}`:`unnamed \u2442 ${e}`}function X(s){return s.normalize("NFC").replace(/\s+/gu," ").trim().toLowerCase()}function ht(s,e,t){let r=e.trim();if(!r)return{kind:"unknown"};let n=s.filter(d=>d.sessionId!==t),o=n.find(d=>d.sessionId===r);if(o)return{kind:"resolved",peer:o};let i=/^(.*?)\s*(?:⑂\s*)?\[([a-z0-9]{4,})\]\s*$/iu.exec(r),a=(i?i[2]:r).toLowerCase(),c=n.filter(d=>ye(d.sessionId)===a||!i&&/^[a-z0-9]{6,}$/iu.test(r)&&d.sessionId.toLowerCase().startsWith(r.toLowerCase()));if(i){let d=i[1]?X(i[1]):"",R=c.filter(y=>!d||X(y.name??"")===d);return R.length===1?{kind:"resolved",peer:R[0]}:R.length>1?{kind:"ambiguous",candidates:R}:{kind:"unknown"}}if(c.length===1)return{kind:"resolved",peer:c[0]};if(c.length>1)return{kind:"ambiguous",candidates:c};let x=X(r),p=n.filter(d=>d.name&&X(d.name)===x);if(p.length===1)return{kind:"resolved",peer:p[0]};if(p.length>1){let d=p.filter(R=>R.state!=="offline");return d.length===1?{kind:"resolved",peer:d[0]}:{kind:"ambiguous",candidates:p}}return{kind:"unknown"}}function D(s){return new Date(s).toISOString()}function T(s){try{return JSON.parse((0,u.readFileSync)(s,"utf8"))}catch{return null}}function Z(s,e){let t=`${s}.${process.pid}.${(0,te.randomUUID)().slice(0,8)}.tmp`;(0,u.writeFileSync)(t,`${JSON.stringify(e,null,2)}
8
- `,"utf8");try{(0,u.renameSync)(t,s)}catch(r){throw(0,u.rmSync)(t,{force:!0}),r}}function N(s){let e=s.replace(/[^A-Za-z0-9._-]/gu,"_");if(!e||e==="."||e==="..")throw new Error(`Invalid identifier: ${s}`);return e}function Y(s){return(0,u.existsSync)(s)?(0,u.readdirSync)(s).filter(e=>e.endsWith(".json")).map(e=>(0,w.join)(s,e)):[]}var wt=new Int32Array(new SharedArrayBuffer(4));function F(s,e,t){let r=Date.now()+5e3;for(;;){let n;try{n=M(s,e,String(P))}catch(o){if(!/already locked/u.test(o instanceof Error?o.message:String(o))||Date.now()>r)throw o;Atomics.wait(wt,0,0,10);continue}try{return t()}finally{n.release()}}}function Le(){return(0,w.join)(I(),"control-plane","peers")}var ve=class{directory;now;options;constructor(e=Le(),t={}){this.directory=e,this.now=t.now??(()=>Date.now()),this.options={maxPerSenderPerWindow:t.maxPerSenderPerWindow??q.maxPerSenderPerWindow,windowMs:t.windowMs??q.windowMs,maxQueuedPerRecipient:t.maxQueuedPerRecipient??q.maxQueuedPerRecipient,maxHeldPerRecipient:t.maxHeldPerRecipient??q.maxHeldPerRecipient,maxChainDepth:t.maxChainDepth??q.maxChainDepth,presenceTtlMs:t.presenceTtlMs??Ne,defaultTtlMs:t.defaultTtlMs??Ue},(0,u.mkdirSync)((0,w.join)(this.directory,"presence"),{recursive:!0}),(0,u.mkdirSync)((0,w.join)(this.directory,"mailbox"),{recursive:!0}),(0,u.mkdirSync)((0,w.join)(this.directory,"locks"),{recursive:!0})}presencePath(e){return(0,w.join)(this.directory,"presence",`${N(e)}.json`)}presenceLock(e){return(0,w.join)(this.directory,"locks",`presence-${N(e)}.lock`)}registerSession(e){let t=D(this.now()),r={schemaVersion:P,sessionId:e.sessionId,incarnationId:e.incarnationId??`inc_${(0,te.randomUUID)().replaceAll("-","").slice(0,16)}`,...e.name?{name:e.name}:{},host:(0,re.hostname)(),owner:kt(),pid:process.pid,workspace:e.workspace,surface:e.surface??"cli",state:e.state??"idle",inboundPolicy:e.inboundPolicy??"accept",posture:e.posture??"unknown",capabilities:[...e.capabilities??[]],startedAt:t,heartbeatAt:t,...e.parentSessionId?{parentSessionId:e.parentSessionId}:{},...e.dockedAgents?{dockedAgents:e.dockedAgents}:{}};return F(this.presenceLock(e.sessionId),"peer-presence",()=>(Z(this.presencePath(e.sessionId),r),r))}heartbeat(e,t,r={}){return F(this.presenceLock(e),"peer-presence",()=>{let n=T(this.presencePath(e));if(!n||n.schemaVersion!==P||n.incarnationId!==t)return null;let o={...n,...Rt(r),heartbeatAt:D(this.now())};return r.name===void 0&&"name"in r&&delete o.name,Z(this.presencePath(e),o),o})}unregisterSession(e,t){return F(this.presenceLock(e),"peer-presence",()=>{let r=T(this.presencePath(e));return!r||r.incarnationId!==t?!1:((0,u.rmSync)(this.presencePath(e),{force:!0}),!0)})}getPresence(e){let t=T(this.presencePath(e));return t&&t.schemaVersion===P?this.withLiveness(t):null}listSessions(e={}){let t=[];for(let r of Y((0,w.join)(this.directory,"presence"))){let n=T(r);if(!n||n.schemaVersion!==P)continue;let o=this.withLiveness(n);o.state==="offline"&&e.includeOffline===!1||t.push(o)}return t.sort((r,n)=>(r.name??"").localeCompare(n.name??"")||r.sessionId.localeCompare(n.sessionId))}withLiveness(e){return Date.parse(e.heartbeatAt)+this.options.presenceTtlMs<this.now()?{...e,state:"offline"}:e}mailboxDir(e){return(0,w.join)(this.directory,"mailbox",N(e))}messagePath(e,t){return(0,w.join)(this.mailboxDir(e),`${N(t)}.json`)}messageLock(e){return(0,w.join)(this.directory,"locks",`message-${N(e)}.lock`)}send(e){let t=e.text.trim();if(!t)return{status:"refused",reason:"A message needs text."};if(!e.from.sessionId||!e.to.sessionId)return{status:"refused",reason:"A message needs a sender and a recipient session."};if(e.from.sessionId===e.to.sessionId)return{status:"refused",reason:"A session cannot message itself."};let r=this.getPresence(e.to.sessionId);if(!r)return{status:"refused",reason:`Unknown peer session ${e.to.sessionId}; it has never registered here.`};let n=this.getPresence(e.from.sessionId),o=this.now();if(this.listSent(e.from.sessionId).filter(g=>Date.parse(g.createdAt)>o-this.options.windowMs).length>=this.options.maxPerSenderPerWindow)return{status:"refused",reason:`Rate limit: ${this.options.maxPerSenderPerWindow} messages per ${Math.round(this.options.windowMs/1e3)}s.`};let a=0;if(e.causedBy){let g=this.find(e.causedBy);if(a=g?g.chainDepth+1:1,a>this.options.maxChainDepth)return{status:"refused",reason:`Causal chain depth ${a} exceeds ${this.options.maxChainDepth}; this exchange is looping.`}}if(e.idempotencyKey){let g=this.inbox(e.to.sessionId).find(U=>U.from.sessionId===e.from.sessionId&&U.idempotencyKey===e.idempotencyKey);if(g)return g.delivery.status==="held"?{status:"held",message:g,reason:g.delivery.reason??"held"}:{status:"queued",message:g}}let c=this.inbox(e.to.sessionId),x=c.filter(g=>g.delivery.status==="queued").length,p=c.filter(g=>g.delivery.status==="held").length,d=e.kind??"message",R=r.inboundPolicy==="hold"?`${ee(r)} holds incoming messages for its human.`:r.inboundPolicy==="refuse"?void 0:n&&We(n.posture,r.posture)?`Sender runs with ${n.posture} and the receiver with ${r.posture}; a message never moves trust upward.`:void 0;if(r.inboundPolicy==="refuse")return{status:"refused",reason:`${ee(r)} is not accepting messages.`};if(R?p>=this.options.maxHeldPerRecipient:x>=this.options.maxQueuedPerRecipient)return{status:"refused",reason:`${ee(r)} has ${R?"too many held":"too many queued"} messages; try again after it drains.`};let y=D(o),l={schemaVersion:P,messageId:`msg_${(0,te.randomUUID)().replaceAll("-","").slice(0,20)}`,...e.idempotencyKey?{idempotencyKey:e.idempotencyKey}:{},kind:d,from:{sessionId:e.from.sessionId,...e.from.incarnationId?{incarnationId:e.from.incarnationId}:{},...e.from.name??n?.name?{name:e.from.name??n?.name}:{},...e.from.host??n?.host?{host:e.from.host??n?.host}:{},...e.from.workspace??n?.workspace?{workspace:e.from.workspace??n?.workspace}:{}},to:{sessionId:r.sessionId,...r.name?{name:r.name}:{},host:r.host,workspace:r.workspace},text:t,...e.correlationId?{correlationId:e.correlationId}:{},...e.causedBy?{causedBy:e.causedBy}:{},chainDepth:a,createdAt:y,updatedAt:y,expiresAt:D(o+(e.ttlMs??this.options.defaultTtlMs)),delivery:R?{status:"held",at:y,reason:R}:{status:"queued",at:y},...d==="task"?{task:{status:"offered",at:y}}:{}};return(0,u.mkdirSync)(this.mailboxDir(r.sessionId),{recursive:!0}),F(this.messageLock(l.messageId),"peer-message",()=>{Z(this.messagePath(r.sessionId,l.messageId),l)}),R?{status:"held",message:l,reason:R}:{status:"queued",message:l}}inbox(e){return Y(this.mailboxDir(e)).map(t=>T(t)).filter(t=>!!t&&t.schemaVersion===P).sort((t,r)=>t.createdAt.localeCompare(r.createdAt)||t.messageId.localeCompare(r.messageId))}listSent(e){let t=[],r=(0,w.join)(this.directory,"mailbox");if(!(0,u.existsSync)(r))return t;for(let n of(0,u.readdirSync)(r)){let o=(0,w.join)(r,n);if((0,u.statSync)(o).isDirectory())for(let i of Y(o)){let a=T(i);a&&a.schemaVersion===P&&a.from.sessionId===e&&t.push(a)}}return t.sort((n,o)=>n.createdAt.localeCompare(o.createdAt)||n.messageId.localeCompare(o.messageId))}find(e){let t=(0,w.join)(this.directory,"mailbox");if(!(0,u.existsSync)(t))return null;let r=`${N(e)}.json`;for(let n of(0,u.readdirSync)(t)){let o=(0,w.join)(t,n,r);if((0,u.existsSync)(o)){let i=T(o);return i&&i.schemaVersion===P?i:null}}return null}mutate(e,t){return F(this.messageLock(e),"peer-message",()=>{let r=this.find(e);if(!r)throw new Error(`Unknown peer message ${e}.`);let n=t(r);return n.updatedAt=D(this.now()),Z(this.messagePath(n.to.sessionId,n.messageId),n),n})}setDelivery(e,t,r={}){return this.mutate(e,n=>{if(!pt[n.delivery.status].includes(t))throw new Error(`Invalid peer delivery transition ${n.delivery.status} -> ${t} for ${e}.`);let o={status:t,at:D(this.now()),...r.reason?{reason:r.reason}:{},...r.incarnationId?{incarnationId:r.incarnationId}:{}},i={...n,delivery:o};return i.task&&!j(i.task.status)&&(t==="refused"||t==="expired"||t==="cancelled")&&(i.task={...i.task,status:"cancelled",at:o.at,endedAt:o.at,error:r.reason??`Delivery ${t}.`}),i})}release(e){return this.setDelivery(e,"queued",{reason:"Released by the receiving session."})}receive(e,t){return this.setDelivery(e,"received",{incarnationId:t})}setTask(e,t,r={}){return this.mutate(e,n=>{if(!n.task)throw new Error(`Peer message ${e} is a ${n.kind}, not a task.`);if(!mt[n.task.status].includes(t))throw new Error(`Invalid peer task transition ${n.task.status} -> ${t} for ${e}.`);let o=D(this.now()),i={...n.task,status:t,at:o};return t==="running"&&(i.startedAt=o,r.executorIncarnationId&&(i.executorIncarnationId=r.executorIncarnationId)),(j(t)||t==="recovery-required")&&(i.endedAt=o),r.result!==void 0&&(i.result=r.result),r.error!==void 0&&(i.error=r.error),r.reportMessageId&&(i.reportMessageId=r.reportMessageId),{...n,task:i}})}requestCancel(e,t="Cancelled by sender."){let r=this.find(e);if(!r)throw new Error(`Unknown peer message ${e}.`);return r.delivery.status==="queued"||r.delivery.status==="held"?this.setDelivery(e,"cancelled",{reason:t}):r.task&&!j(r.task.status)?r.task.status==="offered"||r.task.status==="accepted"||r.task.status==="blocked"||r.task.status==="recovery-required"?this.setTask(e,"cancelled",{error:t}):this.mutate(e,n=>({...n,task:{...n.task,cancelRequestedAt:D(this.now())}})):r}expireStale(e){let t=this.now(),r=[];for(let n of this.inbox(e))(n.delivery.status==="queued"||n.delivery.status==="held")&&Date.parse(n.expiresAt)<=t&&r.push(this.setDelivery(n.messageId,"expired",{reason:"Not received before it expired."}));return r}reconcileAbandonedTasks(e,t){let r=[];for(let n of this.inbox(e)){let o=n.task;!o||o.status!=="running"||o.executorIncarnationId!==t&&r.push(this.setTask(n.messageId,"recovery-required",{error:`The executing process (incarnation ${o.executorIncarnationId??"unknown"}) exited before the task finished; inspect its side effects before re-delegating.`}))}return r}compact(e=10080*60*1e3){let t=this.now()-e,r=0,n=0,o=(0,w.join)(this.directory,"mailbox");if((0,u.existsSync)(o))for(let i of(0,u.readdirSync)(o))for(let a of Y((0,w.join)(o,i))){let c=T(a);if(!c)continue;c.delivery.status!=="queued"&&c.delivery.status!=="held"&&(!c.task||j(c.task.status)||c.task.status==="recovery-required")&&Date.parse(c.updatedAt)<t&&((0,u.rmSync)(a,{force:!0}),r+=1)}for(let i of this.listSessions())i.state==="offline"&&Date.parse(i.heartbeatAt)<t&&((0,u.rmSync)(this.presencePath(i.sessionId),{force:!0}),n+=1);return{messages:r,presence:n}}};function kt(){try{return(0,re.userInfo)().username}catch{return process.env.USERNAME??process.env.USER??"unknown"}}function Rt(s){let e={};for(let[t,r]of Object.entries(s))r!==void 0&&(e[t]=r);return e}0&&(module.exports={AGENT_DAEMON_PROTOCOL_VERSION,AgentDaemonClient,AgentDaemonServer,AgentEventStore,AgentRunController,AgentRunStore,MonitorManager,MonitorStopTool,MonitorTool,OtelExporter,PEER_MESSAGE_DEFAULT_TTL_MS,PEER_PRESENCE_TTL_MS,PEER_SCHEMA_VERSION,PEER_TASK_TERMINAL_STATUSES,PeerMessagingStore,UsageAccumulator,UsageLedger,WorkflowPlanner,WorkflowRuntime,WorkflowStore,acquireControlPlaneLock,createAgentRunId,defaultPeerDirectory,getAgentRunDir,getAgentRunStoreDir,isPeerTaskTerminal,movesTrustUpward,peerShortId,renderPeerLabel,resolvePeerTarget,toPeerPosture});
1
+ "use strict";var oe=Object.defineProperty;var Ke=Object.getOwnPropertyDescriptor;var Be=Object.getOwnPropertyNames;var Xe=Object.prototype.hasOwnProperty;var qe=(s,e)=>{for(var t in e)oe(s,t,{get:e[t],enumerable:!0})},Fe=(s,e,t,r)=>{if(e&&typeof e=="object"||typeof e=="function")for(let n of Be(e))!Xe.call(s,n)&&n!==t&&oe(s,n,{get:()=>e[n],enumerable:!(r=Ke(e,n))||r.enumerable});return s};var He=s=>Fe(oe({},"__esModule",{value:!0}),s);var yt={};qe(yt,{AGENT_DAEMON_PROTOCOL_VERSION:()=>C,AgentDaemonClient:()=>le,AgentDaemonServer:()=>de,AgentEventStore:()=>L,AgentRunController:()=>ce,AgentRunStore:()=>K,MonitorManager:()=>fe,MonitorStopTool:()=>we,MonitorTool:()=>he,OtelExporter:()=>Pe,PEER_MESSAGE_DEFAULT_TTL_MS:()=>Ve,PEER_PRESENCE_TTL_MS:()=>$e,PEER_SCHEMA_VERSION:()=>v,PEER_TASK_TERMINAL_STATUSES:()=>Ue,PeerMessagingStore:()=>ye,UsageAccumulator:()=>Q,UsageLedger:()=>ke,WorkflowPlanner:()=>N,WorkflowRuntime:()=>ge,WorkflowStore:()=>G,acquireControlPlaneLock:()=>O,createAgentRunId:()=>De,defaultPeerDirectory:()=>We,getAgentRunDir:()=>dt,getAgentRunStoreDir:()=>ct,isPeerTaskTerminal:()=>q,movesTrustUpward:()=>Le,peerShortId:()=>Re,renderPeerLabel:()=>re,resolvePeerTarget:()=>ht,toPeerPosture:()=>ft});module.exports=He(yt);var j=require("node:crypto"),f=require("node:fs"),g=require("node:path");var U="0.10.37";var A=require("node:fs"),ie=require("node:os"),Ae=require("node:path");function je(){return new Date().toISOString()}function Je(){return new Date(Date.now()-Math.floor(process.uptime()*1e3)).toISOString()}function Se(s){try{return JSON.parse((0,A.readFileSync)(s,"utf8"))}catch{return null}}function ze(s){if(!s||s<=0)return!1;try{return process.kill(s,0),!0}catch{return!1}}function Ge(s){return s.hostname!==(0,ie.hostname)()?!0:ze(s.pid)}function ve(s,e){(0,A.mkdirSync)((0,Ae.dirname)(s),{recursive:!0}),(0,A.writeFileSync)(s,JSON.stringify(e,null,2)+`
2
+ `,{encoding:"utf8",flag:"wx"})}function Qe(s,e){let t=Se(s);t?.pid!==e.pid||t.hostname!==e.hostname||(0,A.rmSync)(s,{force:!0})}function O(s,e,t){let r=je(),n={schemaVersion:1,name:e,pid:process.pid,hostname:(0,ie.hostname)(),processStartedAt:Je(),version:t,acquiredAt:r,updatedAt:r};try{ve(s,n)}catch(o){if(o.code!=="EEXIST")throw o;let a=Se(s);if(a&&Ge(a))throw new Error(`${e} is already locked by PID ${a.pid} on ${a.hostname}.`);(0,A.rmSync)(s,{force:!0}),ve(s,n)}return{record:n,release:()=>{Qe(s,n)}}}var be=require("node:crypto"),S=require("node:fs"),_=require("node:path");function xe(s){return(0,_.basename)(s).replace(/[^A-Za-z0-9_.-]/g,"_").slice(0,96)}function Ie(s){return(0,S.existsSync)(s)?(0,S.readFileSync)(s,"utf8").split(/\r?\n/).map(e=>e.trim()).filter(Boolean).map(e=>{try{return JSON.parse(e)}catch{return null}}).filter(e=>e!==null):[]}var L=class{constructor(e){this.runsDir=e;(0,S.mkdirSync)(this.runsDir,{recursive:!0})}runsDir;pathFor(e){return(0,_.join)(this.runsDir,xe(e),"events.jsonl")}append(e,t,r={},n=new Date().toISOString()){let o=this.pathFor(e);(0,S.mkdirSync)((0,_.dirname)(o),{recursive:!0});let i=O(`${o}.lock`,`events:${xe(e)}`,U);try{let a=Ie(o).reduce((x,m,d)=>Math.max(x,m.sequence??d),-1)+1,c={schemaVersion:1,eventId:`event_${(0,be.randomUUID)()}`,sequence:a,runId:e,type:t,timestamp:n,payload:r};return(0,S.appendFileSync)(o,`${JSON.stringify(c)}
3
+ `,"utf8"),c}finally{i.release()}}read(e){return Ie(this.pathFor(e))}tail(e,t=100){let r=Math.max(0,Math.min(1e4,Math.trunc(t)));return r===0?[]:this.read(e).slice(-r)}};var M=require("node:os");var W=require("node:path");var Dt=(0,M.platform)();var Ot=(0,M.release)(),Mt=(0,M.homedir)();function I(){let s=process.env.XENO_AGENT_HOME?.trim();return s?(0,W.resolve)(s):(0,W.resolve)((0,M.homedir)(),".xeno-agent")}var Ze=1,Ye=(0,g.join)(I(),"daemon"),ae=(0,g.join)(Ye,"runs");function k(){return new Date().toISOString()}function et(s=new Date){return s.toISOString().replace(/[^0-9]/g,"").slice(0,14)}function Ee(s){return s.replace(/[^A-Za-z0-9_.-]/g,"_").slice(0,80)}function ue(s){return(0,g.resolve)(s)}function H(s){return ue(s).toLowerCase()}function Te(s,e){let t=H(s),r=H(e);return t===r||t.startsWith(`${r}\\`)||t.startsWith(`${r}/`)}function tt(s,e){return!!(H(s.cwd)===H(e)||s.git?.root&&Te(e,s.git.root)||s.git?.worktree&&Te(e,s.git.worktree))}function rt(s){let e=ue(s);return`workspace_${(0,j.createHash)("sha256").update(process.platform==="win32"?e.toLowerCase():e).digest("hex")}`}function nt(){return{input:0,output:0,total:0}}function F(s){try{return JSON.parse((0,f.readFileSync)(s,"utf8"))}catch{return null}}function st(s){return s instanceof Error&&/\balready locked by PID\b/.test(s.message)}function ot(s,e){(0,f.mkdirSync)((0,g.dirname)(s),{recursive:!0});let t=`${s}.${process.pid}.${Date.now()}.tmp`;(0,f.writeFileSync)(t,JSON.stringify(e,null,2)+`
4
+ `,"utf8"),(0,f.renameSync)(t,s)}function it(s){if(!s||s<=0)return!1;try{return process.kill(s,0),!0}catch{return!1}}function at(s){return s==="completed"||s==="failed"||s==="cancelled"||s==="interrupted"}function ut(s,e){return s.pinned!==e.pinned?s.pinned?-1:1:Date.parse(e.updatedAt)-Date.parse(s.updatedAt)}function ct(){return ae}function dt(s){return(0,g.join)(ae,s)}function De(s=new Date){return`run_${et(s)}_${(0,j.randomUUID)().slice(0,8)}`}var K=class{constructor(e=ae){this.runsDir=e;(0,f.mkdirSync)(this.runsDir,{recursive:!0}),this.eventStore=new L(this.runsDir)}runsDir;eventStore;create(e){let t=De(),r=(0,g.join)(this.runsDir,t);(0,f.mkdirSync)(r,{recursive:!0});let n=k(),o=(0,g.join)(r,"events.jsonl"),i={schemaVersion:Ze,runId:t,sessionId:t,rootRunId:t,cwd:ue(e.cwd),workspaceId:rt(e.cwd),prompt:e.prompt,...e.title?{title:e.title}:{},status:"starting",model:e.model,...e.effort?{effort:e.effort}:{},...e.agent?{agent:e.agent}:{},...e.git?{git:e.git}:{},permissionMode:e.permissionMode,...e.cliVersion?{createdByCliVersion:e.cliVersion}:{},createdBySdkVersion:e.sdkVersion??U,createdAt:n,updatedAt:n,lastActivityAt:n,pinned:!!e.pinned,attachedClients:0,...e.cliVersion?{cliVersion:e.cliVersion}:{},...e.sdkVersion?{sdkVersion:e.sdkVersion}:{},stdoutPath:(0,g.join)(r,"stdout.log"),stderrPath:(0,g.join)(r,"stderr.log"),eventsPath:o,usage:nt(),children:[],tags:[]};return(0,f.writeFileSync)(i.stdoutPath,"","utf8"),(0,f.writeFileSync)(i.stderrPath,"","utf8"),(0,f.writeFileSync)(i.eventsPath,"","utf8"),this.write(i),this.appendEvent(t,"run_created",{cwd:i.cwd,model:i.model,...i.agent?{agent:i.agent}:{},...i.git?{git:i.git}:{},permissionMode:i.permissionMode,pinned:i.pinned}),i}get(e){let t=F(this.recordPath(e));return t?this.refreshRecordStatus(t):null}list(e={}){if(!(0,f.existsSync)(this.runsDir))return[];let t=(0,f.readdirSync)(this.runsDir,{withFileTypes:!0}).filter(r=>r.isDirectory()).map(r=>{try{return this.get(r.name)}catch(n){if(st(n))return F(this.recordPath(r.name));throw n}}).filter(r=>r!==null).filter(r=>e.all||!e.cwd||tt(r,e.cwd)).filter(r=>!e.status||e.status.includes(r.status)).sort(ut);return typeof e.limit=="number"&&e.limit>0?t.slice(0,e.limit):t}markSpawned(e,t,r){return this.update(e,n=>({...n,status:"running",workerPid:t,...r?{workerVersion:r}:{},startedAt:n.startedAt??k(),lastActivityAt:k()}))}markStarted(e,t){return this.update(e,r=>({...r,status:"running",workerPid:t.pid,...t.workerVersion?{workerVersion:t.workerVersion}:{},...t.model?{model:t.model}:{},...t.effort?{effort:t.effort}:{},startedAt:r.startedAt??k(),lastActivityAt:k()}))}markCompleted(e,t){return this.update(e,r=>({...r,status:t.status,...t.statusReason?{statusReason:t.statusReason}:{},exitCode:t.exitCode??null,usage:t.usage??r.usage,endedAt:k(),lastActivityAt:k()}))}markCancelled(e,t){return this.update(e,r=>({...r,status:"cancelled",statusReason:t,endedAt:k(),lastActivityAt:k()}))}markPaused(e,t="Paused by user."){let r=this.update(e,n=>({...n,status:"paused",statusReason:t,lastActivityAt:k()}));return r&&this.appendEvent(e,"run_paused",{reason:t}),r}markResumed(e,t="Resumed by user."){let r=this.update(e,n=>{let o={...n,status:"running",statusReason:t,lastActivityAt:k()};return delete o.endedAt,delete o.exitCode,o});return r&&this.appendEvent(e,"run_resumed",{reason:t}),r}setPinned(e,t){let r=this.update(e,n=>({...n,pinned:t,lastActivityAt:k()}));return r&&this.appendEvent(e,t?"run_pinned":"run_unpinned",{pinned:t}),r}appendEvent(e,t,r={}){let n=F(this.recordPath(e)),o=this.eventStore.append(e,t,r);n&&this.update(e,i=>({...i,lastActivityAt:o.timestamp}))}readEvents(e){return this.get(e)?this.eventStore.read(e):[]}delete(e){(0,f.rmSync)((0,g.join)(this.runsDir,e),{recursive:!0,force:!0})}refreshRecordStatus(e){if(at(e.status))return e;if(e.workerPid&&!it(e.workerPid)){let t={...e,status:"failed",statusReason:"Worker process is no longer running and did not record a terminal status.",endedAt:e.endedAt??k(),updatedAt:k()};return this.write(t),t}return e}update(e,t){let r=F(this.recordPath(e));if(!r)return null;let n=t(r);return n.updatedAt=k(),this.write(n),n}write(e){let t=O((0,g.join)(this.runDir(e.runId),"run.lock"),`run:${e.runId}`,U);try{ot(this.recordPath(e.runId),e)}finally{t.release()}}recordPath(e){return(0,g.join)(this.runsDir,Ee((0,g.basename)(e)),"run.json")}runDir(e){return(0,g.join)(this.runsDir,Ee((0,g.basename)(e)))}};function Oe(s){return s==="completed"||s==="failed"||s==="cancelled"||s==="interrupted"}var ce=class{constructor(e={}){this.options=e;this.store=e.store??new K}options;store;create(e){return this.store.create(e)}async start(e){let t=this.create(e);if(!this.options.spawn)return t;try{let r=await this.options.spawn(t),n=this.store.markSpawned(t.runId,r.pid,r.workerVersion);if(!n)throw new Error(`Run disappeared during spawn: ${t.runId}`);return this.store.appendEvent(t.runId,"run_started",{pid:r.pid}),n}catch(r){let n=r instanceof Error?r.message:String(r);throw this.store.markCompleted(t.runId,{status:"failed",statusReason:n,exitCode:null}),this.store.appendEvent(t.runId,"run_start_failed",{reason:n}),r}}get(e){return this.store.get(e)}list(e={}){return this.store.list(e)}events(e,t){let r=this.store.readEvents(e);return t===void 0?r:r.slice(-Math.max(0,Math.trunc(t)))}async stop(e,t="Stopped by user."){let r=this.store.get(e);if(!r||Oe(r.status))return r;await this.options.stop?.(r,t);let n=this.store.markCancelled(e,t);return n&&this.store.appendEvent(e,"run_cancelled",{reason:t}),n}async pause(e,t="Paused by user."){let r=this.store.get(e);return!r||Oe(r.status)||r.status==="paused"?r:(await this.options.pause?.(r,t),this.store.markPaused(e,t))}async resume(e,t="Resumed by user."){let r=this.store.get(e);return!r||r.status!=="paused"?r:(await this.options.resume?.(r,t),this.store.markResumed(e,t))}complete(e,t,r={}){let n=this.store.markCompleted(e,{status:t,...r.reason?{statusReason:r.reason}:{},...r.exitCode!==void 0?{exitCode:r.exitCode}:{},...r.usage?{usage:r.usage}:{}});return n&&this.store.appendEvent(e,`run_${t}`,{...r.reason?{reason:r.reason}:{}}),n}};var J=require("node:crypto"),C=1;function lt(s,e){if(!s)return!1;let t=Buffer.from(s),r=Buffer.from(e);return t.length===r.length&&(0,J.timingSafeEqual)(t,r)}var de=class{constructor(e={}){this.options=e}options;handlers=new Map;register(e,t){let r=e.trim();if(!r)throw new Error("Daemon method name cannot be empty.");if(this.handlers.has(r))throw new Error(`Daemon method already registered: ${r}`);return this.handlers.set(r,t),this}registerController(e){return this.register("runs.start",t=>e.start(t)).register("runs.get",t=>e.get(t.runId)).register("runs.list",t=>e.list(t??{})).register("runs.events",t=>{let r=t;return e.events(r.runId,r.limit)}).register("runs.stop",t=>{let r=t;return e.stop(r.runId,r.reason)}).register("runs.pause",t=>{let r=t;return e.pause(r.runId,r.reason)}).register("runs.resume",t=>{let r=t;return e.resume(r.runId,r.reason)})}async handle(e){if(e.protocolVersion!==C)return this.error(e.id,"PROTOCOL_MISMATCH",`Unsupported protocol version: ${e.protocolVersion}`);if(this.options.authToken&&!lt(e.authToken,this.options.authToken))return this.error(e.id,"UNAUTHORIZED","Daemon authentication failed.");let t=this.handlers.get(e.method);if(!t)return this.error(e.id,"METHOD_NOT_FOUND",`Unknown daemon method: ${e.method}`);try{return{protocolVersion:C,id:e.id,result:await t(e.params,e)}}catch(r){return this.error(e.id,"INTERNAL_ERROR",r instanceof Error?r.message:String(r))}}error(e,t,r){return{protocolVersion:C,id:e,error:{code:t,message:r}}}},le=class{constructor(e,t={}){this.transport=e;this.options=t}transport;options;async request(e,t){let r={protocolVersion:C,id:`request_${(0,J.randomUUID)()}`,method:e,params:t,...this.options.authToken?{authToken:this.options.authToken}:{}},n=await this.transport(r);if(n.protocolVersion!==C||n.id!==r.id)throw new Error("Invalid daemon response identity.");if("error"in n){let o=new Error(n.error.message);throw o.code=n.error.code,o}return n.result}};var me=require("node:crypto"),h=require("node:fs"),y=require("node:path");function z(s){return(0,y.basename)(s).replace(/[^A-Za-z0-9_.-]/g,"_").slice(0,96)}function pe(s){try{return JSON.parse((0,h.readFileSync)(s,"utf8"))}catch{return null}}function Me(s,e){(0,h.mkdirSync)((0,y.dirname)(s),{recursive:!0});let t=`${s}.${process.pid}.${Date.now()}.tmp`;(0,h.writeFileSync)(t,`${JSON.stringify(e,null,2)}
5
+ `,"utf8"),(0,h.renameSync)(t,s)}var N=class{plan(e){if(e.schemaVersion!==1)throw new Error("Unsupported workflow schema version.");if(!e.id.trim()||!e.name.trim())throw new Error("Workflow id and name are required.");let t=new Map;for(let i of e.nodes){if(!i.id.trim())throw new Error("Workflow node id cannot be empty.");if(t.has(i.id))throw new Error(`Duplicate workflow node: ${i.id}`);t.set(i.id,i)}for(let i of e.nodes)for(let a of i.dependsOn??[]){if(!t.has(a))throw new Error(`Workflow node ${i.id} depends on unknown node ${a}.`);if(a===i.id)throw new Error(`Workflow node ${i.id} cannot depend on itself.`)}let r=new Set(t.keys()),n=new Set,o=[];for(;r.size>0;){let i=[...r].filter(a=>(t.get(a)?.dependsOn??[]).every(c=>n.has(c))).sort();if(i.length===0)throw new Error("Workflow dependency graph contains a cycle.");o.push(i);for(let a of i)r.delete(a),n.add(a)}return{workflowId:e.id,waves:o}}},G=class{constructor(e=(0,y.join)(I(),"workflows")){this.rootDir=e;(0,h.mkdirSync)(this.definitionsDir(),{recursive:!0}),(0,h.mkdirSync)(this.runsDir(),{recursive:!0})}rootDir;saveDefinition(e){return new N().plan(e),Me((0,y.join)(this.definitionsDir(),`${z(e.id)}.json`),e),e}getDefinition(e){return pe((0,y.join)(this.definitionsDir(),`${z(e)}.json`))}listDefinitions(){return(0,h.readdirSync)(this.definitionsDir(),{withFileTypes:!0}).filter(e=>e.isFile()&&e.name.endsWith(".json")).map(e=>pe((0,y.join)(this.definitionsDir(),e.name))).filter(e=>e!==null)}createRun(e){new N().plan(e);let t=new Date().toISOString(),r={schemaVersion:1,runId:`workflow_run_${(0,me.randomUUID)()}`,workflowId:e.id,status:"queued",createdAt:t,updatedAt:t,nodes:Object.fromEntries(e.nodes.map(n=>[n.id,{status:"pending"}]))};return this.writeRun(r),this.appendEvent(r.runId,"workflow_created",{}),r}getRun(e){return pe(this.runPath(e))}updateRun(e,t){let r=this.getRun(e);if(!r)throw new Error(`Workflow run not found: ${e}`);let n=t(r);return n.updatedAt=new Date().toISOString(),this.writeRun(n),n}appendEvent(e,t,r,n){let o={schemaVersion:1,eventId:`workflow_event_${(0,me.randomUUID)()}`,runId:e,type:t,timestamp:new Date().toISOString(),...n?{nodeId:n}:{},payload:r},i=this.eventsPath(e);return(0,h.mkdirSync)((0,y.dirname)(i),{recursive:!0}),(0,h.appendFileSync)(i,`${JSON.stringify(o)}
6
+ `,"utf8"),o}readEvents(e){let t=this.eventsPath(e);return(0,h.existsSync)(t)?(0,h.readFileSync)(t,"utf8").split(/\r?\n/).filter(Boolean).flatMap(r=>{try{return[JSON.parse(r)]}catch{return[]}}):[]}writeRun(e){Me(this.runPath(e.runId),e)}definitionsDir(){return(0,y.join)(this.rootDir,"definitions")}runsDir(){return(0,y.join)(this.rootDir,"runs")}runPath(e){return(0,y.join)(this.runsDir(),z(e),"run.json")}eventsPath(e){return(0,y.join)(this.runsDir(),z(e),"events.jsonl")}},ge=class{constructor(e=new G,t=new N){this.store=e;this.planner=t}store;planner;async run(e,t){let r=this.planner.plan(e),n=this.store.createRun(e);n=this.store.updateRun(n.runId,a=>({...a,status:"running"})),this.store.appendEvent(n.runId,"workflow_started",{waves:r.waves.length});let o=Math.max(1,Math.trunc(e.maxConcurrency??4)),i=!1;for(let a of r.waves)for(let c=0;c<a.length;c+=o){let x=a.slice(c,c+o);await Promise.all(x.map(async m=>{let d=e.nodes.find(l=>l.id===m);if((d.dependsOn??[]).some(l=>this.store.getRun(n.runId)?.nodes[l]?.status!=="completed")||i&&e.failFast!==!1){this.store.updateRun(n.runId,l=>({...l,nodes:{...l.nodes,[m]:{status:"skipped",completedAt:new Date().toISOString()}}})),this.store.appendEvent(n.runId,"node_skipped",{},m);return}let R=new Date().toISOString();n=this.store.updateRun(n.runId,l=>({...l,nodes:{...l.nodes,[m]:{status:"running",startedAt:R}}})),this.store.appendEvent(n.runId,"node_started",{},m);try{let l=await t(d,{run:n,definition:e});this.store.updateRun(n.runId,p=>({...p,nodes:{...p.nodes,[m]:{status:"completed",startedAt:R,completedAt:new Date().toISOString(),output:l}}})),this.store.appendEvent(n.runId,"node_completed",{},m)}catch(l){i=!0;let p=l instanceof Error?l.message:String(l);this.store.updateRun(n.runId,V=>({...V,nodes:{...V.nodes,[m]:{status:"failed",startedAt:R,completedAt:new Date().toISOString(),error:p}}})),this.store.appendEvent(n.runId,"node_failed",{error:p},m)}}))}return n=this.store.updateRun(n.runId,a=>({...a,status:i?"failed":"completed",completedAt:new Date().toISOString()})),this.store.appendEvent(n.runId,i?"workflow_failed":"workflow_completed",{}),n}};var _e=require("node:crypto"),fe=class{constructor(e=1e4){this.maxEvents=e;if(!Number.isInteger(e)||e<1)throw new Error("maxEvents must be a positive integer.")}maxEvents;sources=new Map;events=[];register(e){if(!e.id.trim())throw new Error("Monitor source id cannot be empty.");if(this.sources.has(e.id))throw new Error(`Monitor source already registered: ${e.id}`);return this.sources.set(e.id,{source:e,running:!1}),this}async start(e,t=1e3){let r=this.require(e);if(r.running)return this.snapshot(e);await r.source.start?.(),r.running=!0,await this.poll(e);let n=Math.max(25,Math.trunc(t));return r.timer=setInterval(()=>{this.poll(e).catch(()=>{})},n),r.timer.unref?.(),this.snapshot(e)}async poll(e){let n=(await this.require(e).source.poll()).map(o=>({schemaVersion:1,eventId:`monitor_event_${(0,_e.randomUUID)()}`,sourceId:e,type:o.type,timestamp:o.timestamp??new Date().toISOString(),payload:o.payload}));return this.events.push(...n),this.events.length>this.maxEvents&&this.events.splice(0,this.events.length-this.maxEvents),n}async stop(e){let t=this.require(e);return t.timer&&clearInterval(t.timer),t.timer=void 0,t.running&&await t.source.stop?.(),t.running=!1,this.snapshot(e)}async stopAll(){await Promise.all([...this.sources.keys()].map(e=>this.stop(e)))}snapshot(e,t=100){let r=this.require(e);return{sourceId:e,running:r.running,events:this.events.filter(n=>n.sourceId===e).slice(-Math.max(0,Math.trunc(t)))}}list(){return[...this.sources].map(([e,t])=>({sourceId:e,running:t.running}))}require(e){let t=this.sources.get(e);if(!t)throw new Error(`Monitor source not found: ${e}`);return t}},he=class{constructor(e){this.manager=e}manager;execute(e){return this.manager.start(e.sourceId,e.intervalMs)}},we=class{constructor(e){this.manager=e}manager;execute(e){return this.manager.stop(e.sourceId)}};var Ce=require("node:crypto"),E=require("node:fs"),Z=require("node:path");function b(s){return Number.isFinite(s)?Math.max(0,s??0):0}var Q=class{totalsValue={inputTokens:0,outputTokens:0,totalTokens:0,cachedInputTokens:0,estimatedCostUsd:0,events:0};add(e){let t=b(e.inputTokens),r=b(e.outputTokens);return this.totalsValue.inputTokens+=t,this.totalsValue.outputTokens+=r,this.totalsValue.totalTokens+=t+r,this.totalsValue.cachedInputTokens+=b(e.cachedInputTokens),this.totalsValue.estimatedCostUsd+=b(e.estimatedCostUsd),this.totalsValue.events+=1,this}snapshot(){return{...this.totalsValue}}};function pt(s,e){if(["runId","sessionId","workflowRunId","agentId","provider","model"].some(n=>e[n]!==void 0&&s[n]!==e[n]))return!1;let r=Date.parse(s.timestamp);return!(e.from&&r<Date.parse(e.from)||e.to&&r>Date.parse(e.to))}var ke=class{path;constructor(e=(0,Z.join)(I(),"usage","events.jsonl")){this.path=e,(0,E.mkdirSync)((0,Z.dirname)(e),{recursive:!0})}append(e){let t={...e,schemaVersion:1,eventId:`usage_${(0,Ce.randomUUID)()}`,timestamp:e.timestamp??new Date().toISOString(),inputTokens:b(e.inputTokens),outputTokens:b(e.outputTokens),...e.cachedInputTokens!==void 0?{cachedInputTokens:b(e.cachedInputTokens)}:{},...e.estimatedCostUsd!==void 0?{estimatedCostUsd:b(e.estimatedCostUsd)}:{}};return(0,E.appendFileSync)(this.path,`${JSON.stringify(t)}
7
+ `,"utf8"),t}query(e={}){return(0,E.existsSync)(this.path)?(0,E.readFileSync)(this.path,"utf8").split(/\r?\n/).filter(Boolean).flatMap(t=>{try{let r=JSON.parse(t);return pt(r,e)?[r]:[]}catch{return[]}}):[]}summarize(e={}){let t=new Q;for(let r of this.query(e))t.add(r);return t.snapshot()}},Pe=class{constructor(e){this.adapter=e}adapter;export(e){for(let t of e){let r={...t.provider?{provider:t.provider}:{},...t.model?{model:t.model}:{}};this.adapter.addCounter("xeno.usage.input_tokens",t.inputTokens,r),this.adapter.addCounter("xeno.usage.output_tokens",t.outputTokens,r),t.cachedInputTokens&&this.adapter.addCounter("xeno.usage.cached_input_tokens",t.cachedInputTokens,r),t.estimatedCostUsd&&this.adapter.addCounter("xeno.usage.estimated_cost_usd",t.estimatedCostUsd,r),this.adapter.recordEvent?.("xeno.usage.recorded",r)}}};var ne=require("node:crypto"),u=require("node:fs"),se=require("node:os"),w=require("node:path");var v=2,$e=3e4,Ve=1440*60*1e3,Ne={unknown:0,plan:0,default:1,acceptEdits:2,bypassPermissions:3},B={maxPerSenderPerWindow:20,windowMs:6e4,maxQueuedPerRecipient:50,maxHeldPerRecipient:20,maxChainDepth:8},mt={queued:["held","received","refused","expired","cancelled"],held:["queued","received","refused","expired","cancelled"],received:[],refused:[],expired:[],cancelled:[]},gt={offered:["accepted","cancelled","blocked"],accepted:["running","cancelled","blocked"],running:["completed","failed","cancelled","recovery-required"],blocked:["accepted","cancelled"],"recovery-required":["cancelled"],completed:[],failed:[],cancelled:[]},Ue=["completed","failed","cancelled"];function q(s){return Ue.includes(s)}function Le(s,e){return Ne[s]>Ne[e]}function ft(s){switch((s??"").trim()){case"plan":case"default":case"acceptEdits":case"bypassPermissions":return s;case"full-access":return"bypassPermissions";default:return"unknown"}}function Re(s){return s.replace(/[^a-z0-9]/giu,"").slice(-6).toLowerCase()||s}function re(s){let e=`[${Re(s.sessionId)}]`;return s.name?`${s.name} \u2442 ${e}`:`unnamed \u2442 ${e}`}function Y(s){return s.normalize("NFC").replace(/\s+/gu," ").trim().toLowerCase()}function ht(s,e,t){let r=e.trim();if(!r)return{kind:"unknown"};let n=s.filter(d=>d.sessionId!==t),o=n.find(d=>d.sessionId===r);if(o)return{kind:"resolved",peer:o};let i=/^(.*?)\s*(?:⑂\s*)?\[([a-z0-9]{4,})\]\s*$/iu.exec(r),a=(i?i[2]:r).toLowerCase(),c=n.filter(d=>Re(d.sessionId)===a||!i&&/^[a-z0-9]{6,}$/iu.test(r)&&d.sessionId.toLowerCase().startsWith(r.toLowerCase()));if(i){let d=i[1]?Y(i[1]):"",P=c.filter(R=>!d||Y(R.name??"")===d);return P.length===1?{kind:"resolved",peer:P[0]}:P.length>1?{kind:"ambiguous",candidates:P}:{kind:"unknown"}}if(c.length===1)return{kind:"resolved",peer:c[0]};if(c.length>1)return{kind:"ambiguous",candidates:c};let x=Y(r),m=n.filter(d=>d.name&&Y(d.name)===x);if(m.length===1)return{kind:"resolved",peer:m[0]};if(m.length>1){let d=m.filter(P=>P.state!=="offline");return d.length===1?{kind:"resolved",peer:d[0]}:{kind:"ambiguous",candidates:m}}return{kind:"unknown"}}function T(s){return new Date(s).toISOString()}function D(s){try{return JSON.parse((0,u.readFileSync)(s,"utf8"))}catch{return null}}function ee(s,e){let t=`${s}.${process.pid}.${(0,ne.randomUUID)().slice(0,8)}.tmp`;(0,u.writeFileSync)(t,`${JSON.stringify(e,null,2)}
8
+ `,"utf8");try{(0,u.renameSync)(t,s)}catch(r){throw(0,u.rmSync)(t,{force:!0}),r}}function $(s){let e=s.replace(/[^A-Za-z0-9._-]/gu,"_");if(!e||e==="."||e==="..")throw new Error(`Invalid identifier: ${s}`);return e}function te(s){return(0,u.existsSync)(s)?(0,u.readdirSync)(s).filter(e=>e.endsWith(".json")).map(e=>(0,w.join)(s,e)):[]}var wt=new Int32Array(new SharedArrayBuffer(4));function X(s,e,t){let r=Date.now()+5e3;for(;;){let n;try{n=O(s,e,String(v))}catch(o){if(!/already locked/u.test(o instanceof Error?o.message:String(o))||Date.now()>r)throw o;Atomics.wait(wt,0,0,10);continue}try{return t()}finally{n.release()}}}function We(){return(0,w.join)(I(),"control-plane","peers")}var ye=class{directory;now;options;constructor(e=We(),t={}){this.directory=e,this.now=t.now??(()=>Date.now()),this.options={maxPerSenderPerWindow:t.maxPerSenderPerWindow??B.maxPerSenderPerWindow,windowMs:t.windowMs??B.windowMs,maxQueuedPerRecipient:t.maxQueuedPerRecipient??B.maxQueuedPerRecipient,maxHeldPerRecipient:t.maxHeldPerRecipient??B.maxHeldPerRecipient,maxChainDepth:t.maxChainDepth??B.maxChainDepth,presenceTtlMs:t.presenceTtlMs??$e,defaultTtlMs:t.defaultTtlMs??Ve},(0,u.mkdirSync)((0,w.join)(this.directory,"presence"),{recursive:!0}),(0,u.mkdirSync)((0,w.join)(this.directory,"mailbox"),{recursive:!0}),(0,u.mkdirSync)((0,w.join)(this.directory,"locks"),{recursive:!0})}presencePath(e){return(0,w.join)(this.directory,"presence",`${$(e)}.json`)}presenceLock(e){return(0,w.join)(this.directory,"locks",`presence-${$(e)}.lock`)}registerSession(e){let t=T(this.now()),r={schemaVersion:v,sessionId:e.sessionId,incarnationId:e.incarnationId??`inc_${(0,ne.randomUUID)().replaceAll("-","").slice(0,16)}`,...e.name?{name:e.name}:{},host:(0,se.hostname)(),owner:kt(),pid:process.pid,workspace:e.workspace,surface:e.surface??"cli",state:e.state??"idle",inboundPolicy:e.inboundPolicy??"accept",posture:e.posture??"unknown",capabilities:[...e.capabilities??[]],startedAt:t,heartbeatAt:t,...e.parentSessionId?{parentSessionId:e.parentSessionId}:{},...e.dockedAgents?{dockedAgents:e.dockedAgents}:{}};return X(this.presenceLock(e.sessionId),"peer-presence",()=>(ee(this.presencePath(e.sessionId),r),r))}heartbeat(e,t,r={}){return X(this.presenceLock(e),"peer-presence",()=>{let n=D(this.presencePath(e));if(!n||n.schemaVersion!==v||n.incarnationId!==t)return null;let o={...n,...Pt(r),heartbeatAt:T(this.now())};return r.name===void 0&&"name"in r&&delete o.name,ee(this.presencePath(e),o),o})}unregisterSession(e,t){return X(this.presenceLock(e),"peer-presence",()=>{let r=D(this.presencePath(e));return!r||r.incarnationId!==t?!1:((0,u.rmSync)(this.presencePath(e),{force:!0}),!0)})}getPresence(e){let t=D(this.presencePath(e));return t&&t.schemaVersion===v?this.withLiveness(t):null}listSessions(e={}){let t=[];for(let r of te((0,w.join)(this.directory,"presence"))){let n=D(r);if(!n||n.schemaVersion!==v)continue;let o=this.withLiveness(n);o.state==="offline"&&e.includeOffline===!1||t.push(o)}return t.sort((r,n)=>(r.name??"").localeCompare(n.name??"")||r.sessionId.localeCompare(n.sessionId))}withLiveness(e){return Date.parse(e.heartbeatAt)+this.options.presenceTtlMs<this.now()?{...e,state:"offline"}:e}mailboxDir(e){return(0,w.join)(this.directory,"mailbox",$(e))}messagePath(e,t){return(0,w.join)(this.mailboxDir(e),`${$(t)}.json`)}messageLock(e){return(0,w.join)(this.directory,"locks",`message-${$(e)}.lock`)}send(e){let t=e.text.trim();if(!t)return{status:"refused",reason:"A message needs text."};if(!e.from.sessionId||!e.to.sessionId)return{status:"refused",reason:"A message needs a sender and a recipient session."};if(e.from.sessionId===e.to.sessionId)return{status:"refused",reason:"A session cannot message itself."};let r=this.getPresence(e.to.sessionId);if(!r)return{status:"refused",reason:`Unknown peer session ${e.to.sessionId}; it has never registered here.`};let n=this.getPresence(e.from.sessionId),o=this.now();if(this.listSent(e.from.sessionId).filter(p=>Date.parse(p.createdAt)>o-this.options.windowMs).length>=this.options.maxPerSenderPerWindow)return{status:"refused",reason:`Rate limit: ${this.options.maxPerSenderPerWindow} messages per ${Math.round(this.options.windowMs/1e3)}s.`};let a=0;if(e.causedBy){let p=this.find(e.causedBy);if(a=p?p.chainDepth+1:1,a>this.options.maxChainDepth)return{status:"refused",reason:`Causal chain depth ${a} exceeds ${this.options.maxChainDepth}; this exchange is looping.`}}if(e.idempotencyKey){let p=this.inbox(e.to.sessionId).find(V=>V.from.sessionId===e.from.sessionId&&V.idempotencyKey===e.idempotencyKey);if(p)return p.delivery.status==="held"?{status:"held",message:p,reason:p.delivery.reason??"held"}:{status:"queued",message:p}}let c=this.inbox(e.to.sessionId),x=c.filter(p=>p.delivery.status==="queued").length,m=c.filter(p=>p.delivery.status==="held").length,d=e.kind??"message",P=r.inboundPolicy==="hold"?`${re(r)} holds incoming messages for its human.`:r.inboundPolicy==="refuse"?void 0:n&&Le(n.posture,r.posture)?`Sender runs with ${n.posture} and the receiver with ${r.posture}; a message never moves trust upward.`:void 0;if(r.inboundPolicy==="refuse")return{status:"refused",reason:`${re(r)} is not accepting messages.`};if(P?m>=this.options.maxHeldPerRecipient:x>=this.options.maxQueuedPerRecipient)return{status:"refused",reason:`${re(r)} has ${P?"too many held":"too many queued"} messages; try again after it drains.`};let R=T(o),l={schemaVersion:v,messageId:`msg_${(0,ne.randomUUID)().replaceAll("-","").slice(0,20)}`,...e.idempotencyKey?{idempotencyKey:e.idempotencyKey}:{},kind:d,from:{sessionId:e.from.sessionId,...e.from.incarnationId?{incarnationId:e.from.incarnationId}:{},...e.from.name??n?.name?{name:e.from.name??n?.name}:{},...e.from.host??n?.host?{host:e.from.host??n?.host}:{},...e.from.workspace??n?.workspace?{workspace:e.from.workspace??n?.workspace}:{}},to:{sessionId:r.sessionId,...r.name?{name:r.name}:{},host:r.host,workspace:r.workspace},text:t,...e.correlationId?{correlationId:e.correlationId}:{},...e.causedBy?{causedBy:e.causedBy}:{},chainDepth:a,createdAt:R,updatedAt:R,expiresAt:T(o+(e.ttlMs??this.options.defaultTtlMs)),delivery:P?{status:"held",at:R,reason:P}:{status:"queued",at:R},...d==="task"?{task:{status:"offered",at:R}}:{}};return(0,u.mkdirSync)(this.mailboxDir(r.sessionId),{recursive:!0}),X(this.messageLock(l.messageId),"peer-message",()=>{ee(this.messagePath(r.sessionId,l.messageId),l)}),P?{status:"held",message:l,reason:P}:{status:"queued",message:l}}inbox(e){return te(this.mailboxDir(e)).map(t=>D(t)).filter(t=>!!t&&t.schemaVersion===v).sort((t,r)=>t.createdAt.localeCompare(r.createdAt)||t.messageId.localeCompare(r.messageId))}listSent(e){let t=[],r=(0,w.join)(this.directory,"mailbox");if(!(0,u.existsSync)(r))return t;for(let n of(0,u.readdirSync)(r)){let o=(0,w.join)(r,n);if((0,u.statSync)(o).isDirectory())for(let i of te(o)){let a=D(i);a&&a.schemaVersion===v&&a.from.sessionId===e&&t.push(a)}}return t.sort((n,o)=>n.createdAt.localeCompare(o.createdAt)||n.messageId.localeCompare(o.messageId))}find(e){let t=(0,w.join)(this.directory,"mailbox");if(!(0,u.existsSync)(t))return null;let r=`${$(e)}.json`;for(let n of(0,u.readdirSync)(t)){let o=(0,w.join)(t,n,r);if((0,u.existsSync)(o)){let i=D(o);return i&&i.schemaVersion===v?i:null}}return null}mutate(e,t){return X(this.messageLock(e),"peer-message",()=>{let r=this.find(e);if(!r)throw new Error(`Unknown peer message ${e}.`);let n=t(r);return n.updatedAt=T(this.now()),ee(this.messagePath(n.to.sessionId,n.messageId),n),n})}setDelivery(e,t,r={}){return this.mutate(e,n=>{if(!mt[n.delivery.status].includes(t))throw new Error(`Invalid peer delivery transition ${n.delivery.status} -> ${t} for ${e}.`);let o={status:t,at:T(this.now()),...r.reason?{reason:r.reason}:{},...r.incarnationId?{incarnationId:r.incarnationId}:{}},i={...n,delivery:o};return i.task&&!q(i.task.status)&&(t==="refused"||t==="expired"||t==="cancelled")&&(i.task={...i.task,status:"cancelled",at:o.at,endedAt:o.at,error:r.reason??`Delivery ${t}.`}),i})}release(e){return this.setDelivery(e,"queued",{reason:"Released by the receiving session."})}receive(e,t){return this.setDelivery(e,"received",{incarnationId:t})}setTask(e,t,r={}){return this.mutate(e,n=>{if(!n.task)throw new Error(`Peer message ${e} is a ${n.kind}, not a task.`);if(!gt[n.task.status].includes(t))throw new Error(`Invalid peer task transition ${n.task.status} -> ${t} for ${e}.`);let o=T(this.now()),i={...n.task,status:t,at:o};return t==="running"&&(i.startedAt=o,r.executorIncarnationId&&(i.executorIncarnationId=r.executorIncarnationId)),(q(t)||t==="recovery-required")&&(i.endedAt=o),r.result!==void 0&&(i.result=r.result),r.error!==void 0&&(i.error=r.error),r.reportMessageId&&(i.reportMessageId=r.reportMessageId),{...n,task:i}})}requestCancel(e,t="Cancelled by sender."){let r=this.find(e);if(!r)throw new Error(`Unknown peer message ${e}.`);return r.delivery.status==="queued"||r.delivery.status==="held"?this.setDelivery(e,"cancelled",{reason:t}):r.task&&!q(r.task.status)?r.task.status==="offered"||r.task.status==="accepted"||r.task.status==="blocked"||r.task.status==="recovery-required"?this.setTask(e,"cancelled",{error:t}):this.mutate(e,n=>({...n,task:{...n.task,cancelRequestedAt:T(this.now())}})):r}expireStale(e){let t=this.now(),r=[];for(let n of this.inbox(e))(n.delivery.status==="queued"||n.delivery.status==="held")&&Date.parse(n.expiresAt)<=t&&r.push(this.setDelivery(n.messageId,"expired",{reason:"Not received before it expired."}));return r}reconcileAbandonedTasks(e,t){let r=[];for(let n of this.inbox(e)){let o=n.task;!o||o.status!=="running"||o.executorIncarnationId!==t&&r.push(this.setTask(n.messageId,"recovery-required",{error:`The executing process (incarnation ${o.executorIncarnationId??"unknown"}) exited before the task finished; inspect its side effects before re-delegating.`}))}return r}compact(e=10080*60*1e3){let t=this.now()-e,r=0,n=0,o=(0,w.join)(this.directory,"mailbox");if((0,u.existsSync)(o))for(let i of(0,u.readdirSync)(o))for(let a of te((0,w.join)(o,i))){let c=D(a);if(!c)continue;c.delivery.status!=="queued"&&c.delivery.status!=="held"&&(!c.task||q(c.task.status)||c.task.status==="recovery-required")&&Date.parse(c.updatedAt)<t&&((0,u.rmSync)(a,{force:!0}),r+=1)}for(let i of this.listSessions())i.state==="offline"&&Date.parse(i.heartbeatAt)<t&&((0,u.rmSync)(this.presencePath(i.sessionId),{force:!0}),n+=1);return{messages:r,presence:n}}};function kt(){try{return(0,se.userInfo)().username}catch{return process.env.USERNAME??process.env.USER??"unknown"}}function Pt(s){let e={};for(let[t,r]of Object.entries(s))r!==void 0&&(e[t]=r);return e}0&&(module.exports={AGENT_DAEMON_PROTOCOL_VERSION,AgentDaemonClient,AgentDaemonServer,AgentEventStore,AgentRunController,AgentRunStore,MonitorManager,MonitorStopTool,MonitorTool,OtelExporter,PEER_MESSAGE_DEFAULT_TTL_MS,PEER_PRESENCE_TTL_MS,PEER_SCHEMA_VERSION,PEER_TASK_TERMINAL_STATUSES,PeerMessagingStore,UsageAccumulator,UsageLedger,WorkflowPlanner,WorkflowRuntime,WorkflowStore,acquireControlPlaneLock,createAgentRunId,defaultPeerDirectory,getAgentRunDir,getAgentRunStoreDir,isPeerTaskTerminal,movesTrustUpward,peerShortId,renderPeerLabel,resolvePeerTarget,toPeerPosture});