@kolisachint/hoocode-agent 0.5.47 → 0.5.49

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 (40) hide show
  1. package/CHANGELOG.md +19 -0
  2. package/dist/core/agent-session-retry.d.ts.map +1 -1
  3. package/dist/core/agent-session-retry.js +10 -1
  4. package/dist/core/agent-session-retry.js.map +1 -1
  5. package/dist/core/session-identity.d.ts +10 -0
  6. package/dist/core/session-identity.d.ts.map +1 -1
  7. package/dist/core/session-identity.js +48 -0
  8. package/dist/core/session-identity.js.map +1 -1
  9. package/dist/core/slash-commands.d.ts.map +1 -1
  10. package/dist/core/slash-commands.js +1 -1
  11. package/dist/core/slash-commands.js.map +1 -1
  12. package/dist/core/system-prompt.d.ts.map +1 -1
  13. package/dist/core/system-prompt.js +1 -0
  14. package/dist/core/system-prompt.js.map +1 -1
  15. package/dist/core/tools/edit-diff.d.ts +7 -3
  16. package/dist/core/tools/edit-diff.d.ts.map +1 -1
  17. package/dist/core/tools/edit-diff.js +156 -65
  18. package/dist/core/tools/edit-diff.js.map +1 -1
  19. package/dist/core/tools/read.d.ts.map +1 -1
  20. package/dist/core/tools/read.js +5 -4
  21. package/dist/core/tools/read.js.map +1 -1
  22. package/dist/modes/interactive/command-executor.d.ts +9 -3
  23. package/dist/modes/interactive/command-executor.d.ts.map +1 -1
  24. package/dist/modes/interactive/command-executor.js +16 -8
  25. package/dist/modes/interactive/command-executor.js.map +1 -1
  26. package/dist/modes/interactive/components/session-color-selector.d.ts.map +1 -1
  27. package/dist/modes/interactive/components/session-color-selector.js +5 -2
  28. package/dist/modes/interactive/components/session-color-selector.js.map +1 -1
  29. package/dist/modes/interactive/interactive-mode.d.ts.map +1 -1
  30. package/dist/modes/interactive/interactive-mode.js +7 -0
  31. package/dist/modes/interactive/interactive-mode.js.map +1 -1
  32. package/dist/utils/sleep.d.ts +9 -0
  33. package/dist/utils/sleep.d.ts.map +1 -1
  34. package/dist/utils/sleep.js +11 -1
  35. package/dist/utils/sleep.js.map +1 -1
  36. package/examples/extensions/custom-provider-anthropic/package.json +1 -1
  37. package/examples/extensions/custom-provider-gitlab-duo/package.json +1 -1
  38. package/examples/extensions/sandbox/package.json +1 -1
  39. package/examples/extensions/with-deps/package.json +1 -1
  40. package/package.json +4 -4
@@ -1,5 +1,14 @@
1
1
  /**
2
2
  * Sleep helper that respects abort signal.
3
+ *
4
+ * The delay is clamped, because `setTimeout` holds it in a signed 32-bit
5
+ * integer and anything larger is not rejected but silently replaced with 1ms.
6
+ * A caller that computed a long wait — a backoff, a server-requested
7
+ * retry-after — would get the shortest possible one instead, turning a pause
8
+ * into a hot loop at exactly the moment the pause mattered most. Waiting 24
9
+ * days instead of 28 is wrong too, but it is wrong in the direction that does
10
+ * no damage, and callers with a genuinely long wait should be declining to
11
+ * wait rather than sleeping through it.
3
12
  */
4
13
  export declare function sleep(ms: number, signal?: AbortSignal): Promise<void>;
5
14
  //# sourceMappingURL=sleep.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"sleep.d.ts","sourceRoot":"","sources":["../../src/utils/sleep.ts"],"names":[],"mappings":"AAAA;;GAEG;AACH,wBAAgB,KAAK,CAAC,EAAE,EAAE,MAAM,EAAE,MAAM,CAAC,EAAE,WAAW,GAAG,OAAO,CAAC,IAAI,CAAC,CAcrE","sourcesContent":["/**\n * Sleep helper that respects abort signal.\n */\nexport function sleep(ms: number, signal?: AbortSignal): Promise<void> {\n\treturn new Promise((resolve, reject) => {\n\t\tif (signal?.aborted) {\n\t\t\treject(new Error(\"Aborted\"));\n\t\t\treturn;\n\t\t}\n\n\t\tconst timeout = setTimeout(resolve, ms);\n\n\t\tsignal?.addEventListener(\"abort\", () => {\n\t\t\tclearTimeout(timeout);\n\t\t\treject(new Error(\"Aborted\"));\n\t\t});\n\t});\n}\n"]}
1
+ {"version":3,"file":"sleep.d.ts","sourceRoot":"","sources":["../../src/utils/sleep.ts"],"names":[],"mappings":"AAEA;;;;;;;;;;;GAWG;AACH,wBAAgB,KAAK,CAAC,EAAE,EAAE,MAAM,EAAE,MAAM,CAAC,EAAE,WAAW,GAAG,OAAO,CAAC,IAAI,CAAC,CAcrE","sourcesContent":["import { MAX_TIMER_DELAY_MS } from \"@kolisachint/hoocode-ai\";\n\n/**\n * Sleep helper that respects abort signal.\n *\n * The delay is clamped, because `setTimeout` holds it in a signed 32-bit\n * integer and anything larger is not rejected but silently replaced with 1ms.\n * A caller that computed a long wait — a backoff, a server-requested\n * retry-after — would get the shortest possible one instead, turning a pause\n * into a hot loop at exactly the moment the pause mattered most. Waiting 24\n * days instead of 28 is wrong too, but it is wrong in the direction that does\n * no damage, and callers with a genuinely long wait should be declining to\n * wait rather than sleeping through it.\n */\nexport function sleep(ms: number, signal?: AbortSignal): Promise<void> {\n\treturn new Promise((resolve, reject) => {\n\t\tif (signal?.aborted) {\n\t\t\treject(new Error(\"Aborted\"));\n\t\t\treturn;\n\t\t}\n\n\t\tconst timeout = setTimeout(resolve, Math.min(Math.max(0, ms), MAX_TIMER_DELAY_MS));\n\n\t\tsignal?.addEventListener(\"abort\", () => {\n\t\t\tclearTimeout(timeout);\n\t\t\treject(new Error(\"Aborted\"));\n\t\t});\n\t});\n}\n"]}
@@ -1,5 +1,15 @@
1
+ import { MAX_TIMER_DELAY_MS } from "@kolisachint/hoocode-ai";
1
2
  /**
2
3
  * Sleep helper that respects abort signal.
4
+ *
5
+ * The delay is clamped, because `setTimeout` holds it in a signed 32-bit
6
+ * integer and anything larger is not rejected but silently replaced with 1ms.
7
+ * A caller that computed a long wait — a backoff, a server-requested
8
+ * retry-after — would get the shortest possible one instead, turning a pause
9
+ * into a hot loop at exactly the moment the pause mattered most. Waiting 24
10
+ * days instead of 28 is wrong too, but it is wrong in the direction that does
11
+ * no damage, and callers with a genuinely long wait should be declining to
12
+ * wait rather than sleeping through it.
3
13
  */
4
14
  export function sleep(ms, signal) {
5
15
  return new Promise((resolve, reject) => {
@@ -7,7 +17,7 @@ export function sleep(ms, signal) {
7
17
  reject(new Error("Aborted"));
8
18
  return;
9
19
  }
10
- const timeout = setTimeout(resolve, ms);
20
+ const timeout = setTimeout(resolve, Math.min(Math.max(0, ms), MAX_TIMER_DELAY_MS));
11
21
  signal?.addEventListener("abort", () => {
12
22
  clearTimeout(timeout);
13
23
  reject(new Error("Aborted"));
@@ -1 +1 @@
1
- {"version":3,"file":"sleep.js","sourceRoot":"","sources":["../../src/utils/sleep.ts"],"names":[],"mappings":"AAAA;;GAEG;AACH,MAAM,UAAU,KAAK,CAAC,EAAU,EAAE,MAAoB,EAAiB;IACtE,OAAO,IAAI,OAAO,CAAC,CAAC,OAAO,EAAE,MAAM,EAAE,EAAE,CAAC;QACvC,IAAI,MAAM,EAAE,OAAO,EAAE,CAAC;YACrB,MAAM,CAAC,IAAI,KAAK,CAAC,SAAS,CAAC,CAAC,CAAC;YAC7B,OAAO;QACR,CAAC;QAED,MAAM,OAAO,GAAG,UAAU,CAAC,OAAO,EAAE,EAAE,CAAC,CAAC;QAExC,MAAM,EAAE,gBAAgB,CAAC,OAAO,EAAE,GAAG,EAAE,CAAC;YACvC,YAAY,CAAC,OAAO,CAAC,CAAC;YACtB,MAAM,CAAC,IAAI,KAAK,CAAC,SAAS,CAAC,CAAC,CAAC;QAAA,CAC7B,CAAC,CAAC;IAAA,CACH,CAAC,CAAC;AAAA,CACH","sourcesContent":["/**\n * Sleep helper that respects abort signal.\n */\nexport function sleep(ms: number, signal?: AbortSignal): Promise<void> {\n\treturn new Promise((resolve, reject) => {\n\t\tif (signal?.aborted) {\n\t\t\treject(new Error(\"Aborted\"));\n\t\t\treturn;\n\t\t}\n\n\t\tconst timeout = setTimeout(resolve, ms);\n\n\t\tsignal?.addEventListener(\"abort\", () => {\n\t\t\tclearTimeout(timeout);\n\t\t\treject(new Error(\"Aborted\"));\n\t\t});\n\t});\n}\n"]}
1
+ {"version":3,"file":"sleep.js","sourceRoot":"","sources":["../../src/utils/sleep.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,kBAAkB,EAAE,MAAM,yBAAyB,CAAC;AAE7D;;;;;;;;;;;GAWG;AACH,MAAM,UAAU,KAAK,CAAC,EAAU,EAAE,MAAoB,EAAiB;IACtE,OAAO,IAAI,OAAO,CAAC,CAAC,OAAO,EAAE,MAAM,EAAE,EAAE,CAAC;QACvC,IAAI,MAAM,EAAE,OAAO,EAAE,CAAC;YACrB,MAAM,CAAC,IAAI,KAAK,CAAC,SAAS,CAAC,CAAC,CAAC;YAC7B,OAAO;QACR,CAAC;QAED,MAAM,OAAO,GAAG,UAAU,CAAC,OAAO,EAAE,IAAI,CAAC,GAAG,CAAC,IAAI,CAAC,GAAG,CAAC,CAAC,EAAE,EAAE,CAAC,EAAE,kBAAkB,CAAC,CAAC,CAAC;QAEnF,MAAM,EAAE,gBAAgB,CAAC,OAAO,EAAE,GAAG,EAAE,CAAC;YACvC,YAAY,CAAC,OAAO,CAAC,CAAC;YACtB,MAAM,CAAC,IAAI,KAAK,CAAC,SAAS,CAAC,CAAC,CAAC;QAAA,CAC7B,CAAC,CAAC;IAAA,CACH,CAAC,CAAC;AAAA,CACH","sourcesContent":["import { MAX_TIMER_DELAY_MS } from \"@kolisachint/hoocode-ai\";\n\n/**\n * Sleep helper that respects abort signal.\n *\n * The delay is clamped, because `setTimeout` holds it in a signed 32-bit\n * integer and anything larger is not rejected but silently replaced with 1ms.\n * A caller that computed a long wait — a backoff, a server-requested\n * retry-after — would get the shortest possible one instead, turning a pause\n * into a hot loop at exactly the moment the pause mattered most. Waiting 24\n * days instead of 28 is wrong too, but it is wrong in the direction that does\n * no damage, and callers with a genuinely long wait should be declining to\n * wait rather than sleeping through it.\n */\nexport function sleep(ms: number, signal?: AbortSignal): Promise<void> {\n\treturn new Promise((resolve, reject) => {\n\t\tif (signal?.aborted) {\n\t\t\treject(new Error(\"Aborted\"));\n\t\t\treturn;\n\t\t}\n\n\t\tconst timeout = setTimeout(resolve, Math.min(Math.max(0, ms), MAX_TIMER_DELAY_MS));\n\n\t\tsignal?.addEventListener(\"abort\", () => {\n\t\t\tclearTimeout(timeout);\n\t\t\treject(new Error(\"Aborted\"));\n\t\t});\n\t});\n}\n"]}
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@kolisachint/hoocode-extension-custom-provider-anthropic",
3
3
  "private": true,
4
- "version": "0.3.47",
4
+ "version": "0.3.49",
5
5
  "type": "module",
6
6
  "engines": {
7
7
  "bun": ">=1.0.0"
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@kolisachint/hoocode-extension-custom-provider-gitlab-duo",
3
3
  "private": true,
4
- "version": "0.3.47",
4
+ "version": "0.3.49",
5
5
  "type": "module",
6
6
  "engines": {
7
7
  "bun": ">=1.0.0"
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@kolisachint/hoocode-extension-sandbox",
3
3
  "private": true,
4
- "version": "0.3.47",
4
+ "version": "0.3.49",
5
5
  "type": "module",
6
6
  "engines": {
7
7
  "bun": ">=1.0.0"
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@kolisachint/hoocode-extension-with-deps",
3
3
  "private": true,
4
- "version": "0.3.47",
4
+ "version": "0.3.49",
5
5
  "type": "module",
6
6
  "engines": {
7
7
  "bun": ">=1.0.0"
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@kolisachint/hoocode-agent",
3
- "version": "0.5.47",
3
+ "version": "0.5.49",
4
4
  "description": "Coding agent CLI with read, bash, edit, write tools and session management",
5
5
  "type": "module",
6
6
  "hoocodeConfig": {
@@ -50,9 +50,9 @@
50
50
  "prepublishOnly": "npm run clean && npm run build"
51
51
  },
52
52
  "dependencies": {
53
- "@kolisachint/hoocode-agent-core": "^0.5.47",
54
- "@kolisachint/hoocode-ai": "^0.5.47",
55
- "@kolisachint/hoocode-tui": "^0.5.47",
53
+ "@kolisachint/hoocode-agent-core": "^0.5.49",
54
+ "@kolisachint/hoocode-ai": "^0.5.49",
55
+ "@kolisachint/hoocode-tui": "^0.5.49",
56
56
  "@silvia-odwyer/photon-node": "^0.3.4",
57
57
  "chalk": "^5.5.0",
58
58
  "cli-highlight": "^2.1.11",