@halo-sdk/core 1.0.0 → 1.0.1

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 (54) hide show
  1. package/README.md +50 -5
  2. package/dist/halo-agent.d.ts +45 -7
  3. package/dist/halo-agent.d.ts.map +1 -1
  4. package/dist/halo.d.ts +13 -2
  5. package/dist/halo.d.ts.map +1 -1
  6. package/dist/index.cjs +6934 -0
  7. package/dist/index.cjs.map +1 -0
  8. package/dist/index.d.ts +8 -4
  9. package/dist/index.d.ts.map +1 -1
  10. package/dist/index.js +6895 -5
  11. package/dist/index.js.map +1 -1
  12. package/dist/model-adapter.d.ts +20 -8
  13. package/dist/model-adapter.d.ts.map +1 -1
  14. package/dist/sandbox.d.ts +78 -0
  15. package/dist/sandbox.d.ts.map +1 -0
  16. package/dist/session-impl.d.ts +34 -6
  17. package/dist/session-impl.d.ts.map +1 -1
  18. package/dist/session.d.ts +92 -2
  19. package/dist/session.d.ts.map +1 -1
  20. package/dist/skills.d.ts +27 -0
  21. package/dist/skills.d.ts.map +1 -0
  22. package/dist/tool.d.ts +10 -13
  23. package/dist/tool.d.ts.map +1 -1
  24. package/dist/tools-builtin.d.ts +12 -0
  25. package/dist/tools-builtin.d.ts.map +1 -0
  26. package/dist/types.d.ts +11 -0
  27. package/dist/types.d.ts.map +1 -1
  28. package/package.json +13 -8
  29. package/dist/halo-agent.js +0 -95
  30. package/dist/halo-agent.js.map +0 -1
  31. package/dist/halo-session.d.ts +0 -60
  32. package/dist/halo-session.d.ts.map +0 -1
  33. package/dist/halo-session.js +0 -80
  34. package/dist/halo-session.js.map +0 -1
  35. package/dist/halo.js +0 -20
  36. package/dist/halo.js.map +0 -1
  37. package/dist/log.js +0 -41
  38. package/dist/log.js.map +0 -1
  39. package/dist/model-adapter.js +0 -2
  40. package/dist/model-adapter.js.map +0 -1
  41. package/dist/prefix.js +0 -84
  42. package/dist/prefix.js.map +0 -1
  43. package/dist/session-impl.js +0 -308
  44. package/dist/session-impl.js.map +0 -1
  45. package/dist/session.js +0 -2
  46. package/dist/session.js.map +0 -1
  47. package/dist/strategies.js +0 -2
  48. package/dist/strategies.js.map +0 -1
  49. package/dist/tool-utils.js +0 -36
  50. package/dist/tool-utils.js.map +0 -1
  51. package/dist/tool.js +0 -23
  52. package/dist/tool.js.map +0 -1
  53. package/dist/types.js +0 -2
  54. package/dist/types.js.map +0 -1
@@ -1,36 +0,0 @@
1
- /** Convert a named ToolDefinition to a ToolSpec. */
2
- export function definitionToSpec(name, def) {
3
- return {
4
- type: "function",
5
- function: {
6
- name,
7
- description: def.description,
8
- parameters: def.parameters,
9
- },
10
- };
11
- }
12
- /**
13
- * Normalize tools from either a flat array of ToolSpec objects or a
14
- * named record of ToolDefinition objects into a unified representation.
15
- */
16
- export function normalizeTools(
17
- // eslint-disable-next-line @typescript-eslint/no-explicit-any
18
- tools) {
19
- const executors = new Map();
20
- if (!tools)
21
- return { toolSpecs: [], executors };
22
- if (Array.isArray(tools)) {
23
- return { toolSpecs: tools, executors };
24
- }
25
- const specs = [];
26
- for (const [name, def] of Object.entries(tools)) {
27
- specs.push(definitionToSpec(name, def));
28
- if (def.execute) {
29
- executors.set(name,
30
- // eslint-disable-next-line @typescript-eslint/no-explicit-any
31
- def.execute);
32
- }
33
- }
34
- return { toolSpecs: specs, executors };
35
- }
36
- //# sourceMappingURL=tool-utils.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"tool-utils.js","sourceRoot":"","sources":["../src/tool-utils.ts"],"names":[],"mappings":"AAEA,oDAAoD;AACpD,MAAM,UAAU,gBAAgB,CAAC,IAAY,EAAE,GAAmB;IAChE,OAAO;QACL,IAAI,EAAE,UAAU;QAChB,QAAQ,EAAE;YACR,IAAI;YACJ,WAAW,EAAE,GAAG,CAAC,WAAW;YAC5B,UAAU,EAAE,GAAG,CAAC,UAAU;SAC3B;KACF,CAAC;AACJ,CAAC;AAQD;;;GAGG;AACH,MAAM,UAAU,cAAc;AAC5B,8DAA8D;AAC9D,KAAmE;IAEnE,MAAM,SAAS,GAAG,IAAI,GAAG,EAAuE,CAAC;IAEjG,IAAI,CAAC,KAAK;QAAE,OAAO,EAAE,SAAS,EAAE,EAAE,EAAE,SAAS,EAAE,CAAC;IAEhD,IAAI,KAAK,CAAC,OAAO,CAAC,KAAK,CAAC,EAAE,CAAC;QACzB,OAAO,EAAE,SAAS,EAAE,KAAK,EAAE,SAAS,EAAE,CAAC;IACzC,CAAC;IAED,MAAM,KAAK,GAAe,EAAE,CAAC;IAC7B,KAAK,MAAM,CAAC,IAAI,EAAE,GAAG,CAAC,IAAI,MAAM,CAAC,OAAO,CAAC,KAAK,CAAC,EAAE,CAAC;QAChD,KAAK,CAAC,IAAI,CAAC,gBAAgB,CAAC,IAAI,EAAE,GAAG,CAAC,CAAC,CAAC;QACxC,IAAI,GAAG,CAAC,OAAO,EAAE,CAAC;YAChB,SAAS,CAAC,GAAG,CACX,IAAI;YACJ,8DAA8D;YAC9D,GAAG,CAAC,OAAsE,CAC3E,CAAC;QACJ,CAAC;IACH,CAAC;IAED,OAAO,EAAE,SAAS,EAAE,KAAK,EAAE,SAAS,EAAE,CAAC;AACzC,CAAC"}
package/dist/tool.js DELETED
@@ -1,23 +0,0 @@
1
- /**
2
- * Create a tool definition with an optional built-in execute function.
3
- *
4
- * This is a **type-level identity** — at runtime it returns the input unchanged.
5
- * It exists purely for TypeScript generic inference on `TArgs`.
6
- *
7
- * @example
8
- * ```ts
9
- * const weatherTool = tool({
10
- * description: "Get the weather for a city",
11
- * parameters: {
12
- * type: "object",
13
- * properties: { city: { type: "string" } },
14
- * required: ["city"],
15
- * },
16
- * execute: async ({ city }) => `Sunny, 22°C in ${city}`,
17
- * });
18
- * ```
19
- */
20
- export function tool(def) {
21
- return def;
22
- }
23
- //# sourceMappingURL=tool.js.map
package/dist/tool.js.map DELETED
@@ -1 +0,0 @@
1
- {"version":3,"file":"tool.js","sourceRoot":"","sources":["../src/tool.ts"],"names":[],"mappings":"AAEA;;;;;;;;;;;;;;;;;;GAkBG;AACH,MAAM,UAAU,IAAI,CAClB,GAA0B;IAE1B,OAAO,GAAG,CAAC;AACb,CAAC"}
package/dist/types.js DELETED
@@ -1,2 +0,0 @@
1
- export {};
2
- //# sourceMappingURL=types.js.map
package/dist/types.js.map DELETED
@@ -1 +0,0 @@
1
- {"version":3,"file":"types.js","sourceRoot":"","sources":["../src/types.ts"],"names":[],"mappings":""}