@oka-core/reason 0.2.8 → 0.2.9
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/client.js +3 -3
- package/dist/tools/read.d.ts.map +1 -1
- package/dist/tools/read.js +1 -2
- package/dist/tools/write.d.ts.map +1 -1
- package/dist/tools/write.js +24 -4
- package/package.json +1 -1
package/dist/client.js
CHANGED
|
@@ -187,7 +187,7 @@ export class OkaClient {
|
|
|
187
187
|
* POST /api/reasoning/consolidate
|
|
188
188
|
*/
|
|
189
189
|
async triggerConsolidation(req) {
|
|
190
|
-
return this.post("/api/reasoning/consolidate", req);
|
|
190
|
+
return this.post("/api/reasoning/consolidate", req, 120_000);
|
|
191
191
|
}
|
|
192
192
|
// ─── HTTP helpers ───────────────────────────────────────────────
|
|
193
193
|
authHeaders() {
|
|
@@ -233,9 +233,9 @@ export class OkaClient {
|
|
|
233
233
|
clearTimeout(timer);
|
|
234
234
|
}
|
|
235
235
|
}
|
|
236
|
-
async post(path, body) {
|
|
236
|
+
async post(path, body, timeout) {
|
|
237
237
|
const controller = new AbortController();
|
|
238
|
-
const timer = setTimeout(() => controller.abort(), this.timeout);
|
|
238
|
+
const timer = setTimeout(() => controller.abort(), timeout ?? this.timeout);
|
|
239
239
|
try {
|
|
240
240
|
const response = await fetch(`${this.apiUrl}${path}`, {
|
|
241
241
|
method: "POST",
|
package/dist/tools/read.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"read.d.ts","sourceRoot":"","sources":["../../src/tools/read.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,yCAAyC,CAAC;AAEzE,OAAO,KAAK,EACV,SAAS,EAGV,MAAM,cAAc,CAAC;AAoEtB;;;;;;;;;;;;GAYG;AACH,wBAAgB,iBAAiB,CAAC,MAAM,EAAE,SAAS,EAAE,MAAM,EAAE,SAAS,GAAG,IAAI,
|
|
1
|
+
{"version":3,"file":"read.d.ts","sourceRoot":"","sources":["../../src/tools/read.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,yCAAyC,CAAC;AAEzE,OAAO,KAAK,EACV,SAAS,EAGV,MAAM,cAAc,CAAC;AAoEtB;;;;;;;;;;;;GAYG;AACH,wBAAgB,iBAAiB,CAAC,MAAM,EAAE,SAAS,EAAE,MAAM,EAAE,SAAS,GAAG,IAAI,CA6nB5E"}
|
package/dist/tools/read.js
CHANGED
|
@@ -275,8 +275,7 @@ export function registerReadTools(server, client) {
|
|
|
275
275
|
server.tool("suggest", "Get ranked task priorities based on accumulated reasoning", {
|
|
276
276
|
repo: z.string().describe("Repository identifier"),
|
|
277
277
|
backlog: z
|
|
278
|
-
.array(z.string())
|
|
279
|
-
.min(1)
|
|
278
|
+
.preprocess((v) => (typeof v === "string" ? JSON.parse(v) : v), z.array(z.string()).min(1))
|
|
280
279
|
.describe("List of backlog items to prioritize"),
|
|
281
280
|
}, async (params) => {
|
|
282
281
|
try {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"write.d.ts","sourceRoot":"","sources":["../../src/tools/write.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,yCAAyC,CAAC;AAEzE,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,cAAc,CAAC;AAE9C;;;GAGG;AACH,wBAAgB,kBAAkB,CAAC,MAAM,EAAE,SAAS,EAAE,MAAM,EAAE,SAAS,GAAG,IAAI,
|
|
1
|
+
{"version":3,"file":"write.d.ts","sourceRoot":"","sources":["../../src/tools/write.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,yCAAyC,CAAC;AAEzE,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,cAAc,CAAC;AAE9C;;;GAGG;AACH,wBAAgB,kBAAkB,CAAC,MAAM,EAAE,SAAS,EAAE,MAAM,EAAE,SAAS,GAAG,IAAI,CAoK7E"}
|
package/dist/tools/write.js
CHANGED
|
@@ -19,7 +19,12 @@ export function registerWriteTools(server, client) {
|
|
|
19
19
|
}, async (params) => {
|
|
20
20
|
await client.ingest({ event_type: "decision", payload: params });
|
|
21
21
|
return {
|
|
22
|
-
content: [
|
|
22
|
+
content: [
|
|
23
|
+
{
|
|
24
|
+
type: "text",
|
|
25
|
+
text: `Decision recorded: ${params.description} (confidence: ${params.confidence})`,
|
|
26
|
+
},
|
|
27
|
+
],
|
|
23
28
|
};
|
|
24
29
|
});
|
|
25
30
|
server.tool("explore", "Record an area the agent explored and what was found", {
|
|
@@ -33,7 +38,12 @@ export function registerWriteTools(server, client) {
|
|
|
33
38
|
}, async (params) => {
|
|
34
39
|
await client.ingest({ event_type: "exploration", payload: params });
|
|
35
40
|
return {
|
|
36
|
-
content: [
|
|
41
|
+
content: [
|
|
42
|
+
{
|
|
43
|
+
type: "text",
|
|
44
|
+
text: `Exploration recorded: ${params.area} (relevance: ${params.relevance_score})`,
|
|
45
|
+
},
|
|
46
|
+
],
|
|
37
47
|
};
|
|
38
48
|
});
|
|
39
49
|
server.tool("deviation", "Record when the agent deviated from the original plan", {
|
|
@@ -43,7 +53,12 @@ export function registerWriteTools(server, client) {
|
|
|
43
53
|
}, async (params) => {
|
|
44
54
|
await client.ingest({ event_type: "deviation", payload: params });
|
|
45
55
|
return {
|
|
46
|
-
content: [
|
|
56
|
+
content: [
|
|
57
|
+
{
|
|
58
|
+
type: "text",
|
|
59
|
+
text: `Deviation recorded: planned "${params.planned_action}" → actual "${params.actual_action}"`,
|
|
60
|
+
},
|
|
61
|
+
],
|
|
47
62
|
};
|
|
48
63
|
});
|
|
49
64
|
server.tool("done", "Record task completion with outcome and quality signals", {
|
|
@@ -62,7 +77,12 @@ export function registerWriteTools(server, client) {
|
|
|
62
77
|
}, async (params) => {
|
|
63
78
|
await client.ingest({ event_type: "completion", payload: params });
|
|
64
79
|
return {
|
|
65
|
-
content: [
|
|
80
|
+
content: [
|
|
81
|
+
{
|
|
82
|
+
type: "text",
|
|
83
|
+
text: `Completion recorded: ${params.task_id} → ${params.outcome}`,
|
|
84
|
+
},
|
|
85
|
+
],
|
|
66
86
|
};
|
|
67
87
|
});
|
|
68
88
|
// ─── observe (general-purpose) ─────────────────────────────────
|