@senpi/runtime 3.0.328 → 3.0.329
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/adapter/api-wrapper.d.ts +1 -1
- package/dist/adapter/api-wrapper.js +2 -2
- package/dist/adapter/api-wrapper.js.map +1 -1
- package/dist/index.d.ts +0 -3
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +0 -14
- package/dist/index.js.map +1 -1
- package/dist/integrity-manifest.json +8 -24
- package/openclaw.plugin.json +1 -13
- package/package.json +1 -1
- package/dist/questions/capable.d.ts +0 -5
- package/dist/questions/capable.d.ts.map +0 -1
- package/dist/questions/capable.js +0 -47
- package/dist/questions/capable.js.map +0 -1
- package/dist/questions/index.d.ts +0 -31
- package/dist/questions/index.d.ts.map +0 -1
- package/dist/questions/index.js +0 -62
- package/dist/questions/index.js.map +0 -1
- package/dist/questions/pending.d.ts +0 -48
- package/dist/questions/pending.d.ts.map +0 -1
- package/dist/questions/pending.js +0 -78
- package/dist/questions/pending.js.map +0 -1
- package/dist/questions/tool.d.ts +0 -34
- package/dist/questions/tool.d.ts.map +0 -1
- package/dist/questions/tool.js +0 -140
- package/dist/questions/tool.js.map +0 -1
|
@@ -82,10 +82,10 @@
|
|
|
82
82
|
"dist/actions/types.d.ts.map": "8346c201bc366ef0a09d02c7d525fa0d417ac07873c136c3ef2736f41ff10e6d",
|
|
83
83
|
"dist/actions/types.js": "544545b6be24ded1e7de4ef013659220755c7e1e8784b5e7cd3b4035dc54b1de",
|
|
84
84
|
"dist/actions/types.js.map": "1d2734af6fe01d662533ce95ed0fe11c75c1592a144aab3d3fd0f3bdf98945ab",
|
|
85
|
-
"dist/adapter/api-wrapper.d.ts": "
|
|
85
|
+
"dist/adapter/api-wrapper.d.ts": "74ca6d933ff0db868f489ef4bb829ecc49afe511a8228f0982766dafac6213c3",
|
|
86
86
|
"dist/adapter/api-wrapper.d.ts.map": "fe10c846cb218e5cad1408e3da0a184b6968ecb08c44add416f1c27d10fd75ef",
|
|
87
|
-
"dist/adapter/api-wrapper.js": "
|
|
88
|
-
"dist/adapter/api-wrapper.js.map": "
|
|
87
|
+
"dist/adapter/api-wrapper.js": "0e1516bc47b6a99706a431c9e9376e865fa16d9914f51bb04945cc5b49824558",
|
|
88
|
+
"dist/adapter/api-wrapper.js.map": "992c9527a8843a70191dc638f21be9122a34bbbdc3b3604df3547b5c6ed6420a",
|
|
89
89
|
"dist/adapter/approvals-file.d.ts": "e00b6a2837c7cf634c3d7c28872587c2744999f0665b6297208af4b3e860d181",
|
|
90
90
|
"dist/adapter/approvals-file.d.ts.map": "e5db5995d02b1a7c692d552846bea71461cd0c69af4fdcfa72b21782c313015b",
|
|
91
91
|
"dist/adapter/approvals-file.js": "ae1c152cb7ae51de3f4b246e3d8f427a1b20f93c6defd9a56a7cff8889e2d692",
|
|
@@ -599,10 +599,10 @@
|
|
|
599
599
|
"dist/host/plugin-logger.d.ts.map": "ec7c445f901f3049ccb12b9b5117276fda7948f194b5949237dc7b902470240c",
|
|
600
600
|
"dist/host/plugin-logger.js": "a5dc7d4aff971c082135ba8909c765ebd720c7999b89231595c0a5b6cec54c8d",
|
|
601
601
|
"dist/host/plugin-logger.js.map": "9f4ece35a10aedc8c98871df8719dae7df6105acc804b93b51a84e3c74392039",
|
|
602
|
-
"dist/index.d.ts": "
|
|
603
|
-
"dist/index.d.ts.map": "
|
|
604
|
-
"dist/index.js": "
|
|
605
|
-
"dist/index.js.map": "
|
|
602
|
+
"dist/index.d.ts": "4d84939700a7250ac498b70d479d638e7de566e6db888176c617e6f15e1ae01f",
|
|
603
|
+
"dist/index.d.ts.map": "5bddf14d10cb27212177c9c225a988884ddfffc78e0e4d92821b73d7e0b73223",
|
|
604
|
+
"dist/index.js": "9544bcbe8a0e3d2b09198786b310f9048e64442d9b0548d1dbeb17d4b4439f05",
|
|
605
|
+
"dist/index.js.map": "6ac51520cc3f772870986b4ae69f2a84c5e66e7ad94e6efe6ae88269097dc600",
|
|
606
606
|
"dist/integrity/manifest.d.ts": "553f9c45d0c1162f8f927a4ee2335a4b35e7aec1424aeffb1a9ef812fa791f6e",
|
|
607
607
|
"dist/integrity/manifest.d.ts.map": "abde43df1a38a164ecffcdc0fd7e88eaa2fed55a154d1a1edb93a972fc951e0b",
|
|
608
608
|
"dist/integrity/manifest.js": "bdd27e7467174f4d0118dee1feb962b675886636f3fdd41bcdd5bb1e409fb3fd",
|
|
@@ -670,22 +670,6 @@
|
|
|
670
670
|
"dist/quant/types.d.ts.map": "406145f7eac1696f695507941d67d8ae7129920e110758ca7a7a1158d6e46e3f",
|
|
671
671
|
"dist/quant/types.js": "3825fa0586bf27aed3200d793564ac0410fe58177215c560bd65e7e9c856c98b",
|
|
672
672
|
"dist/quant/types.js.map": "d2719e463bf41d9393c097a74de461c75c4018ddbab59a336fad7c4a7da8641e",
|
|
673
|
-
"dist/questions/capable.d.ts": "37ceacfac0b25c9a406bf30b78a1a4e7d2ed0979ee84112133387d766ee0d729",
|
|
674
|
-
"dist/questions/capable.d.ts.map": "70dd350bda5f9cfa9e2c10abd0558cd0a790565c3bf1fc1bc586aef8362abeb2",
|
|
675
|
-
"dist/questions/capable.js": "ba4c05d3e3addc6b71fc22651c3d435704de2a3a734c6527b75784ccb5c7ff7a",
|
|
676
|
-
"dist/questions/capable.js.map": "d1b29ddd50534e3432b0fcaa99f17f996faddd65ad974a2d3d82ff689b455c5b",
|
|
677
|
-
"dist/questions/index.d.ts": "b45add127cbf3052c62003871e9fb1e510937614e91ca8df07c997d8541f4a4e",
|
|
678
|
-
"dist/questions/index.d.ts.map": "d7924005f64d2318be565834d1ba9468d22d7fc11a2f543214bd833943341bcc",
|
|
679
|
-
"dist/questions/index.js": "dec20df3dd981ea9fc89752becff56b585afad2e6b7889760017863448b3ffdd",
|
|
680
|
-
"dist/questions/index.js.map": "5d27d91734b20c8e4a438c75dd4c5f7e6e98ec6c9b280740179511c43b130c0c",
|
|
681
|
-
"dist/questions/pending.d.ts": "764c228f75f1e8a0c671db927dbac2b68af736286f3536f9ccbc90afb3a7a559",
|
|
682
|
-
"dist/questions/pending.d.ts.map": "c3ba78bbecc4a1b0858a55fcce49a9493611e2872cab1808765c24929b8aee31",
|
|
683
|
-
"dist/questions/pending.js": "7ecf6fc0b1afc1193d5ee4a05a1e9f59fd05e4c582c0ea5359bf768b26e21fed",
|
|
684
|
-
"dist/questions/pending.js.map": "52aa77746e6ed0b9ee5105c7ba14fe1664f191f2b8325ee154d64d25428d3a1f",
|
|
685
|
-
"dist/questions/tool.d.ts": "46acfb30faaefea9c54d77a87f1ed6ddaf937d49d2a1bc51dd719de21d4d6bdd",
|
|
686
|
-
"dist/questions/tool.d.ts.map": "cd772fe30c4b5a4b8fc644b59649a5f9a4fe75499ac9a06f61431bdcb1c4e03f",
|
|
687
|
-
"dist/questions/tool.js": "9456edbcf9d3cf200c711d026225bb99cfab43743debe895d41507f814742262",
|
|
688
|
-
"dist/questions/tool.js.map": "85c1ac6f058d984d82997fee3bab23c56136c82b65c82c97bb24627945e792c6",
|
|
689
673
|
"dist/risk/guardrail.types.d.ts": "2c60d309c358b5766c9f380be1089a7c95ce807add275f765675e040b62e5c46",
|
|
690
674
|
"dist/risk/guardrail.types.d.ts.map": "0fb1b1fd8fa0289847f1431cc277423430cbec4b39f2ac6e25a0c88ae8f2c91c",
|
|
691
675
|
"dist/risk/guardrail.types.js": "451a705fc83bceed07bd152baf62807df8db291e9226cb21699e0e7cecc38eea",
|
|
@@ -1862,6 +1846,6 @@
|
|
|
1862
1846
|
"dist/widgets/widgets/quant-desk-recommendations.d.ts.map": "410c41d3d2b37a1d8329aa888424f920424cc3afa1abd6acc64989093cbba24a",
|
|
1863
1847
|
"dist/widgets/widgets/quant-desk-recommendations.js": "91018c50913ace64ca1941c22e3de17549130a3370132b7f2ccc0477ee6d2aa0",
|
|
1864
1848
|
"dist/widgets/widgets/quant-desk-recommendations.js.map": "80b24b605271cff9acd56800f7c098c2335136e5362055c349e622b8751714c2",
|
|
1865
|
-
"openclaw.plugin.json": "
|
|
1849
|
+
"openclaw.plugin.json": "6e6a35d6fb6b984a38e655b48c7ac6c91c62ff4964c5f33cea154925fdffea5d"
|
|
1866
1850
|
}
|
|
1867
1851
|
}
|
package/openclaw.plugin.json
CHANGED
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
"id": "runtime",
|
|
3
3
|
"name": "Senpi Runtime",
|
|
4
4
|
"description": "Senpi runtime plugin for OpenClaw. Orchestrates scanners, LLM-based trade decisions, and a DSL trailing stop-loss exit engine.",
|
|
5
|
-
"version": "3.0.
|
|
5
|
+
"version": "3.0.329",
|
|
6
6
|
"commandAliases": [
|
|
7
7
|
{
|
|
8
8
|
"name": "senpi"
|
|
@@ -17,7 +17,6 @@
|
|
|
17
17
|
"contracts": {
|
|
18
18
|
"tools": [
|
|
19
19
|
"show_widget",
|
|
20
|
-
"ask_user_question",
|
|
21
20
|
"senpi_approve_live_code"
|
|
22
21
|
]
|
|
23
22
|
},
|
|
@@ -98,17 +97,6 @@
|
|
|
98
97
|
}
|
|
99
98
|
}
|
|
100
99
|
},
|
|
101
|
-
"questions": {
|
|
102
|
-
"type": "object",
|
|
103
|
-
"additionalProperties": false,
|
|
104
|
-
"description": "ask_user_question. The tool is offered only to app sessions whose client called senpi.question.list with capable: true. disabled: true is the kill switch: the tool is never offered.",
|
|
105
|
-
"properties": {
|
|
106
|
-
"disabled": {
|
|
107
|
-
"type": "boolean",
|
|
108
|
-
"default": false
|
|
109
|
-
}
|
|
110
|
-
}
|
|
111
|
-
},
|
|
112
100
|
"skillsManager": {
|
|
113
101
|
"type": "object",
|
|
114
102
|
"additionalProperties": false,
|
package/package.json
CHANGED
|
@@ -1,5 +0,0 @@
|
|
|
1
|
-
export declare function loadQuestionCapableSessions(stateDir: string | undefined): void;
|
|
2
|
-
export declare function isQuestionCapable(sessionKey: string): boolean;
|
|
3
|
-
export declare function markQuestionCapable(sessionKey: string): void;
|
|
4
|
-
export declare function resetQuestionCapableSessionsForTests(): void;
|
|
5
|
-
//# sourceMappingURL=capable.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"capable.d.ts","sourceRoot":"","sources":["../../src/questions/capable.ts"],"names":[],"mappings":"AAcA,wBAAgB,2BAA2B,CAAC,QAAQ,EAAE,MAAM,GAAG,SAAS,GAAG,IAAI,CAS9E;AAED,wBAAgB,iBAAiB,CAAC,UAAU,EAAE,MAAM,GAAG,OAAO,CAE7D;AAED,wBAAgB,mBAAmB,CAAC,UAAU,EAAE,MAAM,GAAG,IAAI,CAS5D;AAED,wBAAgB,oCAAoC,IAAI,IAAI,CAG3D"}
|
|
@@ -1,47 +0,0 @@
|
|
|
1
|
-
import { mkdirSync, readFileSync, renameSync, writeFileSync } from "node:fs";
|
|
2
|
-
import { dirname, join } from "node:path";
|
|
3
|
-
/**
|
|
4
|
-
* Sessions whose client said it can show a question card (`senpi.question.list {capable: true}`).
|
|
5
|
-
* OpenClaw 10.10 gives a tool factory no client identity: the web app, an old mobile build and an
|
|
6
|
-
* agent MCP connector all run `webchat` turns. Kept on disk so a gateway restart or wake keeps it.
|
|
7
|
-
*/
|
|
8
|
-
const MAX_SESSIONS = 2_000;
|
|
9
|
-
const FILE_NAME = join("questions", "capable-sessions.json");
|
|
10
|
-
let sessions = new Set();
|
|
11
|
-
let file;
|
|
12
|
-
export function loadQuestionCapableSessions(stateDir) {
|
|
13
|
-
if (!stateDir)
|
|
14
|
-
return;
|
|
15
|
-
file = join(stateDir, FILE_NAME);
|
|
16
|
-
try {
|
|
17
|
-
const keys = JSON.parse(readFileSync(file, "utf8"));
|
|
18
|
-
if (Array.isArray(keys))
|
|
19
|
-
for (const key of keys)
|
|
20
|
-
if (typeof key === "string")
|
|
21
|
-
sessions.add(key);
|
|
22
|
-
}
|
|
23
|
-
catch {
|
|
24
|
-
// No file yet, or an unreadable one: start from what this process has seen.
|
|
25
|
-
}
|
|
26
|
-
}
|
|
27
|
-
export function isQuestionCapable(sessionKey) {
|
|
28
|
-
return sessions.has(sessionKey);
|
|
29
|
-
}
|
|
30
|
-
export function markQuestionCapable(sessionKey) {
|
|
31
|
-
if (sessions.has(sessionKey))
|
|
32
|
-
return;
|
|
33
|
-
sessions.add(sessionKey);
|
|
34
|
-
if (sessions.size > MAX_SESSIONS)
|
|
35
|
-
sessions = new Set([...sessions].slice(-MAX_SESSIONS));
|
|
36
|
-
if (!file)
|
|
37
|
-
return;
|
|
38
|
-
mkdirSync(dirname(file), { recursive: true });
|
|
39
|
-
const tmp = `${file}.tmp`;
|
|
40
|
-
writeFileSync(tmp, JSON.stringify([...sessions]));
|
|
41
|
-
renameSync(tmp, file);
|
|
42
|
-
}
|
|
43
|
-
export function resetQuestionCapableSessionsForTests() {
|
|
44
|
-
sessions = new Set();
|
|
45
|
-
file = undefined;
|
|
46
|
-
}
|
|
47
|
-
//# sourceMappingURL=capable.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"capable.js","sourceRoot":"","sources":["../../src/questions/capable.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,SAAS,EAAE,YAAY,EAAE,UAAU,EAAE,aAAa,EAAE,MAAM,SAAS,CAAC;AAC7E,OAAO,EAAE,OAAO,EAAE,IAAI,EAAE,MAAM,WAAW,CAAC;AAE1C;;;;GAIG;AACH,MAAM,YAAY,GAAG,KAAK,CAAC;AAC3B,MAAM,SAAS,GAAG,IAAI,CAAC,WAAW,EAAE,uBAAuB,CAAC,CAAC;AAE7D,IAAI,QAAQ,GAAG,IAAI,GAAG,EAAU,CAAC;AACjC,IAAI,IAAwB,CAAC;AAE7B,MAAM,UAAU,2BAA2B,CAAC,QAA4B;IACtE,IAAI,CAAC,QAAQ;QAAE,OAAO;IACtB,IAAI,GAAG,IAAI,CAAC,QAAQ,EAAE,SAAS,CAAC,CAAC;IACjC,IAAI,CAAC;QACH,MAAM,IAAI,GAAG,IAAI,CAAC,KAAK,CAAC,YAAY,CAAC,IAAI,EAAE,MAAM,CAAC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MS } from "./tool.js";
|
|
3
|
-
export type { AskUserQuestionToolResult } from "./tool.js";
|
|
4
|
-
export type { Answer, PendingQuestionView, QuestionOutcome } from "./pending.js";
|
|
5
|
-
export declare const QUESTION_ANSWER_METHOD = "senpi.question.answer";
|
|
6
|
-
export declare const QUESTION_LIST_METHOD = "senpi.question.list";
|
|
7
|
-
export interface QuestionPluginApi {
|
|
8
|
-
registerTool(tool: (ctx: {
|
|
9
|
-
sessionKey?: string;
|
|
10
|
-
sessionId?: string;
|
|
11
|
-
messageChannel?: string;
|
|
12
|
-
}) => unknown, opts?: {
|
|
13
|
-
names?: string[];
|
|
14
|
-
optional?: boolean;
|
|
15
|
-
}): void;
|
|
16
|
-
registerGatewayMethod(name: string, handler: (ctx: {
|
|
17
|
-
respond: (ok: boolean, value: unknown) => void;
|
|
18
|
-
params?: Record<string, unknown>;
|
|
19
|
-
}) => void | Promise<void>, opts?: {
|
|
20
|
-
scope?: "operator.read" | "operator.write";
|
|
21
|
-
}): void;
|
|
22
|
-
}
|
|
23
|
-
export declare function registerAskUserQuestion(options: {
|
|
24
|
-
api: QuestionPluginApi;
|
|
25
|
-
logger?: QuestionLogger;
|
|
26
|
-
/** Where the question-capable sessions are kept across restarts. */
|
|
27
|
-
stateDir?: string;
|
|
28
|
-
/** Kill switch (plugin config `questions.disabled`): the tool is never offered. */
|
|
29
|
-
disabled?: boolean;
|
|
30
|
-
}): void;
|
|
31
|
-
//# sourceMappingURL=index.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/questions/index.ts"],"names":[],"mappings":"AAEA,OAAO,EAA0D,KAAK,cAAc,EAAE,MAAM,WAAW,CAAC;AAExG,OAAO,EAAE,2BAA2B,EAAE,mBAAmB,EAAE,MAAM,WAAW,CAAC;AAC7E,YAAY,EAAE,yBAAyB,EAAE,MAAM,WAAW,CAAC;AAC3D,YAAY,EAAE,MAAM,EAAE,mBAAmB,EAAE,eAAe,EAAE,MAAM,cAAc,CAAC;AAEjF,eAAO,MAAM,sBAAsB,0BAA0B,CAAC;AAC9D,eAAO,MAAM,oBAAoB,wBAAwB,CAAC;AAW1D,MAAM,WAAW,iBAAiB;IAChC,YAAY,CACV,IAAI,EAAE,CAAC,GAAG,EAAE;QAAE,UAAU,CAAC,EAAE,MAAM,CAAC;QAAC,SAAS,CAAC,EAAE,MAAM,CAAC;QAAC,cAAc,CAAC,EAAE,MAAM,CAAA;KAAE,KAAK,OAAO,EAC5F,IAAI,CAAC,EAAE;QAAE,KAAK,CAAC,EAAE,MAAM,EAAE,CAAC;QAAC,QAAQ,CAAC,EAAE,OAAO,CAAA;KAAE,GAC9C,IAAI,CAAC;IACR,qBAAqB,CACnB,IAAI,EAAE,MAAM,EACZ,OAAO,EAAE,CAAC,GAAG,EAAE;QAAE,OAAO,EAAE,CAAC,EAAE,EAAE,OAAO,EAAE,KAAK,EAAE,OAAO,KAAK,IAAI,CAAC;QAAC,MAAM,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAAA;KAAE,KAAK,IAAI,GAAG,OAAO,CAAC,IAAI,CAAC,EAC5H,IAAI,CAAC,EAAE;QAAE,KAAK,CAAC,EAAE,eAAe,GAAG,gBAAgB,CAAA;KAAE,GACpD,IAAI,CAAC;CACT;AAMD,wBAAgB,uBAAuB,CAAC,OAAO,EAAE;IAC/C,GAAG,EAAE,iBAAiB,CAAC;IACvB,MAAM,CAAC,EAAE,cAAc,CAAC;IACxB,oEAAoE;IACpE,QAAQ,CAAC,EAAE,MAAM,CAAC;IAClB,mFAAmF;IACnF,QAAQ,CAAC,EAAE,OAAO,CAAC;CACpB,GAAG,IAAI,CA4DP"}
|
package/dist/questions/index.js
DELETED
|
@@ -1,62 +0,0 @@
|
|
|
1
|
-
import { isQuestionCapable, loadQuestionCapableSessions, markQuestionCapable } from "./capable.js";
|
|
2
|
-
import { answerQuestion, listPendingQuestions } from "./pending.js";
|
|
3
|
-
import { ASK_USER_QUESTION_TOOL_NAME, createAskUserQuestionTool } from "./tool.js";
|
|
4
|
-
export { ASK_USER_QUESTION_TOOL_NAME, QUESTION_TIMEOUT_MS } from "./tool.js";
|
|
5
|
-
export const QUESTION_ANSWER_METHOD = "senpi.question.answer";
|
|
6
|
-
export const QUESTION_LIST_METHOD = "senpi.question.list";
|
|
7
|
-
/**
|
|
8
|
-
* OpenClaw 10.10 runs a chat.send turn on the internal channel "webchat"
|
|
9
|
-
* (`resolveChatSendOriginatingRoute`). Telegram, cron and other channels'
|
|
10
|
-
* turns carry another channel or none; no app sees their tool calls.
|
|
11
|
-
*/
|
|
12
|
-
const APP_CHANNEL = "webchat";
|
|
13
|
-
function optionalString(value) {
|
|
14
|
-
return typeof value === "string" ? value : undefined;
|
|
15
|
-
}
|
|
16
|
-
export function registerAskUserQuestion(options) {
|
|
17
|
-
const { api, logger, disabled = false } = options;
|
|
18
|
-
loadQuestionCapableSessions(options.stateDir);
|
|
19
|
-
api.registerTool((ctx) => {
|
|
20
|
-
// An app turn is offered the tool only once its client said it can show the question:
|
|
21
|
-
// a client that cannot (prod web, old mobile builds, agent MCP connectors) would block for 600 s.
|
|
22
|
-
if (disabled || ctx?.messageChannel !== APP_CHANNEL || !ctx.sessionKey || !isQuestionCapable(ctx.sessionKey)) {
|
|
23
|
-
return null;
|
|
24
|
-
}
|
|
25
|
-
return createAskUserQuestionTool({ sessionKey: ctx.sessionKey, logger });
|
|
26
|
-
}, { names: [ASK_USER_QUESTION_TOOL_NAME] });
|
|
27
|
-
api.registerGatewayMethod(QUESTION_ANSWER_METHOD, (ctx) => {
|
|
28
|
-
const respond = ctx.respond;
|
|
29
|
-
const sessionKey = optionalString(ctx.params?.sessionKey);
|
|
30
|
-
const toolCallId = optionalString(ctx.params?.toolCallId);
|
|
31
|
-
if (!sessionKey || !toolCallId) {
|
|
32
|
-
respond(false, undefined, { code: "INVALID_REQUEST", message: "sessionKey and toolCallId are required" });
|
|
33
|
-
return;
|
|
34
|
-
}
|
|
35
|
-
const error = answerQuestion({
|
|
36
|
-
sessionKey,
|
|
37
|
-
toolCallId,
|
|
38
|
-
optionId: optionalString(ctx.params?.optionId),
|
|
39
|
-
text: optionalString(ctx.params?.text),
|
|
40
|
-
});
|
|
41
|
-
if (error) {
|
|
42
|
-
logger?.warn(`[senpi-questions] answer refused | toolCallId=${toolCallId} code=${error.code} | ${error.message}`);
|
|
43
|
-
respond(false, undefined, error);
|
|
44
|
-
return;
|
|
45
|
-
}
|
|
46
|
-
respond(true, { toolCallId, status: "answered" });
|
|
47
|
-
}, { scope: "operator.write" });
|
|
48
|
-
api.registerGatewayMethod(QUESTION_LIST_METHOD, (ctx) => {
|
|
49
|
-
const respond = ctx.respond;
|
|
50
|
-
const sessionKey = optionalString(ctx.params?.sessionKey);
|
|
51
|
-
if (!sessionKey) {
|
|
52
|
-
respond(false, undefined, { code: "INVALID_REQUEST", message: "sessionKey is required" });
|
|
53
|
-
return;
|
|
54
|
-
}
|
|
55
|
-
if (ctx.params?.capable === true)
|
|
56
|
-
markQuestionCapable(sessionKey);
|
|
57
|
-
respond(true, { questions: listPendingQuestions(sessionKey) });
|
|
58
|
-
}, { scope: "operator.read" });
|
|
59
|
-
logger?.info(`[senpi-questions] ${ASK_USER_QUESTION_TOOL_NAME} registered | methods=${QUESTION_ANSWER_METHOD},${QUESTION_LIST_METHOD}` +
|
|
60
|
-
` offered=${disabled ? "never (questions.disabled)" : "sessions whose client listed with capable:true"}`);
|
|
61
|
-
}
|
|
62
|
-
//# sourceMappingURL=index.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/questions/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,iBAAiB,EAAE,2BAA2B,EAAE,mBAAmB,EAAE,MAAM,cAAc,CAAC;AACnG,OAAO,EAAE,cAAc,EAAE,oBAAoB,EAAE,MAAM,cAAc,CAAC;AACpE,OAAO,EAAE,2BAA2B,EAAE,yB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K,IAAI;YAAE,mBAAmB,CAAC,UAAU,CAAC,CAAC;QAClE,OAAO,CAAC,IAAI,EAAE,EAAE,SAAS,EAAE,oBAAoB,CAAC,UAAU,CAAC,EAAE,CAAC,CAAC;IACjE,CAAC,EACD,EAAE,KAAK,EAAE,eAAe,EAAE,CAC3B,CAAC;IAEF,MAAM,EAAE,IAAI,CACV,qBAAqB,2BAA2B,yBAAyB,sBAAsB,IAAI,oBAAoB,EAAE;QACvH,YAAY,QAAQ,CAAC,CAAC,CAAC,4BAA4B,CAAC,CAAC,CAAC,gDAAgD,EAAE,CAC3G,CAAC;AACJ,CAAC"}
|
|
@@ -1,48 +0,0 @@
|
|
|
1
|
-
export interface QuestionOption {
|
|
2
|
-
id: string;
|
|
3
|
-
label: string;
|
|
4
|
-
description?: string;
|
|
5
|
-
}
|
|
6
|
-
export interface Question {
|
|
7
|
-
question: string;
|
|
8
|
-
options: QuestionOption[];
|
|
9
|
-
allow_text: boolean;
|
|
10
|
-
}
|
|
11
|
-
export type Answer = {
|
|
12
|
-
optionId: string;
|
|
13
|
-
label: string;
|
|
14
|
-
} | {
|
|
15
|
-
text: string;
|
|
16
|
-
};
|
|
17
|
-
export type QuestionOutcome = {
|
|
18
|
-
status: "answered";
|
|
19
|
-
answer: Answer;
|
|
20
|
-
} | {
|
|
21
|
-
status: "no_answer";
|
|
22
|
-
reason: "timeout" | "cancelled";
|
|
23
|
-
};
|
|
24
|
-
export interface PendingQuestionView extends Question {
|
|
25
|
-
toolCallId: string;
|
|
26
|
-
sessionKey: string;
|
|
27
|
-
askedAt: string;
|
|
28
|
-
expiresAt: string;
|
|
29
|
-
}
|
|
30
|
-
export type AnswerError = {
|
|
31
|
-
code: "NOT_FOUND" | "INVALID_REQUEST";
|
|
32
|
-
message: string;
|
|
33
|
-
};
|
|
34
|
-
export declare function askAndWait(params: {
|
|
35
|
-
toolCallId: string;
|
|
36
|
-
sessionKey: string;
|
|
37
|
-
question: Question;
|
|
38
|
-
timeoutMs: number;
|
|
39
|
-
signal?: AbortSignal;
|
|
40
|
-
}): Promise<QuestionOutcome>;
|
|
41
|
-
export declare function answerQuestion(params: {
|
|
42
|
-
sessionKey: string;
|
|
43
|
-
toolCallId: string;
|
|
44
|
-
optionId?: string;
|
|
45
|
-
text?: string;
|
|
46
|
-
}): AnswerError | undefined;
|
|
47
|
-
export declare function listPendingQuestions(sessionKey: string): PendingQuestionView[];
|
|
48
|
-
//# sourceMappingURL=pending.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"pending.d.ts","sourceRoot":"","sources":["../../src/questions/pending.ts"],"names":[],"mappings":"AAAA,MAAM,WAAW,cAAc;IAC7B,EAAE,EAAE,MAAM,CAAC;IACX,KAAK,EAAE,MAAM,CAAC;IACd,WAAW,CAAC,EAAE,MAAM,CAAC;CACtB;AAED,MAAM,WAAW,QAAQ;IACvB,QAAQ,EAAE,MAAM,CAAC;IACjB,OAAO,EAAE,cAAc,EAAE,CAAC;IAC1B,UAAU,EAAE,OAAO,CAAC;CACrB;AAED,MAAM,MAAM,MAAM,GAAG;IAAE,QAAQ,EAAE,MAAM,CAAC;IAAC,KAAK,EAAE,MAAM,CAAA;CAAE,GAAG;IAAE,IAAI,EAAE,MAAM,CAAA;CAAE,CAAC;AAE5E,MAAM,MAAM,eAAe,GACvB;IAAE,MAAM,EAAE,UAAU,CAAC;IAAC,MAAM,EAAE,MAAM,CAAA;CAAE,GACtC;IAAE,MAAM,EAAE,WAAW,CAAC;IAAC,MAAM,EAAE,SAAS,GAAG,WAAW,CAAA;CAAE,CAAC;AAE7D,MAAM,WAAW,mBAAoB,SAAQ,QAAQ;IACnD,UAAU,EAAE,MAAM,CAAC;IACnB,UAAU,EAAE,MAAM,CAAC;IACnB,OAAO,EAAE,MAAM,CAAC;IAChB,SAAS,EAAE,MAAM,CAAC;CACnB;AAED,MAAM,MAAM,WAAW,GAAG;IAAE,IAAI,EAAE,WAAW,GAAG,iBAAiB,CAAC;IAAC,OAAO,EAAE,MAAM,CAAA;CAAE,CAAC;AAyBrF,wBAAgB,UAAU,CAAC,MAAM,EAAE;IACjC,UAAU,EAAE,MAAM,CAAC;IACnB,UAAU,EAAE,MAAM,CAAC;IACnB,QAAQ,EAAE,QAAQ,CAAC;IACnB,SAAS,EAAE,MAAM,CAAC;IAClB,MAAM,CAAC,EAAE,WAAW,CAAC;CACtB,GAAG,OAAO,CAAC,eAAe,CAAC,CA8B3B;AAED,wBAAgB,cAAc,CAAC,MAAM,EAAE;IACrC,UAAU,EAAE,MAAM,CAAC;IACnB,UAAU,EAAE,MAAM,CAAC;IACnB,QAAQ,CAAC,EAAE,MAAM,CAAC;IAClB,IAAI,CAAC,EAAE,MAAM,CAAC;CACf,GAAG,WAAW,GAAG,SAAS,CAwB1B;AAED,wBAAgB,oBAAoB,CAAC,UAAU,EAAE,MAAM,GAAG,mBAAmB,EAAE,CAE9E"}
|
|
@@ -1,78 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* OpenClaw can load this plugin more than once in one gateway process, and the
|
|
3
|
-
* pass that builds agent tools need not be the pass whose gateway methods are
|
|
4
|
-
* live. Every pass must see one table, so it lives on globalThis, the same way
|
|
5
|
-
* OpenClaw keeps its own pending ask_user questions.
|
|
6
|
-
*/
|
|
7
|
-
const TABLE_KEY = Symbol.for("senpi.runtime.pendingQuestions");
|
|
8
|
-
function pendingKey(sessionKey, toolCallId) {
|
|
9
|
-
return `${sessionKey}\0${toolCallId}`;
|
|
10
|
-
}
|
|
11
|
-
function table() {
|
|
12
|
-
const holder = globalThis;
|
|
13
|
-
holder[TABLE_KEY] ??= new Map();
|
|
14
|
-
return holder[TABLE_KEY];
|
|
15
|
-
}
|
|
16
|
-
export function askAndWait(params) {
|
|
17
|
-
const { toolCallId, timeoutMs, signal } = params;
|
|
18
|
-
const key = pendingKey(params.sessionKey, toolCallId);
|
|
19
|
-
const pending = table();
|
|
20
|
-
if (signal?.aborted)
|
|
21
|
-
return Promise.resolve({ status: "no_answer", reason: "cancelled" });
|
|
22
|
-
return new Promise((resolve) => {
|
|
23
|
-
const askedAtMs = Date.now();
|
|
24
|
-
const finish = (outcome) => {
|
|
25
|
-
if (pending.get(key) !== entry)
|
|
26
|
-
return;
|
|
27
|
-
pending.delete(key);
|
|
28
|
-
clearTimeout(timer);
|
|
29
|
-
signal?.removeEventListener("abort", onAbort);
|
|
30
|
-
resolve(outcome);
|
|
31
|
-
};
|
|
32
|
-
const onAbort = () => finish({ status: "no_answer", reason: "cancelled" });
|
|
33
|
-
const entry = {
|
|
34
|
-
view: {
|
|
35
|
-
toolCallId,
|
|
36
|
-
sessionKey: params.sessionKey,
|
|
37
|
-
...params.question,
|
|
38
|
-
askedAt: new Date(askedAtMs).toISOString(),
|
|
39
|
-
expiresAt: new Date(askedAtMs + timeoutMs).toISOString(),
|
|
40
|
-
},
|
|
41
|
-
settle: finish,
|
|
42
|
-
};
|
|
43
|
-
pending.get(key)?.settle({ status: "no_answer", reason: "cancelled" });
|
|
44
|
-
pending.set(key, entry);
|
|
45
|
-
const timer = setTimeout(() => finish({ status: "no_answer", reason: "timeout" }), timeoutMs);
|
|
46
|
-
signal?.addEventListener("abort", onAbort, { once: true });
|
|
47
|
-
});
|
|
48
|
-
}
|
|
49
|
-
export function answerQuestion(params) {
|
|
50
|
-
const entry = table().get(pendingKey(params.sessionKey, params.toolCallId));
|
|
51
|
-
if (!entry) {
|
|
52
|
-
return { code: "NOT_FOUND", message: `no pending question for toolCallId ${params.toolCallId} in this session` };
|
|
53
|
-
}
|
|
54
|
-
const { view } = entry;
|
|
55
|
-
if ((params.optionId === undefined) === (params.text === undefined)) {
|
|
56
|
-
return { code: "INVALID_REQUEST", message: "send exactly one of optionId or text" };
|
|
57
|
-
}
|
|
58
|
-
if (params.optionId !== undefined) {
|
|
59
|
-
const option = view.options.find((o) => o.id === params.optionId);
|
|
60
|
-
if (!option) {
|
|
61
|
-
return { code: "INVALID_REQUEST", message: `unknown optionId ${params.optionId}` };
|
|
62
|
-
}
|
|
63
|
-
entry.settle({ status: "answered", answer: { optionId: option.id, label: option.label } });
|
|
64
|
-
return undefined;
|
|
65
|
-
}
|
|
66
|
-
const text = params.text.trim();
|
|
67
|
-
if (!view.allow_text) {
|
|
68
|
-
return { code: "INVALID_REQUEST", message: "this question takes an option, not text" };
|
|
69
|
-
}
|
|
70
|
-
if (text === "")
|
|
71
|
-
return { code: "INVALID_REQUEST", message: "text is empty" };
|
|
72
|
-
entry.settle({ status: "answered", answer: { text } });
|
|
73
|
-
return undefined;
|
|
74
|
-
}
|
|
75
|
-
export function listPendingQuestions(sessionKey) {
|
|
76
|
-
return [...table().values()].map((entry) => entry.view).filter((view) => view.sessionKey === sessionKey);
|
|
77
|
-
}
|
|
78
|
-
//# sourceMappingURL=pending.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"pending.js","sourceRoot":"","sources":["../../src/questions/pending.ts"],"names":[],"mappings":"AAgCA;;;;;GAKG;AACH,MAAM,SAAS,GAAG,MAAM,CAAC,GAAG,CAAC,gCAAgC,CAAC,CAAC;AAE/D,SAAS,UAAU,CAAC,UAAkB,EAAE,UAAkB;IACxD,OAAO,GAAG,UAAU,KAAK,UAAU,EAAE,CAAC;AACxC,CAAC;AAED,SAAS,KAAK;IACZ,MAAM,MAAM,GAAG,UAA4D,CAAC;IAC5E,MAAM,CAAC,SAAS,CAAC,KAAK,IAAI,GAAG,EAAE,CAAC;IAChC,OAAO,MAAM,CAAC,SAAS,CAAC,CAAC;AAC3B,CAAC;AAED,MAAM,UAAU,UAAU,CAAC,MAM1B;IACC,MAAM,EAAE,UAAU,EAAE,SAAS,EAAE,MAAM,EAAE,GAAG,MAAM,CAAC;IACjD,MAAM,GAAG,GAAG,UAAU,CAAC,MAAM,CAAC,UAAU,EAAE,UAAU,CAAC,CAAC;IACtD,MAAM,OAAO,GAAG,KAAK,EAAE,CAAC;IACxB,IAAI,MAAM,EAAE,OAAO;QAAE,OAAO,OAAO,CAAC,OAAO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AAC,KAAK,EAAE,EAAE,CAAC,CAAC;QAC3F,OAAO,SAAS,CAAC;IACnB,CAAC;IACD,MAAM,IAAI,GAAG,MAAM,CAAC,IAAK,CAAC,IAAI,EAAE,CAAC;IACjC,IAAI,CAAC,IAAI,CAAC,UAAU,EAAE,CAAC;QACrB,OAAO,EAAE,IAAI,EAAE,iBAAiB,EAAE,OAAO,EAAE,yCAAyC,EAAE,CAAC;IACzF,CAAC;IACD,IAAI,IAAI,KAAK,EAAE;QAAE,OAAO,EAAE,IAAI,EAAE,iBAAiB,EAAE,OAAO,EAAE,eAAe,EAAE,CAAC;IAC9E,KAAK,CAAC,MAAM,CAAC,EAAE,MAAM,EAAE,UAAU,EAAE,MAAM,EAAE,EAAE,IAAI,EAAE,EAAE,CAAC,CAAC;IACvD,OAAO,SAAS,CAAC;AACnB,CAAC;AAED,MAAM,UAAU,oBAAoB,CAAC,UAAkB;IACrD,OAAO,CAAC,GAAG,KAAK,EAAE,CAAC,MAAM,EAAE,CAAC,CAAC,GAAG,CAAC,CAAC,KAAK,EAAE,EAAE,CAAC,KAAK,CAAC,IAAI,CAAC,CAAC,MAAM,CAAC,CAAC,IAAI,EAAE,EAAE,CAAC,IAAI,CAAC,UAAU,KAAK,UAAU,CAAC,CAAC;AAC3G,CAAC"}
|
package/dist/questions/tool.d.ts
DELETED
|
@@ -1,34 +0,0 @@
|
|
|
1
|
-
import { type QuestionOutcome } from "./pending.js";
|
|
2
|
-
/**
|
|
3
|
-
* Not `ask_user`: OpenClaw 10.10 ships a core tool by that name, and a plugin
|
|
4
|
-
* tool may neither shadow a core name nor pass the fleet's `tools.deny`, which
|
|
5
|
-
* lists `ask_user` (senpi-agent `src/lib/fleetPolicy.js`).
|
|
6
|
-
*/
|
|
7
|
-
export declare const ASK_USER_QUESTION_TOOL_NAME = "ask_user_question";
|
|
8
|
-
export declare const QUESTION_TIMEOUT_MS = 600000;
|
|
9
|
-
export interface QuestionLogger {
|
|
10
|
-
info(...args: unknown[]): void;
|
|
11
|
-
warn(...args: unknown[]): void;
|
|
12
|
-
error?(...args: unknown[]): void;
|
|
13
|
-
}
|
|
14
|
-
export interface AskUserQuestionToolResult {
|
|
15
|
-
content: Array<{
|
|
16
|
-
type: "text";
|
|
17
|
-
text: string;
|
|
18
|
-
}>;
|
|
19
|
-
details: QuestionOutcome;
|
|
20
|
-
}
|
|
21
|
-
export interface AskUserQuestionTool {
|
|
22
|
-
name: string;
|
|
23
|
-
description: string;
|
|
24
|
-
parameters: Record<string, unknown>;
|
|
25
|
-
catalogMode: "direct-only";
|
|
26
|
-
execute(toolCallId: string, params: unknown, signal?: AbortSignal): Promise<AskUserQuestionToolResult>;
|
|
27
|
-
}
|
|
28
|
-
export declare const ASK_USER_QUESTION_PARAMETERS: Record<string, unknown>;
|
|
29
|
-
export declare function createAskUserQuestionTool(options: {
|
|
30
|
-
sessionKey: string;
|
|
31
|
-
logger?: QuestionLogger;
|
|
32
|
-
timeoutMs?: number;
|
|
33
|
-
}): AskUserQuestionTool;
|
|
34
|
-
//# sourceMappingURL=tool.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"tool.d.ts","sourceRoot":"","sources":["../../src/questions/tool.ts"],"names":[],"mappings":"AAAA,OAAO,EAAkD,KAAK,eAAe,EAAE,MAAM,cAAc,CAAC;AAEpG;;;;GAIG;AACH,eAAO,MAAM,2BAA2B,sBAAsB,CAAC;AAC/D,eAAO,MAAM,mBAAmB,SAAU,CAAC;AAG3C,MAAM,WAAW,cAAc;IAC7B,IAAI,CAAC,GAAG,IAAI,EAAE,OAAO,EAAE,GAAG,IAAI,CAAC;IAC/B,IAAI,CAAC,GAAG,IAAI,EAAE,OAAO,EAAE,GAAG,IAAI,CAAC;IAC/B,KAAK,CAAC,CAAC,GAAG,IAAI,EAAE,OAAO,EAAE,GAAG,IAAI,CAAC;CAClC;AAED,MAAM,WAAW,yBAAyB;IACxC,OAAO,EAAE,KAAK,CAAC;QAAE,IAAI,EAAE,MAAM,CAAC;QAAC,IAAI,EAAE,MAAM,CAAA;KAAE,CAAC,CAAC;IAC/C,OAAO,EAAE,eAAe,CAAC;CAC1B;AAED,MAAM,WAAW,mBAAmB;IAClC,IAAI,EAAE,MAAM,CAAC;IACb,WAAW,EAAE,MAAM,CAAC;IACpB,UAAU,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAAC;IACpC,WAAW,EAAE,aAAa,CAAC;IAC3B,OAAO,CAAC,UAAU,EAAE,MAAM,EAAE,MAAM,EAAE,OAAO,EAAE,MAAM,CAAC,EAAE,WAAW,GAAG,OAAO,CAAC,yBAAyB,CAAC,CAAC;CACxG;AAYD,eAAO,MAAM,4BAA4B,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CA0BhE,CAAC;AA8DF,wBAAgB,yBAAyB,CAAC,OAAO,EAAE;IACjD,UAAU,EAAE,MAAM,CAAC;IACnB,MAAM,CAAC,EAAE,cAAc,CAAC;IACxB,SAAS,CAAC,EAAE,MAAM,CAAC;CACpB,GAAG,mBAAmB,CA+BtB"}
|
package/dist/questions/tool.js
DELETED
|
@@ -1,140 +0,0 @@
|
|
|
1
|
-
import { askAndWait } from "./pending.js";
|
|
2
|
-
/**
|
|
3
|
-
* Not `ask_user`: OpenClaw 10.10 ships a core tool by that name, and a plugin
|
|
4
|
-
* tool may neither shadow a core name nor pass the fleet's `tools.deny`, which
|
|
5
|
-
* lists `ask_user` (senpi-agent `src/lib/fleetPolicy.js`).
|
|
6
|
-
*/
|
|
7
|
-
export const ASK_USER_QUESTION_TOOL_NAME = "ask_user_question";
|
|
8
|
-
export const QUESTION_TIMEOUT_MS = 600_000;
|
|
9
|
-
const MAX_OPTIONS = 6;
|
|
10
|
-
const DESCRIPTION = [
|
|
11
|
-
"Ask the user a question in the chat and wait for the answer. The app shows the question with one numbered choice per option, each with its label as the title and its description as a grey subtitle, plus a text field when allow_text is true.",
|
|
12
|
-
"",
|
|
13
|
-
"Call it when you need a choice from the user before you can continue, for example a budget, a coin or a risk level. Do not also write the question in your reply.",
|
|
14
|
-
"",
|
|
15
|
-
`Give up to ${MAX_OPTIONS} options, each with a short id, the label the user sees, and a description: a few words under the label that say what choosing it means, for example label "Steady growth" with description "Fewer trades, smaller swings". Set allow_text when the user may type their own answer, for example "or my own amount". The text field is that choice, so never add an option such as "Other" or "My own amount": tapping a button sends only its label.`,
|
|
16
|
-
"",
|
|
17
|
-
"The tool returns the user's answer. If it returns no answer, tell the user you stopped waiting and do not guess the answer.",
|
|
18
|
-
].join("\n");
|
|
19
|
-
export const ASK_USER_QUESTION_PARAMETERS = {
|
|
20
|
-
type: "object",
|
|
21
|
-
properties: {
|
|
22
|
-
question: { type: "string", description: "The question, one sentence." },
|
|
23
|
-
options: {
|
|
24
|
-
type: "array",
|
|
25
|
-
maxItems: MAX_OPTIONS,
|
|
26
|
-
description: "The choices, recommended first. Empty only when allow_text is true.",
|
|
27
|
-
items: {
|
|
28
|
-
type: "object",
|
|
29
|
-
properties: {
|
|
30
|
-
id: { type: "string", description: "Short unique id, e.g. usd_500." },
|
|
31
|
-
label: { type: "string", description: "What the button says, e.g. $500." },
|
|
32
|
-
description: {
|
|
33
|
-
type: "string",
|
|
34
|
-
description: "Short subtitle shown under the label, e.g. Fewer trades, smaller swings.",
|
|
35
|
-
},
|
|
36
|
-
},
|
|
37
|
-
required: ["id", "label"],
|
|
38
|
-
additionalProperties: false,
|
|
39
|
-
},
|
|
40
|
-
},
|
|
41
|
-
allow_text: { type: "boolean", description: "True when the user may type their own answer." },
|
|
42
|
-
},
|
|
43
|
-
required: ["question", "options"],
|
|
44
|
-
additionalProperties: false,
|
|
45
|
-
};
|
|
46
|
-
class QuestionInputError extends Error {
|
|
47
|
-
}
|
|
48
|
-
function fail(message) {
|
|
49
|
-
throw new QuestionInputError(`ask_user_question failed: ${message}`);
|
|
50
|
-
}
|
|
51
|
-
function exactText(value, field) {
|
|
52
|
-
if (typeof value !== "string" || value.trim() === "")
|
|
53
|
-
fail(`"${field}" must be a non-empty string`);
|
|
54
|
-
if (value !== value.trim()) {
|
|
55
|
-
fail(`"${field}" has spaces at the start or end (${JSON.stringify(value)}); send ${JSON.stringify(value.trim())}`);
|
|
56
|
-
}
|
|
57
|
-
return value;
|
|
58
|
-
}
|
|
59
|
-
/** Display-only text: trimmed, and dropped when null or blank. */
|
|
60
|
-
function optionalText(value, field) {
|
|
61
|
-
if (value === undefined || value === null)
|
|
62
|
-
return undefined;
|
|
63
|
-
if (typeof value !== "string")
|
|
64
|
-
fail(`"${field}" must be a string`);
|
|
65
|
-
return value.trim() || undefined;
|
|
66
|
-
}
|
|
67
|
-
function parseQuestion(params) {
|
|
68
|
-
if (!params || typeof params !== "object" || Array.isArray(params))
|
|
69
|
-
fail("arguments must be an object");
|
|
70
|
-
const args = params;
|
|
71
|
-
const extra = Object.keys(args).filter((k) => !["question", "options", "allow_text"].includes(k));
|
|
72
|
-
if (extra.length > 0)
|
|
73
|
-
fail(`unexpected fields: ${extra.join(", ")}`);
|
|
74
|
-
const question = typeof args.question === "string" ? args.question.trim() : "";
|
|
75
|
-
if (question === "")
|
|
76
|
-
fail('"question" must be a non-empty string');
|
|
77
|
-
if (args.allow_text !== undefined && typeof args.allow_text !== "boolean")
|
|
78
|
-
fail('"allow_text" must be a boolean');
|
|
79
|
-
const allowText = args.allow_text === true;
|
|
80
|
-
if (!Array.isArray(args.options))
|
|
81
|
-
fail('"options" must be an array');
|
|
82
|
-
if (args.options.length > MAX_OPTIONS)
|
|
83
|
-
fail(`at most ${MAX_OPTIONS} options`);
|
|
84
|
-
const options = args.options.map((raw, i) => {
|
|
85
|
-
const o = (raw ?? {});
|
|
86
|
-
const option = { id: exactText(o.id, `options[${i}].id`), label: exactText(o.label, `options[${i}].label`) };
|
|
87
|
-
const description = optionalText(o.description, `options[${i}].description`);
|
|
88
|
-
if (description)
|
|
89
|
-
option.description = description;
|
|
90
|
-
return option;
|
|
91
|
-
});
|
|
92
|
-
if (new Set(options.map((o) => o.id)).size !== options.length)
|
|
93
|
-
fail("option ids must be unique");
|
|
94
|
-
if (options.length === 0 && !allowText)
|
|
95
|
-
fail("give at least one option, or set allow_text");
|
|
96
|
-
return { question, options, allow_text: allowText };
|
|
97
|
-
}
|
|
98
|
-
function resultText(outcome) {
|
|
99
|
-
if (outcome.status === "no_answer") {
|
|
100
|
-
return outcome.reason === "timeout"
|
|
101
|
-
? "No answer: the user did not answer within 10 minutes. Tell the user you stopped waiting, and do not assume an answer."
|
|
102
|
-
: "No answer: the question was cancelled before the user answered.";
|
|
103
|
-
}
|
|
104
|
-
const { answer } = outcome;
|
|
105
|
-
return "optionId" in answer
|
|
106
|
-
? `The user chose "${answer.label}" (option ${answer.optionId}).`
|
|
107
|
-
: `The user answered in their own words: ${answer.text}`;
|
|
108
|
-
}
|
|
109
|
-
export function createAskUserQuestionTool(options) {
|
|
110
|
-
const { logger } = options;
|
|
111
|
-
const { sessionKey } = options;
|
|
112
|
-
return {
|
|
113
|
-
name: ASK_USER_QUESTION_TOOL_NAME,
|
|
114
|
-
description: DESCRIPTION,
|
|
115
|
-
parameters: ASK_USER_QUESTION_PARAMETERS,
|
|
116
|
-
catalogMode: "direct-only",
|
|
117
|
-
async execute(toolCallId, params, signal) {
|
|
118
|
-
let question;
|
|
119
|
-
try {
|
|
120
|
-
question = parseQuestion(params);
|
|
121
|
-
}
|
|
122
|
-
catch (err) {
|
|
123
|
-
logger?.warn(`[senpi-questions] invalid question | toolCallId=${toolCallId} | ${err.message}`);
|
|
124
|
-
throw err;
|
|
125
|
-
}
|
|
126
|
-
logger?.info(`[senpi-questions] asked | toolCallId=${toolCallId} options=${question.options.length} allow_text=${question.allow_text}`);
|
|
127
|
-
const outcome = await askAndWait({
|
|
128
|
-
toolCallId,
|
|
129
|
-
sessionKey,
|
|
130
|
-
question,
|
|
131
|
-
timeoutMs: options.timeoutMs ?? QUESTION_TIMEOUT_MS,
|
|
132
|
-
signal,
|
|
133
|
-
});
|
|
134
|
-
logger?.info(`[senpi-questions] settled | toolCallId=${toolCallId} status=${outcome.status}` +
|
|
135
|
-
(outcome.status === "no_answer" ? ` reason=${outcome.reason}` : ""));
|
|
136
|
-
return { content: [{ type: "text", text: resultText(outcome) }], details: outcome };
|
|
137
|
-
},
|
|
138
|
-
};
|
|
139
|
-
}
|
|
140
|
-
//# sourceMappingURL=tool.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"tool.js","sourceRoot":"","sources":["../../src/questions/tool.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,UAAU,EAA4D,MAAM,cAAc,CAAC;AAEpG;;;;GAIG;AACH,MAAM,CAAC,MAAM,2BAA2B,GAAG,mBAAmB,CAAC;AAC/D,MAAM,CAAC,MAAM,mBAAmB,GAAG,OAAO,CAAC;AAC3C,MAAM,WAAW,GAAG,CAAC,CAAC;AAqBtB,MAAM,WAAW,GAAG;IAClB,kPAAkP;IAClP,EAAE;IACF,mKAAmK;IACnK,EAAE;IACF,cAAc,WAAW,sbAAsb;IAC/c,EAAE;IACF,6HAA6H;CAC9H,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC;AAEb,MAAM,CAAC,MAAM,4BAA4B,GAA4B;IACnE,IAAI,EAAE,QAAQ;IACd,UAAU,EAAE;QACV,QAAQ,EAAE,EAAE,IAAI,EAAE,QAAQ,EAAE,WAAW,EAAE,6BAA6B,EAAE;QACxE,OAAO,EAAE;YACP,IAAI,EAAE,OAAO;YACb,QAAQ,EAAE,WAAW;YACrB,WAAW,EAAE,qEAAqE;YAClF,KAAK,EAAE;gBACL,IAAI,EAAE,QAAQ;gBACd,UAAU,EAAE;oBACV,EAAE,EAAE,EAAE,IAAI,EAAE,QAAQ,EAAE,WAAW,EAAE,gCAAgC,EAAE;oBACrE,KAAK,EAAE,EAAE,IAAI,EAAE,QAAQ,EAAE,WAAW,EAAE,kCAAkC,EAAE;oBAC1E,WAAW,EAAE;wBACX,IAAI,EAAE,QAAQ;wBACd,WAAW,EAAE,0EAA0E;qBACxF;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