@anhlp/alp-paseo 0.0.0-beta.2 → 0.0.1-beta.4

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 (106) hide show
  1. package/NOTICE +9 -6
  2. package/README.md +86 -26
  3. package/client/library.tsx +22 -6
  4. package/package.json +21 -16
  5. package/paseo-plugin.json +1 -1
  6. package/server/dist/THIRD-PARTY-NOTICES.txt +2 -2
  7. package/server/dist/alpd.js +10897 -3514
  8. package/server/dist/compat.js +76 -0
  9. package/server/dist/index.js +23033 -6235
  10. package/server/dist/library.js +148 -42
  11. package/server/dist/main.js +12316 -2191
  12. package/server/dist/mapping.js +96 -44
  13. package/server/dist/panel/library.js +148 -42
  14. package/server/dist/panel/mapping.js +96 -44
  15. package/server/dist/panel/tasks.js +32 -2
  16. package/server/dist/panel/usage.js +38 -5
  17. package/server/dist/paseo/agents.js +9020 -335
  18. package/server/dist/paseo/checkout.js +111 -208
  19. package/server/dist/paseo/create-receipts.js +281 -0
  20. package/server/dist/paseo/files.js +137 -18
  21. package/server/dist/paseo/gateway.js +42 -6
  22. package/server/dist/paseo/git.js +375 -0
  23. package/server/dist/paseo/index.js +11737 -1821
  24. package/server/dist/paseo/plugins.js +173 -67
  25. package/server/dist/paseo/prompt-content.js +43 -0
  26. package/server/dist/paseo/providers.js +44 -3
  27. package/server/dist/paseo/quiet.js +1 -5
  28. package/server/dist/paseo/relay.js +3 -2
  29. package/server/dist/paseo/terminals.js +23618 -0
  30. package/server/dist/paseo/timeline-store.js +2 -2
  31. package/server/dist/paseo/uploads.js +22303 -0
  32. package/server/dist/paseo/workspaces.js +876 -192
  33. package/server/dist/provider-core.js +457 -9
  34. package/server/dist/provider-prompt.js +220 -0
  35. package/server/dist/provider.js +10495 -3016
  36. package/server/dist/remote/index.js +460 -19
  37. package/server/dist/remote/link.js +32 -2
  38. package/server/dist/remote/panels.js +51 -6
  39. package/server/dist/remote/provider.js +1219 -793
  40. package/server/dist/session-usage.js +15 -0
  41. package/server/dist/tasks.js +32 -2
  42. package/server/dist/upload-names.js +30 -0
  43. package/server/dist/uploads.js +84 -0
  44. package/server/dist/usage.js +38 -5
  45. package/server/dist/web.js +59 -102
  46. package/shared/library.ts +2 -0
  47. package/server/dist/web-app/NOTICE.txt +0 -18
  48. package/server/dist/web-app/THIRD-PARTY-NOTICES.txt +0 -5483
  49. package/server/dist/web-app/THIRD-PARTY-NOTICES.txt.br +0 -0
  50. package/server/dist/web-app/THIRD-PARTY-NOTICES.txt.gz +0 -0
  51. package/server/dist/web-app/_expo/static/css/xterm-3bb1704bf6cb0876640973dc0244b4cb.css +0 -1
  52. package/server/dist/web-app/_expo/static/css/xterm-3bb1704bf6cb0876640973dc0244b4cb.css.br +0 -0
  53. package/server/dist/web-app/_expo/static/css/xterm-3bb1704bf6cb0876640973dc0244b4cb.css.gz +0 -0
  54. package/server/dist/web-app/_expo/static/js/web/desktop-attachment-bridge-6af9b585f6d25fdb5938533f7aa5a167.js +0 -2
  55. package/server/dist/web-app/_expo/static/js/web/desktop-attachment-store-4ae9267243fd80b0b9605252601a21f3.js +0 -2
  56. package/server/dist/web-app/_expo/static/js/web/desktop-attachment-store-4ae9267243fd80b0b9605252601a21f3.js.br +0 -0
  57. package/server/dist/web-app/_expo/static/js/web/desktop-attachment-store-4ae9267243fd80b0b9605252601a21f3.js.gz +0 -0
  58. package/server/dist/web-app/_expo/static/js/web/index-c01174e6924afca25f226efae0b2a3ae.js +0 -18742
  59. package/server/dist/web-app/_expo/static/js/web/index-c01174e6924afca25f226efae0b2a3ae.js.br +0 -0
  60. package/server/dist/web-app/_expo/static/js/web/index-c01174e6924afca25f226efae0b2a3ae.js.gz +0 -0
  61. package/server/dist/web-app/_expo/static/js/web/indexeddb-attachment-store-5c75739712558f24273a6497f02f315b.js +0 -2
  62. package/server/dist/web-app/_expo/static/js/web/indexeddb-attachment-store-5c75739712558f24273a6497f02f315b.js.br +0 -0
  63. package/server/dist/web-app/_expo/static/js/web/indexeddb-attachment-store-5c75739712558f24273a6497f02f315b.js.gz +0 -0
  64. package/server/dist/web-app/_expo/static/js/web/native-file-attachment-store-e614dc34238b4482a273236cd9c323b6.js +0 -4
  65. package/server/dist/web-app/_expo/static/js/web/native-file-attachment-store-e614dc34238b4482a273236cd9c323b6.js.br +0 -0
  66. package/server/dist/web-app/_expo/static/js/web/native-file-attachment-store-e614dc34238b4482a273236cd9c323b6.js.gz +0 -0
  67. package/server/dist/web-app/alp-token.js +0 -12
  68. package/server/dist/web-app/alp-web-app.json +0 -26
  69. package/server/dist/web-app/apple-touch-icon.png +0 -0
  70. package/server/dist/web-app/assets/__node_modules/@react-navigation/elements/lib/module/assets/back-icon-mask.0a328cd9c1afd0afe8e3b1ec5165b1b4.png +0 -0
  71. package/server/dist/web-app/assets/__node_modules/@react-navigation/elements/lib/module/assets/back-icon.35ba0eaec5a4f5ed12ca16fabeae451d.png +0 -0
  72. package/server/dist/web-app/assets/__node_modules/@react-navigation/elements/lib/module/assets/clear-icon.c94f6478e7ae0cdd9f15de1fcb9e5e55.png +0 -0
  73. package/server/dist/web-app/assets/__node_modules/@react-navigation/elements/lib/module/assets/clear-icon.c94f6478e7ae0cdd9f15de1fcb9e5e55@2x.png +0 -0
  74. package/server/dist/web-app/assets/__node_modules/@react-navigation/elements/lib/module/assets/clear-icon.c94f6478e7ae0cdd9f15de1fcb9e5e55@3x.png +0 -0
  75. package/server/dist/web-app/assets/__node_modules/@react-navigation/elements/lib/module/assets/clear-icon.c94f6478e7ae0cdd9f15de1fcb9e5e55@4x.png +0 -0
  76. package/server/dist/web-app/assets/__node_modules/@react-navigation/elements/lib/module/assets/close-icon.808e1b1b9b53114ec2838071a7e6daa7.png +0 -0
  77. package/server/dist/web-app/assets/__node_modules/@react-navigation/elements/lib/module/assets/close-icon.808e1b1b9b53114ec2838071a7e6daa7@2x.png +0 -0
  78. package/server/dist/web-app/assets/__node_modules/@react-navigation/elements/lib/module/assets/close-icon.808e1b1b9b53114ec2838071a7e6daa7@3x.png +0 -0
  79. package/server/dist/web-app/assets/__node_modules/@react-navigation/elements/lib/module/assets/close-icon.808e1b1b9b53114ec2838071a7e6daa7@4x.png +0 -0
  80. package/server/dist/web-app/assets/__node_modules/@react-navigation/elements/lib/module/assets/search-icon.286d67d3f74808a60a78d3ebf1a5fb57.png +0 -0
  81. package/server/dist/web-app/assets/__node_modules/expo-router/assets/arrow_down.017bc6ba3fc25503e5eb5e53826d48a8.png +0 -0
  82. package/server/dist/web-app/assets/__node_modules/expo-router/assets/error.d1ea1496f9057eb392d5bbf3732a61b7.png +0 -0
  83. package/server/dist/web-app/assets/__node_modules/expo-router/assets/file.19eeb73b9593a38f8e9f418337fc7d10.png +0 -0
  84. package/server/dist/web-app/assets/__node_modules/expo-router/assets/forward.d8b800c443b8972542883e0b9de2bdc6.png +0 -0
  85. package/server/dist/web-app/assets/__node_modules/expo-router/assets/pkg.ab19f4cbc543357183a20571f68380a3.png +0 -0
  86. package/server/dist/web-app/assets/__node_modules/expo-router/assets/sitemap.412dd9275b6b48ad28f5e3d81bb1f626.png +0 -0
  87. package/server/dist/web-app/assets/__node_modules/expo-router/assets/unmatched.20e71bdf79e3a97bf55fd9e164041578.png +0 -0
  88. package/server/dist/web-app/assets/assets/images/favicon-dark-attention.7b1f41432deecb841fbf71fe6fe81258.png +0 -0
  89. package/server/dist/web-app/assets/assets/images/favicon-dark-running.a4ee272abf692e713606fbcffb2eaadb.png +0 -0
  90. package/server/dist/web-app/assets/assets/images/favicon-dark.e781e045425270913385c8e26c706dc7.png +0 -0
  91. package/server/dist/web-app/assets/assets/images/favicon-light-attention.7b1f41432deecb841fbf71fe6fe81258.png +0 -0
  92. package/server/dist/web-app/assets/assets/images/favicon-light-running.a4ee272abf692e713606fbcffb2eaadb.png +0 -0
  93. package/server/dist/web-app/assets/assets/images/favicon-light.e781e045425270913385c8e26c706dc7.png +0 -0
  94. package/server/dist/web-app/assets/assets/images/notification-icon.3bf81d33ddbf380606bdd248ba83e158.png +0 -0
  95. package/server/dist/web-app/favicon.ico +0 -0
  96. package/server/dist/web-app/favicon.ico.br +0 -0
  97. package/server/dist/web-app/favicon.ico.gz +0 -0
  98. package/server/dist/web-app/index.html +0 -101
  99. package/server/dist/web-app/index.html.br +0 -0
  100. package/server/dist/web-app/index.html.gz +0 -0
  101. package/server/dist/web-app/manifest.json +0 -31
  102. package/server/dist/web-app/metadata.json +0 -1
  103. package/server/dist/web-app/pwa-icon-192.png +0 -0
  104. package/server/dist/web-app/pwa-icon-512.png +0 -0
  105. package/server/dist/web-app/robots.txt +0 -2
  106. /package/{server/dist/web-app/LICENSE.paseo.txt → LICENSE.paseo.txt} +0 -0
@@ -412,11 +412,11 @@ var require_codegen = __commonJS({
412
412
  const rhs = this.rhs === void 0 ? "" : ` = ${this.rhs}`;
413
413
  return `${varKind} ${this.name}${rhs};` + _n;
414
414
  }
415
- optimizeNames(names, constants) {
415
+ optimizeNames(names, constants2) {
416
416
  if (!names[this.name.str])
417
417
  return;
418
418
  if (this.rhs)
419
- this.rhs = optimizeExpr(this.rhs, names, constants);
419
+ this.rhs = optimizeExpr(this.rhs, names, constants2);
420
420
  return this;
421
421
  }
422
422
  get names() {
@@ -433,10 +433,10 @@ var require_codegen = __commonJS({
433
433
  render({ _n }) {
434
434
  return `${this.lhs} = ${this.rhs};` + _n;
435
435
  }
436
- optimizeNames(names, constants) {
436
+ optimizeNames(names, constants2) {
437
437
  if (this.lhs instanceof code_1.Name && !names[this.lhs.str] && !this.sideEffects)
438
438
  return;
439
- this.rhs = optimizeExpr(this.rhs, names, constants);
439
+ this.rhs = optimizeExpr(this.rhs, names, constants2);
440
440
  return this;
441
441
  }
442
442
  get names() {
@@ -497,8 +497,8 @@ var require_codegen = __commonJS({
497
497
  optimizeNodes() {
498
498
  return `${this.code}` ? this : void 0;
499
499
  }
500
- optimizeNames(names, constants) {
501
- this.code = optimizeExpr(this.code, names, constants);
500
+ optimizeNames(names, constants2) {
501
+ this.code = optimizeExpr(this.code, names, constants2);
502
502
  return this;
503
503
  }
504
504
  get names() {
@@ -527,12 +527,12 @@ var require_codegen = __commonJS({
527
527
  }
528
528
  return nodes.length > 0 ? this : void 0;
529
529
  }
530
- optimizeNames(names, constants) {
530
+ optimizeNames(names, constants2) {
531
531
  const { nodes } = this;
532
532
  let i = nodes.length;
533
533
  while (i--) {
534
534
  const n = nodes[i];
535
- if (n.optimizeNames(names, constants))
535
+ if (n.optimizeNames(names, constants2))
536
536
  continue;
537
537
  subtractNames(names, n.names);
538
538
  nodes.splice(i, 1);
@@ -585,12 +585,12 @@ var require_codegen = __commonJS({
585
585
  return void 0;
586
586
  return this;
587
587
  }
588
- optimizeNames(names, constants) {
588
+ optimizeNames(names, constants2) {
589
589
  var _a3;
590
- this.else = (_a3 = this.else) === null || _a3 === void 0 ? void 0 : _a3.optimizeNames(names, constants);
591
- if (!(super.optimizeNames(names, constants) || this.else))
590
+ this.else = (_a3 = this.else) === null || _a3 === void 0 ? void 0 : _a3.optimizeNames(names, constants2);
591
+ if (!(super.optimizeNames(names, constants2) || this.else))
592
592
  return;
593
- this.condition = optimizeExpr(this.condition, names, constants);
593
+ this.condition = optimizeExpr(this.condition, names, constants2);
594
594
  return this;
595
595
  }
596
596
  get names() {
@@ -613,10 +613,10 @@ var require_codegen = __commonJS({
613
613
  render(opts) {
614
614
  return `for(${this.iteration})` + super.render(opts);
615
615
  }
616
- optimizeNames(names, constants) {
617
- if (!super.optimizeNames(names, constants))
616
+ optimizeNames(names, constants2) {
617
+ if (!super.optimizeNames(names, constants2))
618
618
  return;
619
- this.iteration = optimizeExpr(this.iteration, names, constants);
619
+ this.iteration = optimizeExpr(this.iteration, names, constants2);
620
620
  return this;
621
621
  }
622
622
  get names() {
@@ -652,10 +652,10 @@ var require_codegen = __commonJS({
652
652
  render(opts) {
653
653
  return `for(${this.varKind} ${this.name} ${this.loop} ${this.iterable})` + super.render(opts);
654
654
  }
655
- optimizeNames(names, constants) {
656
- if (!super.optimizeNames(names, constants))
655
+ optimizeNames(names, constants2) {
656
+ if (!super.optimizeNames(names, constants2))
657
657
  return;
658
- this.iterable = optimizeExpr(this.iterable, names, constants);
658
+ this.iterable = optimizeExpr(this.iterable, names, constants2);
659
659
  return this;
660
660
  }
661
661
  get names() {
@@ -697,11 +697,11 @@ var require_codegen = __commonJS({
697
697
  (_b = this.finally) === null || _b === void 0 ? void 0 : _b.optimizeNodes();
698
698
  return this;
699
699
  }
700
- optimizeNames(names, constants) {
700
+ optimizeNames(names, constants2) {
701
701
  var _a3, _b;
702
- super.optimizeNames(names, constants);
703
- (_a3 = this.catch) === null || _a3 === void 0 ? void 0 : _a3.optimizeNames(names, constants);
704
- (_b = this.finally) === null || _b === void 0 ? void 0 : _b.optimizeNames(names, constants);
702
+ super.optimizeNames(names, constants2);
703
+ (_a3 = this.catch) === null || _a3 === void 0 ? void 0 : _a3.optimizeNames(names, constants2);
704
+ (_b = this.finally) === null || _b === void 0 ? void 0 : _b.optimizeNames(names, constants2);
705
705
  return this;
706
706
  }
707
707
  get names() {
@@ -1002,7 +1002,7 @@ var require_codegen = __commonJS({
1002
1002
  function addExprNames(names, from) {
1003
1003
  return from instanceof code_1._CodeOrName ? addNames(names, from.names) : names;
1004
1004
  }
1005
- function optimizeExpr(expr, names, constants) {
1005
+ function optimizeExpr(expr, names, constants2) {
1006
1006
  if (expr instanceof code_1.Name)
1007
1007
  return replaceName(expr);
1008
1008
  if (!canOptimize(expr))
@@ -1017,14 +1017,14 @@ var require_codegen = __commonJS({
1017
1017
  return items;
1018
1018
  }, []));
1019
1019
  function replaceName(n) {
1020
- const c = constants[n.str];
1020
+ const c = constants2[n.str];
1021
1021
  if (c === void 0 || names[n.str] !== 1)
1022
1022
  return n;
1023
1023
  delete names[n.str];
1024
1024
  return c;
1025
1025
  }
1026
1026
  function canOptimize(e) {
1027
- return e instanceof code_1._Code && e._items.some((c) => c instanceof code_1.Name && names[c.str] === 1 && constants[c.str] !== void 0);
1027
+ return e instanceof code_1._Code && e._items.some((c) => c instanceof code_1.Name && names[c.str] === 1 && constants2[c.str] !== void 0);
1028
1028
  }
1029
1029
  }
1030
1030
  function subtractNames(names, from) {
@@ -8138,8 +8138,9 @@ function validateUserSettings(settings, source) {
8138
8138
  }
8139
8139
  if (settings.web !== void 0) {
8140
8140
  check3(object3(settings.web), "web must be an object");
8141
- const extra = Object.keys(settings.web).find((field) => !["enabled", "port", "relay"].includes(field));
8142
- check3(!extra, `unsupported web field '${extra}'; use enabled, port or relay`);
8141
+ const extra = Object.keys(settings.web).find((field) => !["enabled", "port", "relay", "permissions"].includes(field));
8142
+ check3(!extra, `unsupported web field '${extra}'; use enabled, port, relay or permissions`);
8143
+ if (settings.web.permissions !== void 0) check3(Array.isArray(settings.web.permissions) && settings.web.permissions.every((entry) => typeof entry === "string" && /^[a-z][a-z.]*$/.test(entry)), "web.permissions must be a list of permission names, such as files.read");
8143
8144
  const relay = settings.web.relay;
8144
8145
  if (relay !== void 0) {
8145
8146
  check3(object3(relay), "web.relay must be an object");
@@ -8680,7 +8681,7 @@ function launchCommand(command, args = [], env = process.env) {
8680
8681
  }
8681
8682
 
8682
8683
  // packages/core/src/library-edit.js
8683
- import { mkdir as mkdir2, rename as rename3, rm as rm3, stat as stat2, writeFile as writeFile3 } from "node:fs/promises";
8684
+ import { lstat as lstat3, mkdir as mkdir2, readdir as readdir4, rename as rename3, rm as rm3, stat as stat2, writeFile as writeFile3 } from "node:fs/promises";
8684
8685
  import { createHash as createHash2, randomUUID as randomUUID2 } from "node:crypto";
8685
8686
  import path8 from "node:path";
8686
8687
 
@@ -8736,6 +8737,42 @@ function base(scope, { root, library }, kind) {
8736
8737
  return fail3("INVALID_SCOPE", `Scope must be library or project, not '${scope}'`);
8737
8738
  }
8738
8739
  var revisionOf = (content) => content === void 0 ? null : createHash2("sha256").update(JSON.stringify(content)).digest("hex").slice(0, 16);
8740
+ function assertProjectDataContent(kind, content) {
8741
+ const deny = () => fail3("UNSAFE_LIBRARY_WRITE", "Project-data writes allow only instruction entries and non-executable agent configuration");
8742
+ if (!object6(content) || !["agents", "skills"].includes(kind)) deny();
8743
+ const keys2 = kind === "skills" ? ["body"] : ["instructions", "config"];
8744
+ if (Object.keys(content).some((key) => !keys2.includes(key))) deny();
8745
+ const text = kind === "skills" ? content.body : content.instructions;
8746
+ if (typeof text !== "string" || !text.trim()) deny();
8747
+ if (content.config !== void 0) {
8748
+ const config2 = content.config;
8749
+ if (!object6(config2)) deny();
8750
+ const allowed = ["description", "model", "thinking", "context", "autocompact"];
8751
+ if (Object.keys(config2).some((key) => !allowed.includes(key))) deny();
8752
+ for (const key of ["description", "thinking"]) if (config2[key] !== void 0 && typeof config2[key] !== "string") deny();
8753
+ if (config2.model !== void 0 && (typeof config2.model !== "string" || !/^(codex|claude):[^\s/\\:]{1,240}$/.test(config2.model))) deny();
8754
+ for (const key of ["context", "autocompact"]) if (config2[key] !== void 0 && !(typeof config2[key] === "string" || typeof config2[key] === "number" && Number.isFinite(config2[key]))) deny();
8755
+ }
8756
+ }
8757
+ async function projectDataEntry(kind, name, { scope, root, library, templates: templates2 }) {
8758
+ if (scope !== "project" || !root || !["agents", "skills"].includes(kind)) fail3("UNSAFE_LIBRARY_WRITE", "Project-data writes require project scope and agents or skills");
8759
+ nameOf(name);
8760
+ const directory = base(scope, { root, library }, kind);
8761
+ await safeEntryPaths(directory, kind, name);
8762
+ const found = await layers(kind, name, { root, library, templates: templates2 });
8763
+ if (found.library !== void 0 || found.builtin !== void 0) fail3("UNSAFE_LIBRARY_WRITE", "Project-data writes cannot shadow or reveal a library or built-in entry");
8764
+ if (found.project !== void 0) assertProjectDataContent(kind, found.project);
8765
+ const owned = path8.join(directory, kind, name);
8766
+ const files = await readdir4(owned).catch((error51) => {
8767
+ if (error51.code === "ENOENT") return [];
8768
+ throw error51;
8769
+ });
8770
+ const allowed = new Set(FILES[kind](name).map(([file2]) => path8.basename(file2)));
8771
+ for (const file2 of files) {
8772
+ const info = await lstat3(path8.join(owned, file2));
8773
+ if (!allowed.has(file2) || !info.isFile() || info.isSymbolicLink() || info.nlink !== 1) fail3("UNSAFE_LIBRARY_WRITE", "Project-data entries cannot contain sidecars, links or executable assets");
8774
+ }
8775
+ }
8739
8776
  async function safeEntryPaths(directory, kind, name) {
8740
8777
  for (const [file2] of FILES[kind](name)) {
8741
8778
  await assertNoSymlinks(directory, path8.join(kind, file2));
@@ -8933,9 +8970,13 @@ async function writeAtomic(file2, text) {
8933
8970
  await moveFile(temporary, file2);
8934
8971
  }
8935
8972
  var exists = (target) => stat2(target).then(() => true, () => false);
8936
- async function saveEntry(kind, name, content, { scope, root, library, templates: templates2, revision } = {}) {
8973
+ async function saveEntry(kind, name, content, { scope, root, library, templates: templates2, revision, policy } = {}) {
8937
8974
  kindOf(kind);
8938
8975
  nameOf(name);
8976
+ if (policy === "project-data") {
8977
+ assertProjectDataContent(kind, content);
8978
+ await projectDataEntry(kind, name, { scope, root, library, templates: templates2 });
8979
+ }
8939
8980
  const directory = base(scope, { root, library }, kind);
8940
8981
  await safeEntryPaths(directory, kind, name);
8941
8982
  await check(kind, name, content, { scope, root, library, templates: templates2 });
@@ -8957,9 +8998,10 @@ async function saveEntry(kind, name, content, { scope, root, library, templates:
8957
8998
  }
8958
8999
  return { revision: revisionOf(await readLayer(kind, name, directory)) };
8959
9000
  }
8960
- async function deleteEntry(kind, name, { scope, root, library, templates: templates2, revision } = {}) {
9001
+ async function deleteEntry(kind, name, { scope, root, library, templates: templates2, revision, policy } = {}) {
8961
9002
  kindOf(kind);
8962
9003
  nameOf(name);
9004
+ if (policy === "project-data") await projectDataEntry(kind, name, { scope, root, library, templates: templates2 });
8963
9005
  const directory = base(scope, { root, library }, kind);
8964
9006
  const current = await readLayer(kind, name, directory);
8965
9007
  if (current === void 0) fail3("NOT_FOUND", `No ${kind} entry '${name}' in the ${scope}`);
@@ -8975,14 +9017,25 @@ async function deleteEntry(kind, name, { scope, root, library, templates: templa
8975
9017
  const now = scope === "project" && found.library !== void 0 ? "library" : "builtin";
8976
9018
  return { removed: true, ...fallback !== void 0 ? { now } : {} };
8977
9019
  }
8978
- async function duplicateEntry(kind, from, to, { scope, root, library, templates: templates2 } = {}) {
9020
+ async function duplicateEntry(kind, from, to, { scope, root, library, templates: templates2, policy } = {}) {
9021
+ kindOf(kind);
9022
+ nameOf(from);
9023
+ nameOf(to);
9024
+ if (policy === "project-data") {
9025
+ await projectDataEntry(kind, from, { scope, root, library, templates: templates2 });
9026
+ await projectDataEntry(kind, to, { scope, root, library, templates: templates2 });
9027
+ }
8979
9028
  const { content } = await getEntry(kind, from, { root, library, templates: templates2 });
8980
- return saveEntry(kind, to, structuredClone(content), { scope, root, library, templates: templates2, revision: null });
9029
+ return saveEntry(kind, to, structuredClone(content), { scope, root, library, templates: templates2, revision: null, policy });
8981
9030
  }
8982
- async function renameEntry(kind, from, to, { scope, root, library, templates: templates2 } = {}) {
9031
+ async function renameEntry(kind, from, to, { scope, root, library, templates: templates2, policy } = {}) {
8983
9032
  kindOf(kind);
8984
9033
  nameOf(from);
8985
9034
  nameOf(to);
9035
+ if (policy === "project-data") {
9036
+ await projectDataEntry(kind, from, { scope, root, library, templates: templates2 });
9037
+ await projectDataEntry(kind, to, { scope, root, library, templates: templates2 });
9038
+ }
8986
9039
  const directory = base(scope, { root, library }, kind);
8987
9040
  const content = await readLayer(kind, from, directory);
8988
9041
  if (content === void 0) fail3("NOT_FOUND", `No ${kind} entry '${from}' in the ${scope}`);
@@ -9212,13 +9265,13 @@ async function probeAcp(provider, { cwd, timeoutMs = 2e4, discover = false } = {
9212
9265
  });
9213
9266
  if (result.protocolVersion !== 1) throw new Error(`${provider.label ?? provider.id} speaks ACP version ${result.protocolVersion}; ALP speaks version 1`);
9214
9267
  const info = result.agentInfo;
9215
- const offered = discover ? await session.request("session/new", { cwd, mcpServers: [] }) : void 0;
9268
+ const offered2 = discover ? await session.request("session/new", { cwd, mcpServers: [] }) : void 0;
9216
9269
  const choices = (list) => Array.isArray(list) ? list.filter((item) => typeof (item?.modelId ?? item?.id) === "string").map((item) => ({ id: item.modelId ?? item.id, label: typeof item.name === "string" && item.name ? item.name : item.modelId ?? item.id, ...typeof item.description === "string" && item.description ? { description: item.description } : {} })) : void 0;
9217
- const config2 = offered?.configOptions?.find((option2) => option2.category === "model" && option2.type === "select");
9218
- const modeConfig = offered?.configOptions?.find((option2) => option2.category === "mode" && option2.type === "select");
9270
+ const config2 = offered2?.configOptions?.find((option2) => option2.category === "model" && option2.type === "select");
9271
+ const modeConfig = offered2?.configOptions?.find((option2) => option2.category === "mode" && option2.type === "select");
9219
9272
  const flatten = (options2) => options2?.flatMap((option2) => option2.options ?? [option2]).map((option2) => ({ ...option2, id: option2.value }));
9220
- const modelState = offered?.models ?? (config2 ? { availableModels: flatten(config2.options), currentModelId: config2.currentValue } : void 0);
9221
- const modeState = offered?.modes ?? (modeConfig ? { availableModes: flatten(modeConfig.options), currentModeId: modeConfig.currentValue } : void 0);
9273
+ const modelState = offered2?.models ?? (config2 ? { availableModels: flatten(config2.options), currentModelId: config2.currentValue } : void 0);
9274
+ const modeState = offered2?.modes ?? (modeConfig ? { availableModes: flatten(modeConfig.options), currentModeId: modeConfig.currentValue } : void 0);
9222
9275
  const models2 = choices(modelState?.availableModels);
9223
9276
  const modes2 = choices(modeState?.availableModes);
9224
9277
  return {
@@ -9477,10 +9530,40 @@ var TAIL_BYTES = 256 * 1024;
9477
9530
  var MAX_FRAME = 16 * 1024 * 1024;
9478
9531
  var ERROR = Object.freeze({ failed: 1e3, notFound: 1001, forbidden: 1003, conflict: 1004, unavailable: 1005, protocol: 1006 });
9479
9532
  var RPC_ERROR = Object.freeze({ parseError: -32700, invalidRequest: -32600, methodNotFound: -32601, invalidParams: -32602 });
9480
- var CAPABILITY = Object.freeze({ attachAfter: "attach.after", promptReceipts: "prompt.receipts", extensionMethods: "extension.methods", team: "team", task: "task", library: "library", settingsLanguage: "settings.language", sessionListPage: "session.list.page", questionWatch: "question.watch", questionWatchTurns: "question.watch.turns", workspaceFiles: "workspace.files", workspaceFilesRead: "workspace.files.read", promptImages: "prompt.images" });
9533
+ var CAPABILITY = Object.freeze({ sessionInterruptTurn: "session.interrupt.turn", attachAfter: "attach.after", sessionHistory: "session.history", workspaceRegistry: "workspace.registry", workspaceWorktree: "workspace.worktree", workspaceGit: "workspace.git", promptReceipts: "prompt.receipts", extensionMethods: "extension.methods", team: "team", task: "task", library: "library", libraryProjectWrite: "library.project.write", settingsLanguage: "settings.language", sessionListPage: "session.list.page", questionWatch: "question.watch", questionWatchTurns: "question.watch.turns", sessionAttention: "session.attention", workspaceFiles: "workspace.files", workspaceFilesRead: "workspace.files.read", promptImages: "prompt.images", schedule: "schedule", attachments: "attachments", sessionFork: "session.fork", sessionRewind: "session.rewind", sessionReload: "session.reload", sessionResumeCommand: "session.resumeCommand", sessionConfigureLive: "session.configure.live", terminal: "terminal" });
9481
9534
  var PROMPT_IMAGES = Object.freeze({ mimeTypes: Object.freeze(["image/png", "image/jpeg", "image/gif", "image/webp"]), maxCount: 8, maxBytes: 5 * 1024 * 1024, maxTotalBytes: 11 * 1024 * 1024 });
9482
- var RPC_METHODS = Object.freeze(["assignment.recall", "board.list", "catalog.get", "daemon.hello", "daemon.pause", "daemon.pauses", "daemon.resume", "daemon.shutdown", "daemon.status", "daemon.usage", "extension.register", "extension.unregister", "library.delete", "library.duplicate", "library.get", "library.list", "library.models", "library.rename", "library.save", "library.skills.set", "question.answer", "question.list", "question.watch", "session.archive", "session.attach", "session.close", "session.configure", "session.create", "session.get", "session.interrupt", "session.list", "session.log", "session.message", "session.preview", "session.prompt", "session.release", "session.rename", "session.status", "settings.language.get", "settings.language.set", "task.create", "task.gate.resolve", "task.list", "task.update", "team.list", "workspace.files.list", "workspace.files.read", "workspace.files.search"]);
9535
+ var RPC_METHODS = Object.freeze(["assignment.recall", "attachment.abort", "attachment.begin", "attachment.chunk", "attachment.commit", "attachment.delete", "attachment.get", "board.list", "catalog.get", "daemon.hello", "daemon.pause", "daemon.pauses", "daemon.resume", "daemon.shutdown", "daemon.status", "daemon.usage", "extension.register", "extension.unregister", "library.delete", "library.duplicate", "library.get", "library.list", "library.models", "library.rename", "library.save", "library.skills.set", "project.list", "project.register", "project.remove", "question.answer", "question.list", "question.watch", "registry.owner", "registry.worktree", "schedule.cancel", "schedule.create", "schedule.get", "schedule.list", "session.archive", "session.attach", "session.attention.clear", "session.close", "session.configure", "session.configure.preview", "session.create", "session.fork", "session.get", "session.history", "session.interrupt", "session.list", "session.log", "session.message", "session.preview", "session.prompt", "session.release", "session.reload", "session.rename", "session.resumeCommand", "session.rewind", "session.status", "settings.language.get", "settings.language.set", "task.create", "task.gate.resolve", "task.list", "task.update", "team.list", "terminal.attach", "terminal.close", "terminal.create", "terminal.input", "terminal.list", "terminal.resize", "terminal.revoke", "workspace.files.list", "workspace.files.read", "workspace.files.search", "workspace.get", "workspace.git.diff", "workspace.git.status", "workspace.list", "workspace.update", "workspace.worktree.create", "workspace.worktree.options", "workspace.worktree.remove"]);
9483
9536
  var WORKSPACE_FILES = Object.freeze({ maxReadBytes: 1024 * 1024, maxListEntries: 1e3, maxPathLength: 4096 });
9537
+ var WORKSPACE_GIT = Object.freeze({ maxFileBytes: 1024 * 1024, maxTotalBytes: 2 * 1024 * 1024, maxUntracked: 200, maxStatusFiles: 1e3, maxRefLength: 255 });
9538
+ var ATTACHMENTS = Object.freeze({
9539
+ maxObjectBytes: 20 * 1024 * 1024,
9540
+ maxPerPrompt: 8,
9541
+ maxPromptBytes: 40 * 1024 * 1024,
9542
+ maxChunkBytes: 256 * 1024,
9543
+ maxActiveUploads: 2,
9544
+ maxPrincipalBytes: 200 * 1024 * 1024,
9545
+ maxDaemonBytes: 1024 * 1024 * 1024,
9546
+ uploadTimeoutMs: 60 * 60 * 1e3,
9547
+ unreferencedRetentionMs: 24 * 60 * 60 * 1e3,
9548
+ releasedGraceMs: 7 * 24 * 60 * 60 * 1e3,
9549
+ maxNameBytes: 255
9550
+ });
9551
+ var TERMINAL = Object.freeze({
9552
+ maxPerPrincipal: 4,
9553
+ maxPerDaemon: 16,
9554
+ maxInputBytes: 64 * 1024,
9555
+ maxOutputFrameBytes: 64 * 1024,
9556
+ replayBytes: 1024 * 1024,
9557
+ idleMs: 30 * 60 * 1e3,
9558
+ maxLifetimeMs: 8 * 60 * 60 * 1e3,
9559
+ reconnectMs: 60 * 1e3,
9560
+ minCols: 2,
9561
+ maxCols: 500,
9562
+ minRows: 1,
9563
+ maxRows: 200
9564
+ });
9565
+ var TERMINAL_LIMIT_KEYS = Object.freeze(["maxPerPrincipal", "maxPerDaemon", "maxInputBytes", "maxOutputFrameBytes", "replayBytes", "idleMs", "maxLifetimeMs", "reconnectMs"]);
9566
+ var ATTACHMENT_CHUNK_OVERHEAD = 64 * 1024;
9484
9567
 
9485
9568
  // packages/client/src/rpc/errors.js
9486
9569
  var BRAND = Symbol.for("@anhlp/alp-client/AlpClientError");
@@ -9553,6 +9636,17 @@ var templates_default = { "ALP.md": "# ALP project instructions\n\n## Working re
9553
9636
  // packages/runtime/src/board.ts
9554
9637
  var PIN_KINDS = ["claim", "decision", "finding"];
9555
9638
 
9639
+ // packages/runtime/src/attachments.ts
9640
+ import { constants, realpathSync } from "node:fs";
9641
+ var ATTACHMENT_ROUTES = Object.freeze({
9642
+ codex: Object.freeze(["file.path"]),
9643
+ claude: Object.freeze(["file.path"]),
9644
+ acp: Object.freeze([]),
9645
+ antigravity: Object.freeze([])
9646
+ });
9647
+ var NOFOLLOW = constants.O_NOFOLLOW ?? 0;
9648
+ var NONBLOCK = constants.O_NONBLOCK ?? 0;
9649
+
9556
9650
  // packages/core/src/tasks.js
9557
9651
  var TASK_TYPES = ["task", "bug", "feature", "chore", "epic"];
9558
9652
  var TASK_STATUSES = ["open", "in_progress", "review", "closed"];
@@ -24132,17 +24226,27 @@ var toolShapes = {
24132
24226
  body: external_exports.string().min(1).max(2e4),
24133
24227
  roles: external_exports.array(external_exports.string().min(1)).min(1).max(10),
24134
24228
  lessons: external_exports.array(external_exports.string().min(1).max(600)).max(50).optional(),
24135
- replace: external_exports.boolean().optional()
24229
+ replace: external_exports.boolean().optional(),
24230
+ requestId: external_exports.string().min(1).max(100).optional()
24136
24231
  },
24137
24232
  alp_issue: {
24138
24233
  action: external_exports.enum(["search", "create", "comment"]),
24139
24234
  target: external_exports.enum(["project", "alp"]),
24140
24235
  query: external_exports.string().min(1).max(200).optional(),
24236
+ requestId: external_exports.string().min(1).max(100).optional(),
24141
24237
  title: external_exports.string().min(1).max(200).optional(),
24142
24238
  body: external_exports.string().min(1).max(2e4).optional(),
24143
24239
  issue: external_exports.number().int().positive().optional(),
24144
24240
  labels: external_exports.array(external_exports.string().min(1).max(50)).max(10).optional()
24145
24241
  },
24242
+ alp_schedule: {
24243
+ action: external_exports.enum(["create", "list", "get", "cancel"]),
24244
+ dueAt: external_exports.string().min(1).max(80).optional(),
24245
+ prompt: external_exports.string().min(1).max(8e3).optional(),
24246
+ requestId: external_exports.string().min(1).max(200).optional(),
24247
+ id: external_exports.string().min(1).optional(),
24248
+ status: external_exports.enum(["pending", "delivered", "failed", "cancelled"]).optional()
24249
+ },
24146
24250
  alp_task: {
24147
24251
  action: external_exports.enum(["create", "update", "link", "start", "close", "reopen", "gate", "clear", "pour", "formulas", "show", "list", "ready"]),
24148
24252
  id: external_exports.string().min(1).optional(),
@@ -26275,7 +26379,9 @@ var libraryGet = defineRpc2({
26275
26379
  revision: external_exports.string().nullable(),
26276
26380
  usedBy: external_exports.array(external_exports.string()),
26277
26381
  /** Agents: the skills the library gives it by name (role-skills.json). */
26278
- librarySkills: external_exports.array(external_exports.string()).optional()
26382
+ librarySkills: external_exports.array(external_exports.string()).optional(),
26383
+ /** ALP remote mode: JSON Pointers of the values `content` holds as a secret marker, not as the value. */
26384
+ secrets: external_exports.array(external_exports.string()).optional()
26279
26385
  })
26280
26386
  });
26281
26387
  var librarySkills2 = defineRpc2({