@kirha/planner 0.1.0 → 0.1.2
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/dist/index.d.ts +2 -2
- package/dist/index.js +15 -4
- package/package.json +2 -2
package/dist/index.d.ts
CHANGED
|
@@ -14,8 +14,8 @@ export interface PlanOptions {
|
|
|
14
14
|
maxTokens?: number;
|
|
15
15
|
}
|
|
16
16
|
export declare class Plan {
|
|
17
|
-
|
|
18
|
-
|
|
17
|
+
steps: PlanStep[];
|
|
18
|
+
think?: string | undefined;
|
|
19
19
|
constructor(steps: PlanStep[], think?: string | undefined);
|
|
20
20
|
execute(options: ExecuteOptions): Promise<StepResult[]>;
|
|
21
21
|
}
|
package/dist/index.js
CHANGED
|
@@ -20433,9 +20433,19 @@ var ParamSchema = exports_external.lazy(() => exports_external.union([
|
|
|
20433
20433
|
exports_external.record(exports_external.string(), ParamSchema)
|
|
20434
20434
|
]));
|
|
20435
20435
|
var ToolStepSchema = exports_external.object({
|
|
20436
|
-
toolName: exports_external.string(),
|
|
20437
|
-
|
|
20436
|
+
toolName: exports_external.string().optional(),
|
|
20437
|
+
tool: exports_external.string().optional(),
|
|
20438
|
+
arguments: exports_external.record(exports_external.string(), exports_external.unknown()).optional(),
|
|
20439
|
+
args: exports_external.record(exports_external.string(), exports_external.unknown()).optional(),
|
|
20440
|
+
params: exports_external.record(exports_external.string(), exports_external.unknown()).optional(),
|
|
20441
|
+
parameters: exports_external.record(exports_external.string(), exports_external.unknown()).optional(),
|
|
20438
20442
|
thought: exports_external.string().optional()
|
|
20443
|
+
}).transform((step) => ({
|
|
20444
|
+
toolName: step.toolName ?? step.tool,
|
|
20445
|
+
arguments: step.arguments ?? step.args ?? step.params ?? step.parameters ?? {},
|
|
20446
|
+
thought: step.thought
|
|
20447
|
+
})).refine((step) => step.toolName !== undefined, {
|
|
20448
|
+
message: 'Step must have either "toolName" or "tool"'
|
|
20439
20449
|
});
|
|
20440
20450
|
var PlanSchema = exports_external.array(ToolStepSchema);
|
|
20441
20451
|
function parseModelOutput(raw) {
|
|
@@ -20860,11 +20870,12 @@ function validateStringTemplateReference({
|
|
|
20860
20870
|
actualType: "string"
|
|
20861
20871
|
}));
|
|
20862
20872
|
}
|
|
20873
|
+
const stringCoercible = exports_external.union([exports_external.string(), exports_external.number(), exports_external.boolean()]);
|
|
20863
20874
|
for (const ref of reference.$values) {
|
|
20864
20875
|
validateOutputReference({
|
|
20865
20876
|
reference: ref,
|
|
20866
20877
|
argumentPath,
|
|
20867
|
-
expectedSchema:
|
|
20878
|
+
expectedSchema: stringCoercible,
|
|
20868
20879
|
step,
|
|
20869
20880
|
stepsById,
|
|
20870
20881
|
schemasByTool,
|
|
@@ -20988,7 +20999,7 @@ ${options.instructions}
|
|
|
20988
20999
|
{ role: "system", content: systemPrompt },
|
|
20989
21000
|
{ role: "user", content: query }
|
|
20990
21001
|
],
|
|
20991
|
-
temperature: options.temperature ?? 0,
|
|
21002
|
+
temperature: options.temperature ?? 0.3,
|
|
20992
21003
|
max_tokens: options.maxTokens ?? 1e4
|
|
20993
21004
|
});
|
|
20994
21005
|
const choice = response.choices?.[0];
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@kirha/planner",
|
|
3
|
-
"version": "0.1.
|
|
3
|
+
"version": "0.1.2",
|
|
4
4
|
"description": "SDK for tool-planning agents - generate and execute DAG execution plans from natural language",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"main": "./dist/index.js",
|
|
@@ -36,7 +36,7 @@
|
|
|
36
36
|
"license": "MIT",
|
|
37
37
|
"repository": {
|
|
38
38
|
"type": "git",
|
|
39
|
-
"url": "https://github.com/kirha-ai/planner-typescript
|
|
39
|
+
"url": "https://github.com/kirha-ai/planner-sdk-typescript"
|
|
40
40
|
},
|
|
41
41
|
"devDependencies": {
|
|
42
42
|
"@biomejs/biome": "2.3.10",
|