@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.
- package/README.md +50 -5
- package/dist/halo-agent.d.ts +45 -7
- package/dist/halo-agent.d.ts.map +1 -1
- package/dist/halo.d.ts +13 -2
- package/dist/halo.d.ts.map +1 -1
- package/dist/index.cjs +6934 -0
- package/dist/index.cjs.map +1 -0
- package/dist/index.d.ts +8 -4
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +6895 -5
- package/dist/index.js.map +1 -1
- package/dist/model-adapter.d.ts +20 -8
- package/dist/model-adapter.d.ts.map +1 -1
- package/dist/sandbox.d.ts +78 -0
- package/dist/sandbox.d.ts.map +1 -0
- package/dist/session-impl.d.ts +34 -6
- package/dist/session-impl.d.ts.map +1 -1
- package/dist/session.d.ts +92 -2
- package/dist/session.d.ts.map +1 -1
- package/dist/skills.d.ts +27 -0
- package/dist/skills.d.ts.map +1 -0
- package/dist/tool.d.ts +10 -13
- package/dist/tool.d.ts.map +1 -1
- package/dist/tools-builtin.d.ts +12 -0
- package/dist/tools-builtin.d.ts.map +1 -0
- package/dist/types.d.ts +11 -0
- package/dist/types.d.ts.map +1 -1
- package/package.json +13 -8
- package/dist/halo-agent.js +0 -95
- package/dist/halo-agent.js.map +0 -1
- package/dist/halo-session.d.ts +0 -60
- package/dist/halo-session.d.ts.map +0 -1
- package/dist/halo-session.js +0 -80
- package/dist/halo-session.js.map +0 -1
- package/dist/halo.js +0 -20
- package/dist/halo.js.map +0 -1
- package/dist/log.js +0 -41
- package/dist/log.js.map +0 -1
- package/dist/model-adapter.js +0 -2
- package/dist/model-adapter.js.map +0 -1
- package/dist/prefix.js +0 -84
- package/dist/prefix.js.map +0 -1
- package/dist/session-impl.js +0 -308
- package/dist/session-impl.js.map +0 -1
- package/dist/session.js +0 -2
- package/dist/session.js.map +0 -1
- package/dist/strategies.js +0 -2
- package/dist/strategies.js.map +0 -1
- package/dist/tool-utils.js +0 -36
- package/dist/tool-utils.js.map +0 -1
- package/dist/tool.js +0 -23
- package/dist/tool.js.map +0 -1
- package/dist/types.js +0 -2
- package/dist/types.js.map +0 -1
package/dist/tool-utils.js
DELETED
|
@@ -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
|
package/dist/tool-utils.js.map
DELETED
|
@@ -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
package/dist/types.js.map
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"types.js","sourceRoot":"","sources":["../src/types.ts"],"names":[],"mappings":""}
|