@agimon-ai/po-user-feedback 0.0.0-alpha.2 → 0.0.0-alpha.21

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/LICENSE CHANGED
@@ -1,21 +1,149 @@
1
- MIT License
2
-
3
- Copyright (c) 2026 Vuong Ngo
4
-
5
- Permission is hereby granted, free of charge, to any person obtaining a copy
6
- of this software and associated documentation files (the "Software"), to deal
7
- in the Software without restriction, including without limitation the rights
8
- to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9
- copies of the Software, and to permit persons to whom the Software is
10
- furnished to do so, subject to the following conditions:
11
-
12
- The above copyright notice and this permission notice shall be included in all
13
- copies or substantial portions of the Software.
14
-
15
- THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16
- IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17
- FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18
- AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19
- LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20
- OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21
- SOFTWARE.
1
+ License text copyright © 2017 MariaDB Corporation Ab, All Rights Reserved.
2
+ "Business Source License" is a trademark of MariaDB Corporation Ab.
3
+
4
+ Parameters
5
+
6
+ Licensor: Agimon Pty Ltd
7
+ Licensed Work: Po, the software in the Po source repository and the
8
+ packages released from it, in each version released by
9
+ the Licensor.
10
+ The Licensed Work is (c) 2026 Agimon Pty Ltd.
11
+ Material identified as third-party in the "Third-party
12
+ components" section at the end of this file or in a
13
+ NOTICE file, and any package or directory whose own
14
+ license file grants a different license, is not part of
15
+ the Licensed Work and remains under its own license.
16
+ Additional Use Grant: You may make production use of the Licensed Work if
17
+ your use is Eligible Use. "Eligible Use" is production use that falls
18
+ within at least one of the following:
19
+
20
+ (a) Personal Use. Use by an individual for their own personal purposes,
21
+ and not on behalf of, or for the benefit of, an employer, client, or
22
+ other Organization. Use by an individual in the course of employment
23
+ or engagement by an Organization is use by that Organization.
24
+
25
+ (b) Small Organization Use. Use by or on behalf of an Organization whose
26
+ Annual Revenue is less than USD 1,000,000.
27
+
28
+ (c) Non-profit, Education and Research Use. Use, regardless of Annual
29
+ Revenue, by (i) an Organization registered or recognized as a
30
+ non-profit or charitable organization under the laws of its
31
+ jurisdiction, for its non-profit purposes; (ii) an accredited school,
32
+ college, or university, for teaching, learning, or academic research;
33
+ or (iii) a publicly funded research institution, for its research.
34
+
35
+ (d) Service Provider Use. Use by a consultant, contractor, agency, or other
36
+ service provider, regardless of its own Annual Revenue, solely to
37
+ build, deploy, host, operate, or support the Licensed Work for a client
38
+ whose own use would be Eligible Use under (a), (b), or (c). A service
39
+ provider's use for its own purposes is Eligible Use only if the service
40
+ provider itself qualifies under (b) or (c).
41
+
42
+
43
+ Hosted services. Offering the Licensed Work to third parties as a hosted
44
+ or managed service whose primary value is the Licensed Work is Eligible
45
+ Use only if each such third party's own use would be Eligible Use.
46
+
47
+ Definitions. "Organization" means any company, partnership, sole
48
+ proprietorship, trust, association, government body, or other entity, and
49
+ includes an individual acting in a business or professional capacity.
50
+ "Affiliate" means any entity that directly or indirectly controls, is
51
+ controlled by, or is under common control with an Organization, where
52
+ "control" means ownership of more than 50% of the voting interests of an
53
+ entity or the power to direct its management and policies by contract or
54
+ otherwise. "Annual Revenue" means the total gross revenue of an
55
+ Organization and all of its Affiliates combined, from all sources and
56
+ whether or not related to the Licensed Work, for its most recently
57
+ completed fiscal year, or, if it has not completed a fiscal year, for the
58
+ twelve months before the use (or since its formation, if shorter),
59
+ converted into US dollars at the average exchange rate for that period.
60
+ Proceeds of equity or debt financing are not revenue.
61
+
62
+ Threshold. If an Organization stops qualifying under (b), its existing
63
+ production use remains Eligible Use for 90 days after it stops
64
+ qualifying, after which it must obtain a commercial license or stop
65
+ production use. Use that was Eligible Use when it occurred never requires
66
+ a commercial license after the fact.
67
+ Change Date: Four years from the date a version of the Licensed Work
68
+ is first publicly released by the Licensor.
69
+ Change License: Apache License, Version 2.0
70
+
71
+ For information about alternative licensing arrangements for the Licensed
72
+ Work, please visit: https://agimon.ai/licensing
73
+
74
+ Notice
75
+
76
+ The Business Source License (this document, or the "License") is not an Open
77
+ Source license. However, the Licensed Work will eventually be made available
78
+ under an Open Source License, as stated in this License.
79
+
80
+ -----------------------------------------------------------------------------
81
+
82
+ Business Source License 1.1
83
+
84
+ Terms
85
+
86
+ The Licensor hereby grants you the right to copy, modify, create derivative
87
+ works, redistribute, and make non-production use of the Licensed Work. The
88
+ Licensor may make an Additional Use Grant, above, permitting limited
89
+ production use.
90
+
91
+ Effective on the Change Date, or the fourth anniversary of the first publicly
92
+ available distribution of a specific version of the Licensed Work under this
93
+ License, whichever comes first, the Licensor hereby grants you rights under
94
+ the terms of the Change License, and the rights granted in the paragraph
95
+ above terminate.
96
+
97
+ If your use of the Licensed Work does not comply with the requirements
98
+ currently in effect as described in this License, you must purchase a
99
+ commercial license from the Licensor, its affiliated entities, or authorized
100
+ resellers, or you must refrain from using the Licensed Work.
101
+
102
+ All copies of the original and modified Licensed Work, and derivative works
103
+ of the Licensed Work, are subject to this License. This License applies
104
+ separately for each version of the Licensed Work and the Change Date may vary
105
+ for each version of the Licensed Work released by Licensor.
106
+
107
+ You must conspicuously display this License on each original or modified copy
108
+ of the Licensed Work. If you receive the Licensed Work in original or
109
+ modified form from a third party, the terms and conditions set forth in this
110
+ License apply to your use of that work.
111
+
112
+ Any use of the Licensed Work in violation of this License will automatically
113
+ terminate your rights under this License for the current and all other
114
+ versions of the Licensed Work.
115
+
116
+ This License does not grant you any right in any trademark or logo of
117
+ Licensor or its affiliates (provided that you may use a trademark or logo of
118
+ Licensor as expressly required by this License).
119
+
120
+ TO THE EXTENT PERMITTED BY APPLICABLE LAW, THE LICENSED WORK IS PROVIDED ON
121
+ AN “AS IS” BASIS. LICENSOR HEREBY DISCLAIMS ALL WARRANTIES AND CONDITIONS,
122
+ EXPRESS OR IMPLIED, INCLUDING (WITHOUT LIMITATION) WARRANTIES OF
123
+ MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE, NON-INFRINGEMENT, AND
124
+ TITLE.
125
+
126
+ MariaDB hereby grants you permission to use this License’s text to license
127
+ your works, and to refer to it using the trademark “Business Source License”,
128
+ as long as you comply with the Covenants of Licensor below.
129
+
130
+ Covenants of Licensor
131
+
132
+ In consideration of the right to use this License’s text and the “Business
133
+ Source License” name and trademark, Licensor covenants to MariaDB, and to all
134
+ other recipients of the licensed work to be provided by Licensor:
135
+
136
+ 1. To specify as the Change License the GPL Version 2.0 or any later version,
137
+ or a license that is compatible with GPL Version 2.0 or a later version,
138
+ where “compatible” means that software provided under the Change License can
139
+ be included in a program with software provided under GPL Version 2.0 or a
140
+ later version. Licensor may specify additional Change Licenses without
141
+ limitation.
142
+
143
+ 2. To either: (a) specify an additional grant of rights to use that does not
144
+ impose any additional restriction on the right granted in this License, as
145
+ the Additional Use Grant; or (b) insert the text “None”.
146
+
147
+ 3. To specify a Change Date.
148
+
149
+ 4. Not to modify this License in any other way.
package/README.md CHANGED
@@ -28,7 +28,7 @@ majorMode:
28
28
  layers: [feedback]
29
29
  ```
30
30
 
31
- The native server facet owns questionnaire coordination and cancellation. Disposing the facet aborts pending requests and waits for presenters to finish.
31
+ The native server plugin owns questionnaire coordination and cancellation. Disposing the plugin aborts pending requests and waits for presenters to finish.
32
32
 
33
33
  ## Ask a question
34
34
 
@@ -3,7 +3,7 @@ Object.defineProperties(exports, {
3
3
  [Symbol.toStringTag]: { value: "Module" }
4
4
  });
5
5
  //#region src/schemas/apiContracts.ts
6
- /** This facet contributes agent tools, commands or lifecycle only, with no separate HTTP or socket surface. */
6
+ /** This server plugin contributes agent tools, commands or lifecycle only, with no separate HTTP or socket surface. */
7
7
  const apiContracts = (0, require("@agimon-ai/po-core/apiContracts").defineApiContract)({
8
8
  version: 1,
9
9
  http: [],
@@ -1 +1 @@
1
- {"version":3,"file":"apiContracts.cjs","names":["defineApiContract"],"sources":["../src/schemas/apiContracts.ts"],"sourcesContent":["import { defineApiContract } from '@agimon-ai/po-core/apiContracts';\n\n/** This facet contributes agent tools, commands or lifecycle only, with no separate HTTP or socket surface. */\nexport const apiContracts = defineApiContract({ version: 1, http: [], sockets: [], dynamic: [] });\nexport default apiContracts;\n"],"mappings":";;;;;;AAGA,MAAa,gBAAA,4CAAeA,CAAAA,CAAAA,kBAAAA,CAAkB;CAAE,SAAS;CAAG,MAAM,CAAC;CAAG,SAAS,CAAC;CAAG,SAAS,CAAC;AAAE,CAAC"}
1
+ {"version":3,"file":"apiContracts.cjs","names":["defineApiContract"],"sources":["../src/schemas/apiContracts.ts"],"sourcesContent":["import { defineApiContract } from '@agimon-ai/po-core/apiContracts';\n\n/** This server plugin contributes agent tools, commands or lifecycle only, with no separate HTTP or socket surface. */\nexport const apiContracts = defineApiContract({ version: 1, http: [], sockets: [], dynamic: [] });\nexport default apiContracts;\n"],"mappings":";;;;;;AAGA,MAAa,gBAAA,4CAAeA,CAAAA,CAAAA,kBAAAA,CAAkB;CAAE,SAAS;CAAG,MAAM,CAAC;CAAG,SAAS,CAAC;CAAG,SAAS,CAAC;AAAE,CAAC"}
@@ -1,5 +1,5 @@
1
1
  //#region src/schemas/apiContracts.d.ts
2
- /** This facet contributes agent tools, commands or lifecycle only, with no separate HTTP or socket surface. */
2
+ /** This server plugin contributes agent tools, commands or lifecycle only, with no separate HTTP or socket surface. */
3
3
  export declare const apiContracts: {
4
4
  version: 1;
5
5
  protocols?: Record<string, string> | undefined;
@@ -1,6 +1,6 @@
1
1
  import { defineApiContract } from "@agimon-ai/po-core/apiContracts";
2
2
  //#region src/schemas/apiContracts.ts
3
- /** This facet contributes agent tools, commands or lifecycle only, with no separate HTTP or socket surface. */
3
+ /** This server plugin contributes agent tools, commands or lifecycle only, with no separate HTTP or socket surface. */
4
4
  const apiContracts = defineApiContract({
5
5
  version: 1,
6
6
  http: [],
@@ -1 +1 @@
1
- {"version":3,"file":"apiContracts.mjs","names":[],"sources":["../src/schemas/apiContracts.ts"],"sourcesContent":["import { defineApiContract } from '@agimon-ai/po-core/apiContracts';\n\n/** This facet contributes agent tools, commands or lifecycle only, with no separate HTTP or socket surface. */\nexport const apiContracts = defineApiContract({ version: 1, http: [], sockets: [], dynamic: [] });\nexport default apiContracts;\n"],"mappings":";;;AAGA,MAAa,eAAe,kBAAkB;CAAE,SAAS;CAAG,MAAM,CAAC;CAAG,SAAS,CAAC;CAAG,SAAS,CAAC;AAAE,CAAC"}
1
+ {"version":3,"file":"apiContracts.mjs","names":[],"sources":["../src/schemas/apiContracts.ts"],"sourcesContent":["import { defineApiContract } from '@agimon-ai/po-core/apiContracts';\n\n/** This server plugin contributes agent tools, commands or lifecycle only, with no separate HTTP or socket surface. */\nexport const apiContracts = defineApiContract({ version: 1, http: [], sockets: [], dynamic: [] });\nexport default apiContracts;\n"],"mappings":";;;AAGA,MAAa,eAAe,kBAAkB;CAAE,SAAS;CAAG,MAAM,CAAC;CAAG,SAAS,CAAC;CAAG,SAAS,CAAC;AAAE,CAAC"}
@@ -60,7 +60,7 @@ function AskUserQuestionToolMessage(props) {
60
60
  testID: "tool-result-ask_user_question",
61
61
  children: props.running ? /* @__PURE__ */ jsx(MessageItemStatus, {
62
62
  tone: "running",
63
- children: "answer below to continue"
63
+ children: "running"
64
64
  }) : view.kind === "cancelled" ? /* @__PURE__ */ jsx(MessageItemStatus, {
65
65
  tone: "running",
66
66
  children: "cancelled"
@@ -142,7 +142,7 @@ const styles$1 = StyleSheet.create((theme) => ({
142
142
  * It lives under src/types because that is the one server root a browser
143
143
  * bundle may read, so neither half can drift from the other.
144
144
  */
145
- const ANSWER_ENVELOPE_PREFIX = "doom-ask-user/v1:";
145
+ const ANSWER_ENVELOPE_PREFIX = "po-ask-user/v1:";
146
146
  function encodeAnswerEnvelope(answers) {
147
147
  return `${ANSWER_ENVELOPE_PREFIX}${JSON.stringify({ answers })}`;
148
148
  }
@@ -1 +1 @@
1
- {"version":3,"file":"native.mjs","names":["isRecord","asString","ToolMessageRenderProps","fontOf","MessageItem","MessageItemBody","MessageItemHeader","MessageItemStatus","toolTone","StyleSheet","askCallSummary","askResultView","AskUserQuestionToolMessage","props","summary","args","view","result","details","output","count","headers","running","kind","answers","length","styles","map","answer","index","String","question","text","check","prompt","isError","error","undefined","create","theme","gap","spacing","uni__dependencies","fontFamily","sans","fontSize","base","lineHeight","lineHeightRelaxed","color","colors","dim","green","cyan","red","styles","ToolPromptRenderProps","Button","fontOf","Markdown","SectionLabel","selectionTick","Textarea","useMemo","useState","StyleSheet","encodeAnswerEnvelope","chooseOption","CUSTOM_LABEL","draftAnswers","draftEntry","emptyDraft","isAnswered","isComplete","nextUnanswered","PromptQuestion","QuestionnaireDraft","readPromptQuestions","setCustom","setNotes","QuestionnaireViewProps","questions","draft","current","previewIndex","onDraft","settles","onCurrent","index","onPreview","onSubmit","onCancel","QuestionnaireView","props","question","entry","preview","options","styles","frame","steps","map","step","String","header","body","content","meta","length","multiSelect","option","chosen","custom","selected","includes","label","description","mark","selectedInk","optionText","field","value","notes","actions","Questionnaire","answer","cancel","setDraft","setCurrent","setPreviewIndex","show","next","pending","QuestionnairePrompt","args","sessionId","dialog","id","create","theme","maxHeight","flexShrink","backgroundColor","colors","rail","borderTopWidth","borderColor","uni__dependencies","gap","spacing","padding","paddingHorizontal","paddingBottom","fontFamily","sans","fontSize","base","lineHeight","lineHeightRelaxed","color","hi","sm","dim","flexDirection","minHeight","borderWidth","borderRadius","md","lg","magenta","flex","fontWeight","semibold","text","paddingLeft","borderLeftWidth","flexWrap","justifyContent","toolAskUserQuestion"],"sources":["../../src/extensions/workspaces/sessions/(frontend)/tool/_lib/askUserText.ts","../../src/extensions/workspaces/sessions/(frontend)/tool/_components/AskUserQuestionToolMessage.native.tsx","../../src/types/askUserWire.ts","../../src/extensions/workspaces/sessions/(frontend)/tool/_lib/questionnaireDraft.ts","../../src/extensions/workspaces/sessions/(frontend)/tool/_components/QuestionnairePrompt.native.tsx","../../src/extensions/workspaces/sessions/(frontend)/tool/askUserQuestion.native.tsx","../../generated/native.ts"],"sourcesContent":["/**\n * Pure text shaping for the ask_user_question card, apart from React so the\n * unit suite covers it without a DOM. Args and details are wire JSON; the\n * shapes narrowed here mirror src/types/questionnaire.ts, which this browser\n * module may not import at runtime.\n */\n\ntype Args = Readonly<Record<string, unknown>>;\n\nfunction isRecord(value: unknown): value is Record<string, unknown> {\n return typeof value === 'object' && value !== null && !Array.isArray(value);\n}\n\nfunction asString(value: unknown): string {\n return typeof value === 'string' ? value : '';\n}\n\nexport interface AskCallSummary {\n /** \"N question(s)\", the TUI heading's purpose. */\n count: string;\n /** The question headers, comma separated; empty when none carry one. */\n headers: string;\n}\n\n/** The call header: how many questions, and their headers in parentheses. */\nexport function askCallSummary(args: Args): AskCallSummary {\n const questions = Array.isArray(args.questions) ? args.questions.filter(isRecord) : [];\n const headers = questions.map((question) => asString(question.header)).filter(Boolean);\n return {\n count: `${questions.length} question${questions.length === 1 ? '' : 's'}`,\n headers: headers.join(', '),\n };\n}\n\nexport interface AnsweredQuestion {\n question: string;\n answer: string;\n}\n\nexport type AskResultView =\n | { kind: 'cancelled' }\n | { kind: 'voice'; prompt: string }\n | { kind: 'answers'; answers: AnsweredQuestion[] }\n | { kind: 'text'; text: string };\n\n/**\n * The result body the TUI's renderResult chooses: a cancelled glyph, the\n * voice prompt when the questionnaire was handed to voice, the answered\n * list, or the raw text when the tool attached no details (an error path).\n */\nexport function askResultView(details: unknown, output: string): AskResultView {\n if (!isRecord(details) || !Array.isArray(details.answers)) return { kind: 'text', text: output };\n if (details.cancelled === true) return { kind: 'cancelled' };\n if (details.delivery === 'voice' && typeof details.voicePrompt === 'string') {\n return { kind: 'voice', prompt: details.voicePrompt };\n }\n const answers = details.answers.filter(isRecord).map((answer) => ({\n question: asString(answer.question),\n answer:\n answer.kind === 'multi'\n ? (Array.isArray(answer.selected) ? answer.selected : []).filter((v) => typeof v === 'string').join(', ')\n : asString(answer.answer),\n }));\n return { kind: 'answers', answers };\n}\n","import type { ToolMessageRenderProps } from '@agimon-ai/po-core/native';\nimport {\n fontOf,\n MessageItem,\n MessageItemBody,\n MessageItemHeader,\n MessageItemStatus,\n toolTone,\n} from '@agimon-ai/po-native-components';\nimport { Text, View } from 'react-native';\nimport { StyleSheet } from 'react-native-unistyles';\n\nimport { askCallSummary, askResultView } from '../_lib/askUserText';\n\nexport function AskUserQuestionToolMessage(props: ToolMessageRenderProps) {\n const summary = askCallSummary(props.args);\n const view = askResultView(props.result?.details, props.output);\n return (\n <MessageItem tone={toolTone(props)}>\n <MessageItemHeader title=\"ask_user_question\">{`${summary.count}${summary.headers ? ` (${summary.headers})` : ''}`}</MessageItemHeader>\n <MessageItemBody testID=\"tool-result-ask_user_question\">\n {props.running ? (\n <MessageItemStatus tone=\"running\">answer below to continue</MessageItemStatus>\n ) : view.kind === 'cancelled' ? (\n <MessageItemStatus tone=\"running\">cancelled</MessageItemStatus>\n ) : view.kind === 'answers' ? (\n view.answers.length === 0 ? (\n <MessageItemStatus tone=\"ok\">submitted</MessageItemStatus>\n ) : (\n <View style={styles.answers}>\n {view.answers.map((answer, index) => (\n <Text key={`${String(index)}:${answer.question}`} style={styles.text}>\n <Text style={styles.check}>✓ </Text>\n <Text style={styles.question}>{answer.question}</Text>: {answer.answer}\n </Text>\n ))}\n </View>\n )\n ) : view.kind === 'voice' ? (\n <Text style={styles.text}>{view.prompt}</Text>\n ) : view.text ? (\n <Text\n style={[styles.text, props.isError && styles.error]}\n accessibilityRole={props.isError ? 'alert' : undefined}\n >\n {view.text}\n </Text>\n ) : (\n <MessageItemStatus tone={props.isError ? 'error' : 'ok'}>\n {props.isError ? 'failed' : 'submitted'}\n </MessageItemStatus>\n )}\n </MessageItemBody>\n </MessageItem>\n );\n}\n\nconst styles = StyleSheet.create((theme) => ({\n answers: { gap: theme.spacing(2) },\n text: {\n fontFamily: fontOf(theme.fontFamily.sans),\n fontSize: theme.fontSize.base,\n lineHeight: theme.lineHeightRelaxed.base,\n color: theme.colors.dim,\n },\n check: { color: theme.colors.green },\n question: { color: theme.colors.cyan },\n error: { color: theme.colors.red },\n}));\n","import type { QuestionAnswer } from './questionnaire';\n\n/**\n * How a rich client answers the whole questionnaire in one reply.\n *\n * Pi's select request carries a title and a list of labels and nothing else,\n * so over RPC the questionnaire degrades into one request per question, asked\n * forwards only. A client that can already see the whole call (the cockpit\n * reads it from the tool's arguments) has no use for that: it renders every\n * question at once, lets the reader move between them, and replies once.\n *\n * The reply rides on the select response, because that is the only channel a\n * blocked extension has. An ordinary label is still an ordinary label, so a\n * client that knows nothing about this keeps the per-question flow exactly as\n * it was; only a response carrying the prefix is read as the whole set.\n *\n * It lives under src/types because that is the one server root a browser\n * bundle may read, so neither half can drift from the other.\n */\nexport const ANSWER_ENVELOPE_PREFIX = 'doom-ask-user/v1:';\n\n/** A response that claims the prefix but cannot be read is refused, never guessed at. */\nexport type AnswerEnvelopeRead =\n | { readonly kind: 'absent' }\n | { readonly kind: 'malformed' }\n | { readonly kind: 'envelope'; readonly payload: unknown };\n\n/** Beyond this a response is not a questionnaire answer, whatever it claims. */\nexport const MAX_ENVELOPE_BYTES = 64 * 1024;\n\nexport function encodeAnswerEnvelope(answers: readonly QuestionAnswer[]): string {\n return `${ANSWER_ENVELOPE_PREFIX}${JSON.stringify({ answers })}`;\n}\n\nexport function decodeAnswerEnvelope(value: string | undefined): AnswerEnvelopeRead {\n if (value === undefined || !value.startsWith(ANSWER_ENVELOPE_PREFIX)) return { kind: 'absent' };\n if (value.length > MAX_ENVELOPE_BYTES) return { kind: 'malformed' };\n try {\n return { kind: 'envelope', payload: JSON.parse(value.slice(ANSWER_ENVELOPE_PREFIX.length)) };\n } catch {\n // Unreadable JSON behind the prefix: the sender meant an envelope and got\n // it wrong, which is a refusal rather than a label the model should see.\n return { kind: 'malformed' };\n }\n}\n","/**\n * The questionnaire the cockpit is filling in, as a value.\n *\n * Apart from React so the unit suite covers it without a DOM, the same way\n * askUserText.ts is. The questions come from the running tool call's\n * arguments, which are wire JSON: the shapes narrowed here mirror\n * src/schemas/questionnaire.ts, which a browser module may not import.\n *\n * Everything is held here until the reader submits, which is the whole point.\n * A step the reader goes back to still has what they chose, and the agent is\n * asked once rather than once per question.\n */\nimport type { QuestionAnswer } from '../../../../../../types/questionnaire';\n\n/** The row every question gets, so a reader always has a way past a bad set of options. */\nexport const CUSTOM_LABEL = 'Type something.';\n\nexport interface PromptOption {\n label: string;\n description: string;\n preview?: string;\n}\n\nexport interface PromptQuestion {\n question: string;\n header: string;\n multiSelect: boolean;\n options: PromptOption[];\n}\n\nexport interface QuestionDraft {\n /** Chosen option labels: at most one unless the question is multiSelect. */\n selected: string[];\n /** Text typed in place of an option; null while the reader has not typed any. */\n custom: string | null;\n notes: string;\n}\n\nexport type QuestionnaireDraft = readonly QuestionDraft[];\n\nconst EMPTY_ENTRY: QuestionDraft = { selected: [], custom: null, notes: '' };\n\nfunction isRecord(value: unknown): value is Record<string, unknown> {\n return typeof value === 'object' && value !== null && !Array.isArray(value);\n}\n\nfunction asString(value: unknown): string {\n return typeof value === 'string' ? value : '';\n}\n\nfunction readOption(value: unknown): PromptOption | null {\n if (!isRecord(value)) return null;\n const label = asString(value.label);\n if (label === '') return null;\n const preview = asString(value.preview);\n return { label, description: asString(value.description), ...(preview === '' ? {} : { preview }) };\n}\n\n/** The questions as the tool was called with them; an unreadable call yields none. */\nexport function readPromptQuestions(args: Readonly<Record<string, unknown>>): PromptQuestion[] {\n if (!Array.isArray(args.questions)) return [];\n return args.questions.flatMap((entry) => {\n if (!isRecord(entry)) return [];\n const question = asString(entry.question);\n if (question === '') return [];\n const options = (Array.isArray(entry.options) ? entry.options : []).flatMap((option) => {\n const read = readOption(option);\n return read === null ? [] : [read];\n });\n return [{ question, header: asString(entry.header), multiSelect: entry.multiSelect === true, options }];\n });\n}\n\nexport function emptyDraft(count: number): QuestionnaireDraft {\n return Array.from({ length: count }, () => EMPTY_ENTRY);\n}\n\nexport function draftEntry(draft: QuestionnaireDraft, index: number): QuestionDraft {\n return draft[index] ?? EMPTY_ENTRY;\n}\n\nfunction withEntry(draft: QuestionnaireDraft, index: number, patch: Partial<QuestionDraft>): QuestionnaireDraft {\n if (index < 0 || index >= draft.length) return draft;\n return draft.map((entry, position) => (position === index ? { ...entry, ...patch } : entry));\n}\n\n/**\n * Picks an option. A single-select question replaces its choice; a multiSelect\n * one toggles. Either way the typed answer is dropped, because an option and\n * free text are two answers to the same question and only one can be sent.\n */\nexport function chooseOption(\n draft: QuestionnaireDraft,\n index: number,\n label: string,\n multiSelect: boolean,\n): QuestionnaireDraft {\n const current = draftEntry(draft, index).selected;\n const selected = multiSelect\n ? current.includes(label)\n ? current.filter((entry) => entry !== label)\n : [...current, label]\n : [label];\n return withEntry(draft, index, { selected, custom: null });\n}\n\n/** Types an answer instead of choosing one; null returns to the options. */\nexport function setCustom(draft: QuestionnaireDraft, index: number, custom: string | null): QuestionnaireDraft {\n return withEntry(draft, index, { custom, selected: [] });\n}\n\nexport function setNotes(draft: QuestionnaireDraft, index: number, notes: string): QuestionnaireDraft {\n return withEntry(draft, index, { notes });\n}\n\nexport function isAnswered(entry: QuestionDraft): boolean {\n return entry.selected.length > 0 || (entry.custom !== null && entry.custom.trim() !== '');\n}\n\n/** The next question still needing an answer, searching after `from` first; -1 when none is left. */\nexport function nextUnanswered(draft: QuestionnaireDraft, from: number): number {\n const after = draft.findIndex((entry, index) => index > from && !isAnswered(entry));\n return after >= 0 ? after : draft.findIndex((entry) => !isAnswered(entry));\n}\n\nexport function isComplete(draft: QuestionnaireDraft): boolean {\n return draft.length > 0 && draft.every(isAnswered);\n}\n\n/**\n * The answers as the tool reads them back. `preview` is left off: the session\n * half looks it up from the option it declared, so sending one here would only\n * be a claim it has to ignore.\n */\nexport function draftAnswers(questions: readonly PromptQuestion[], draft: QuestionnaireDraft): QuestionAnswer[] {\n return questions.flatMap((question, index): QuestionAnswer[] => {\n const entry = draftEntry(draft, index);\n if (!isAnswered(entry)) return [];\n const notes = entry.notes.trim();\n const base = { questionIndex: index, question: question.question, ...(notes === '' ? {} : { notes }) };\n if (entry.custom !== null && entry.custom.trim() !== '') {\n return [{ ...base, kind: 'custom' as const, answer: entry.custom }];\n }\n if (question.multiSelect) {\n return [{ ...base, kind: 'multi' as const, answer: null, selected: [...entry.selected] }];\n }\n return [{ ...base, kind: 'option' as const, answer: entry.selected[0] ?? null }];\n });\n}\n","import type { ToolPromptRenderProps } from '@agimon-ai/po-core/native';\nimport { Button, fontOf, Markdown, SectionLabel, selectionTick, Textarea } from '@agimon-ai/po-native-components';\nimport { useMemo, useState } from 'react';\nimport { Pressable, ScrollView, Text, View } from 'react-native';\nimport { StyleSheet } from 'react-native-unistyles';\n\nimport { encodeAnswerEnvelope } from '../../../../../../types/askUserWire';\nimport {\n chooseOption,\n CUSTOM_LABEL,\n draftAnswers,\n draftEntry,\n emptyDraft,\n isAnswered,\n isComplete,\n nextUnanswered,\n type PromptQuestion,\n type QuestionnaireDraft,\n readPromptQuestions,\n setCustom,\n setNotes,\n} from '../_lib/questionnaireDraft';\n\nexport interface QuestionnaireViewProps {\n questions: readonly PromptQuestion[];\n draft: QuestionnaireDraft;\n current: number;\n previewIndex: number;\n onDraft: (draft: QuestionnaireDraft, settles: boolean) => void;\n onCurrent: (index: number) => void;\n onPreview: (index: number) => void;\n onSubmit: () => void;\n onCancel: () => void;\n}\n\n/** Pure presentation for the approved-target stories and the native prompt host. */\nexport function QuestionnaireView(props: QuestionnaireViewProps) {\n const { questions, draft, current, previewIndex, onDraft, onCurrent, onPreview, onSubmit, onCancel } = props;\n const question = questions[current];\n const entry = draftEntry(draft, current);\n const preview = question?.options[previewIndex]?.preview;\n return (\n <View style={styles.frame} testID=\"questionnaire\">\n <ScrollView horizontal contentContainerStyle={styles.steps} accessibilityLabel=\"Questions\">\n {questions.map((step, index) => (\n <Button\n key={`${String(index)}:${step.question}`}\n size=\"card\"\n variant={index === current ? 'secondary' : 'ghost'}\n aria-selected={index === current}\n accessibilityLabel={`${step.header || `Question ${String(index + 1)}`}, ${isAnswered(draftEntry(draft, index)) ? 'answered' : 'not answered'}`}\n testID={`questionnaire-step-${String(index)}`}\n onPress={() => {\n selectionTick();\n onCurrent(index);\n }}\n >\n {`${isAnswered(draftEntry(draft, index)) ? '✓ ' : ''}${step.header || `Question ${String(index + 1)}`}`}\n </Button>\n ))}\n </ScrollView>\n <ScrollView style={styles.body} contentContainerStyle={styles.content} keyboardShouldPersistTaps=\"handled\">\n {question ? (\n <>\n <Text style={styles.meta}>\n Question {current + 1} / {questions.length}\n {question.multiSelect ? ' · Choose any that fit' : ''}\n </Text>\n <Text style={styles.question} testID=\"questionnaire-question\">\n {question.question}\n </Text>\n {question.options.map((option, index) => {\n const chosen = entry.custom === null && entry.selected.includes(option.label);\n return (\n <Pressable\n key={`${String(index)}:${option.label}`}\n accessibilityRole={question.multiSelect ? 'checkbox' : 'radio'}\n aria-checked={chosen}\n accessibilityLabel={option.label}\n accessibilityHint={option.description}\n testID={`questionnaire-option-${String(index)}`}\n style={[styles.option, chosen && styles.chosen]}\n onFocus={() => onPreview(index)}\n onPress={() => {\n selectionTick();\n onPreview(index);\n onDraft(chooseOption(draft, current, option.label, question.multiSelect), !question.multiSelect);\n }}\n >\n <Text style={[styles.mark, chosen && styles.selectedInk]}>\n {question.multiSelect ? (chosen ? '☑' : '☐') : chosen ? '●' : '○'}\n </Text>\n <View style={styles.optionText}>\n <Text style={styles.label}>{option.label}</Text>\n {option.description ? <Text style={styles.meta}>{option.description}</Text> : null}\n </View>\n </Pressable>\n );\n })}\n <Button\n variant={entry.custom === null ? 'ghost' : 'secondary'}\n size=\"card\"\n testID=\"questionnaire-option-custom\"\n onPress={() => onDraft(setCustom(draft, current, entry.custom ?? ''), false)}\n >\n {CUSTOM_LABEL}\n </Button>\n {entry.custom !== null ? (\n <View style={styles.field}>\n <SectionLabel>Your answer</SectionLabel>\n <Textarea\n autoFocus\n rows={2}\n accessibilityLabel=\"Your answer\"\n testID=\"questionnaire-custom\"\n value={entry.custom}\n placeholder=\"type your answer…\"\n onChangeText={(value) => onDraft(setCustom(draft, current, value), false)}\n />\n </View>\n ) : null}\n {preview && entry.custom === null ? (\n <View style={styles.preview} testID=\"questionnaire-preview\">\n <SectionLabel>Preview</SectionLabel>\n <Markdown text={preview} />\n </View>\n ) : null}\n <View style={styles.field}>\n <SectionLabel>Note (optional)</SectionLabel>\n <Textarea\n rows={1}\n accessibilityLabel=\"Note (optional)\"\n testID=\"questionnaire-notes\"\n value={entry.notes}\n placeholder=\"anything the options do not cover\"\n onChangeText={(value) => onDraft(setNotes(draft, current, value), false)}\n />\n </View>\n </>\n ) : (\n <Text style={styles.meta}>the agent asked something this cockpit could not read</Text>\n )}\n </ScrollView>\n <View style={styles.actions}>\n {questions.length > 1 && !isComplete(draft) ? (\n <Button\n size=\"card\"\n disabled={!isAnswered(entry)}\n onPress={() => onDraft(draft, true)}\n testID=\"questionnaire-next\"\n >\n Next question\n </Button>\n ) : null}\n <Button size=\"card\" onPress={onCancel} testID=\"questionnaire-cancel\">\n cancel\n </Button>\n <Button\n size=\"card\"\n variant=\"primary\"\n disabled={!isComplete(draft)}\n onPress={onSubmit}\n testID=\"questionnaire-submit\"\n >\n submit answers\n </Button>\n </View>\n </View>\n );\n}\n\nfunction Questionnaire({\n questions,\n answer,\n cancel,\n}: {\n questions: readonly PromptQuestion[];\n answer: ToolPromptRenderProps['answer'];\n cancel: ToolPromptRenderProps['cancel'];\n}) {\n const [draft, setDraft] = useState(() => emptyDraft(questions.length));\n const [current, setCurrent] = useState(0);\n const [previewIndex, setPreviewIndex] = useState(0);\n const show = (index: number) => {\n setCurrent(index);\n setPreviewIndex(0);\n };\n return (\n <QuestionnaireView\n questions={questions}\n draft={draft}\n current={current}\n previewIndex={previewIndex}\n onDraft={(next, settles) => {\n setDraft(next);\n if (!settles) return;\n const pending = nextUnanswered(next, current);\n if (pending >= 0 && pending !== current) show(pending);\n }}\n onCurrent={show}\n onPreview={setPreviewIndex}\n onSubmit={() => {\n if (isComplete(draft)) answer(encodeAnswerEnvelope(draftAnswers(questions, draft)));\n }}\n onCancel={cancel}\n />\n );\n}\n\n/** The dialog identity owns the draft, so another session or request cannot inherit its answers. */\nexport function QuestionnairePrompt({ args, sessionId, dialog, answer, cancel }: ToolPromptRenderProps) {\n const questions = useMemo(() => readPromptQuestions(args), [args]);\n return (\n <Questionnaire\n key={`${sessionId}:${dialog.id}:${String(questions.length)}`}\n questions={questions}\n answer={answer}\n cancel={cancel}\n />\n );\n}\n\nconst styles = StyleSheet.create((theme) => ({\n frame: {\n maxHeight: '75%',\n flexShrink: 1,\n backgroundColor: theme.colors.rail,\n borderTopWidth: 1,\n borderColor: theme.colors['edge-magenta'],\n },\n steps: { gap: theme.spacing(2), padding: theme.spacing(3) },\n body: { flexShrink: 1 },\n content: { gap: theme.spacing(2), paddingHorizontal: theme.spacing(3), paddingBottom: theme.spacing(3) },\n question: {\n fontFamily: fontOf(theme.fontFamily.sans),\n fontSize: theme.fontSize.base,\n lineHeight: theme.lineHeightRelaxed.base,\n color: theme.colors.hi,\n },\n meta: {\n fontFamily: fontOf(theme.fontFamily.sans),\n fontSize: theme.fontSize.sm,\n lineHeight: theme.lineHeightRelaxed.sm,\n color: theme.colors.dim,\n },\n option: {\n flexDirection: 'row',\n gap: theme.spacing(3),\n minHeight: 44,\n padding: theme.spacing(3),\n borderWidth: 1,\n borderColor: theme.colors['border-soft'],\n borderRadius: theme.borderRadius.md,\n },\n chosen: { borderColor: theme.colors['edge-magenta'], backgroundColor: theme.colors['tint-magenta'] },\n mark: { fontFamily: fontOf(theme.fontFamily.sans), fontSize: theme.fontSize.lg, color: theme.colors.dim },\n selectedInk: { color: theme.colors.magenta },\n optionText: { flex: 1, gap: theme.spacing(1) },\n label: {\n fontFamily: fontOf(theme.fontFamily.sans),\n fontSize: theme.fontSize.base,\n lineHeight: theme.lineHeightRelaxed.base,\n fontWeight: theme.fontWeight.semibold,\n color: theme.colors.text,\n },\n field: { gap: theme.spacing(2) },\n preview: {\n gap: theme.spacing(2),\n paddingLeft: theme.spacing(3),\n borderLeftWidth: 2,\n borderColor: theme.colors['edge-magenta'],\n },\n actions: {\n flexDirection: 'row',\n flexWrap: 'wrap',\n justifyContent: 'flex-end',\n gap: theme.spacing(2),\n padding: theme.spacing(3),\n borderTopWidth: 1,\n borderColor: theme.colors['border-soft'],\n },\n}));\n","import { defineToolRenderer } from '@agimon-ai/po-core/native';\n\nimport { AskUserQuestionToolMessage } from './_components/AskUserQuestionToolMessage.native';\nimport { QuestionnairePrompt } from './_components/QuestionnairePrompt.native';\nimport { readPromptQuestions } from './_lib/questionnaireDraft';\n\nexport default defineToolRenderer({\n message: AskUserQuestionToolMessage,\n prompt: {\n claims: (dialog, args) =>\n dialog.method === 'select' &&\n readPromptQuestions(args).some((question) => dialog.title.startsWith(question.question)),\n component: QuestionnairePrompt,\n },\n});\n","// Generated by @agimon-ai/po-build. Do not edit by hand.\nimport { defineNativePlugin, type WebPluginContributions } from '@agimon-ai/po-core/native';\n\nimport toolAskUserQuestion from '../src/extensions/workspaces/sessions/(frontend)/tool/askUserQuestion.native';\n\nconst via = <T>(identity: Record<string, unknown>, value: unknown): T =>\n (value === undefined ? undefined : { ...identity, ...(value as object) }) as T;\n\nexport const nativePlugin = defineNativePlugin({\n id: 'ask-user',\n session: {\n get toolRenderers(): WebPluginContributions['toolRenderers'] { return [via({ tools: ['ask_user_question'] }, toolAskUserQuestion)]; },\n },\n});\n"],"mappings":";;;;;;;;;;AASA,SAASA,WAAS,OAAkD;CAClE,OAAO,OAAO,UAAU,YAAY,UAAU,QAAQ,CAAC,MAAM,QAAQ,KAAK;AAC5E;AAEA,SAASC,WAAS,OAAwB;CACxC,OAAO,OAAO,UAAU,WAAW,QAAQ;AAC7C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OiF,MAAMc,WAAWC,IAAI;EACxCC,UAAUhB,MAAMgB,SAASC;EACzBC,YAAYlB,MAAMmB,kBAAkBF;EACpCe,YAAYhC,MAAMgC,WAAWC;EAC7Bb,OAAOpB,MAAMI,OAAO8B;EAAI1B,mBAAA,CAAA,CAAA;CAC1B;CACA3B,OAAO;EAAE4B,KAAKT,MAAMU,QAAQ,CAAC;EAACF,mBAAA,CAAA,CAAA;CAAC;CAC/BnD,SAAS;EACPoD,KAAKT,MAAMU,QAAQ,CAAC;EACpByB,aAAanC,MAAMU,QAAQ,CAAC;EAC5B0B,iBAAiB;EACjB7B,aAAaP,MAAMI,OAAO;EAAeI,mBAAA,CAAA,CAAA;CAC3C;CACAxB,SAAS;EACPwC,eAAe;EACfa,UAAU;EACVC,gBAAgB;EAChB7B,KAAKT,MAAMU,QAAQ,CAAC;EACpBC,SAASX,MAAMU,QAAQ,CAAC;EACxBJ,gBAAgB;EAChBC,aAAaP,MAAMI,OAAO;EAAcI,mBAAA,CAAA,CAAA;CAC1C;AACF,EAAE;;;ACnRF,IAAA,iCAAe,mBAAmB;CAChC,SAAS;CACT,QAAQ;EACN,SAAS,QAAQ,SACf,OAAO,WAAW,YAClB,oBAAoB,IAAI,CAAC,CAAC,MAAM,aAAa,OAAO,MAAM,WAAW,SAAS,QAAQ,CAAC;EACzF,WAAW;CACb;AACF,CAAC;;;ACTD,MAAM,OAAU,UAAmC,UAChD,UAAU,KAAA,IAAY,KAAA,IAAY;CAAE,GAAG;CAAU,GAAI;AAAiB;AAEzE,MAAa,eAAe,mBAAmB;CAC7C,IAAI;CACJ,SAAS,EACP,IAAI,gBAAyD;EAAE,OAAO,CAAC,IAAI,EAAE,OAAO,CAAC,mBAAmB,EAAE,GAAG+B,8BAAmB,CAAC;CAAG,EACtI;AACF,CAAC"}
1
+ {"version":3,"file":"native.mjs","names":["isRecord","asString","ToolMessageRenderProps","fontOf","MessageItem","MessageItemBody","MessageItemHeader","MessageItemStatus","toolTone","StyleSheet","askCallSummary","askResultView","AskUserQuestionToolMessage","props","summary","args","view","result","details","output","count","headers","running","kind","answers","length","styles","map","answer","index","String","question","text","check","prompt","isError","error","undefined","create","theme","gap","spacing","uni__dependencies","fontFamily","sans","fontSize","base","lineHeight","lineHeightRelaxed","color","colors","dim","green","cyan","red","styles","ToolPromptRenderProps","Button","fontOf","Markdown","SectionLabel","selectionTick","Textarea","useMemo","useState","StyleSheet","encodeAnswerEnvelope","chooseOption","CUSTOM_LABEL","draftAnswers","draftEntry","emptyDraft","isAnswered","isComplete","nextUnanswered","PromptQuestion","QuestionnaireDraft","readPromptQuestions","setCustom","setNotes","QuestionnaireViewProps","questions","draft","current","previewIndex","onDraft","settles","onCurrent","index","onPreview","onSubmit","onCancel","QuestionnaireView","props","question","entry","preview","options","styles","frame","steps","map","step","String","header","body","content","meta","length","multiSelect","option","chosen","custom","selected","includes","label","description","mark","selectedInk","optionText","field","value","notes","actions","Questionnaire","answer","cancel","setDraft","setCurrent","setPreviewIndex","show","next","pending","QuestionnairePrompt","args","sessionId","dialog","id","create","theme","maxHeight","flexShrink","backgroundColor","colors","rail","borderTopWidth","borderColor","uni__dependencies","gap","spacing","padding","paddingHorizontal","paddingBottom","fontFamily","sans","fontSize","base","lineHeight","lineHeightRelaxed","color","hi","sm","dim","flexDirection","minHeight","borderWidth","borderRadius","md","lg","magenta","flex","fontWeight","semibold","text","paddingLeft","borderLeftWidth","flexWrap","justifyContent","toolAskUserQuestion"],"sources":["../../src/extensions/workspaces/sessions/(frontend)/tool/_lib/askUserText.ts","../../src/extensions/workspaces/sessions/(frontend)/tool/_components/AskUserQuestionToolMessage.native.tsx","../../src/types/askUserWire.ts","../../src/extensions/workspaces/sessions/(frontend)/tool/_lib/questionnaireDraft.ts","../../src/extensions/workspaces/sessions/(frontend)/tool/_components/QuestionnairePrompt.native.tsx","../../src/extensions/workspaces/sessions/(frontend)/tool/askUserQuestion.native.tsx","../../generated/native.ts"],"sourcesContent":["/**\n * Pure text shaping for the ask_user_question card, apart from React so the\n * unit suite covers it without a DOM. Args and details are wire JSON; the\n * shapes narrowed here mirror src/types/questionnaire.ts, which this browser\n * module may not import at runtime.\n */\n\ntype Args = Readonly<Record<string, unknown>>;\n\nfunction isRecord(value: unknown): value is Record<string, unknown> {\n return typeof value === 'object' && value !== null && !Array.isArray(value);\n}\n\nfunction asString(value: unknown): string {\n return typeof value === 'string' ? value : '';\n}\n\nexport interface AskCallSummary {\n /** \"N question(s)\", the TUI heading's purpose. */\n count: string;\n /** The question headers, comma separated; empty when none carry one. */\n headers: string;\n}\n\n/** The call header: how many questions, and their headers in parentheses. */\nexport function askCallSummary(args: Args): AskCallSummary {\n const questions = Array.isArray(args.questions) ? args.questions.filter(isRecord) : [];\n const headers = questions.map((question) => asString(question.header)).filter(Boolean);\n return {\n count: `${questions.length} question${questions.length === 1 ? '' : 's'}`,\n headers: headers.join(', '),\n };\n}\n\nexport interface AnsweredQuestion {\n question: string;\n answer: string;\n}\n\nexport type AskResultView =\n | { kind: 'cancelled' }\n | { kind: 'voice'; prompt: string }\n | { kind: 'answers'; answers: AnsweredQuestion[] }\n | { kind: 'text'; text: string };\n\n/**\n * The result body the TUI's renderResult chooses: a cancelled glyph, the\n * voice prompt when the questionnaire was handed to voice, the answered\n * list, or the raw text when the tool attached no details (an error path).\n */\nexport function askResultView(details: unknown, output: string): AskResultView {\n if (!isRecord(details) || !Array.isArray(details.answers)) return { kind: 'text', text: output };\n if (details.cancelled === true) return { kind: 'cancelled' };\n if (details.delivery === 'voice' && typeof details.voicePrompt === 'string') {\n return { kind: 'voice', prompt: details.voicePrompt };\n }\n const answers = details.answers.filter(isRecord).map((answer) => ({\n question: asString(answer.question),\n answer:\n answer.kind === 'multi'\n ? (Array.isArray(answer.selected) ? answer.selected : []).filter((v) => typeof v === 'string').join(', ')\n : asString(answer.answer),\n }));\n return { kind: 'answers', answers };\n}\n","import type { ToolMessageRenderProps } from '@agimon-ai/po-core/native';\nimport {\n fontOf,\n MessageItem,\n MessageItemBody,\n MessageItemHeader,\n MessageItemStatus,\n toolTone,\n} from '@agimon-ai/po-native-components';\nimport { Text, View } from 'react-native';\nimport { StyleSheet } from 'react-native-unistyles';\n\nimport { askCallSummary, askResultView } from '../_lib/askUserText';\n\nexport function AskUserQuestionToolMessage(props: ToolMessageRenderProps) {\n const summary = askCallSummary(props.args);\n const view = askResultView(props.result?.details, props.output);\n return (\n <MessageItem tone={toolTone(props)}>\n <MessageItemHeader title=\"ask_user_question\">{`${summary.count}${summary.headers ? ` (${summary.headers})` : ''}`}</MessageItemHeader>\n <MessageItemBody testID=\"tool-result-ask_user_question\">\n {props.running ? (\n <MessageItemStatus tone=\"running\">running</MessageItemStatus>\n ) : view.kind === 'cancelled' ? (\n <MessageItemStatus tone=\"running\">cancelled</MessageItemStatus>\n ) : view.kind === 'answers' ? (\n view.answers.length === 0 ? (\n <MessageItemStatus tone=\"ok\">submitted</MessageItemStatus>\n ) : (\n <View style={styles.answers}>\n {view.answers.map((answer, index) => (\n <Text key={`${String(index)}:${answer.question}`} style={styles.text}>\n <Text style={styles.check}>✓ </Text>\n <Text style={styles.question}>{answer.question}</Text>: {answer.answer}\n </Text>\n ))}\n </View>\n )\n ) : view.kind === 'voice' ? (\n <Text style={styles.text}>{view.prompt}</Text>\n ) : view.text ? (\n <Text\n style={[styles.text, props.isError && styles.error]}\n accessibilityRole={props.isError ? 'alert' : undefined}\n >\n {view.text}\n </Text>\n ) : (\n <MessageItemStatus tone={props.isError ? 'error' : 'ok'}>\n {props.isError ? 'failed' : 'submitted'}\n </MessageItemStatus>\n )}\n </MessageItemBody>\n </MessageItem>\n );\n}\n\nconst styles = StyleSheet.create((theme) => ({\n answers: { gap: theme.spacing(2) },\n text: {\n fontFamily: fontOf(theme.fontFamily.sans),\n fontSize: theme.fontSize.base,\n lineHeight: theme.lineHeightRelaxed.base,\n color: theme.colors.dim,\n },\n check: { color: theme.colors.green },\n question: { color: theme.colors.cyan },\n error: { color: theme.colors.red },\n}));\n","import type { QuestionAnswer } from './questionnaire';\n\n/**\n * How a rich client answers the whole questionnaire in one reply.\n *\n * Pi's select request carries a title and a list of labels and nothing else,\n * so over RPC the questionnaire degrades into one request per question, asked\n * forwards only. A client that can already see the whole call (the cockpit\n * reads it from the tool's arguments) has no use for that: it renders every\n * question at once, lets the reader move between them, and replies once.\n *\n * The reply rides on the select response, because that is the only channel a\n * blocked extension has. An ordinary label is still an ordinary label, so a\n * client that knows nothing about this keeps the per-question flow exactly as\n * it was; only a response carrying the prefix is read as the whole set.\n *\n * It lives under src/types because that is the one server root a browser\n * bundle may read, so neither half can drift from the other.\n */\nexport const ANSWER_ENVELOPE_PREFIX = 'po-ask-user/v1:';\n\n/** A response that claims the prefix but cannot be read is refused, never guessed at. */\nexport type AnswerEnvelopeRead =\n | { readonly kind: 'absent' }\n | { readonly kind: 'malformed' }\n | { readonly kind: 'envelope'; readonly payload: unknown };\n\n/** Beyond this a response is not a questionnaire answer, whatever it claims. */\nexport const MAX_ENVELOPE_BYTES = 64 * 1024;\n\nexport function encodeAnswerEnvelope(answers: readonly QuestionAnswer[]): string {\n return `${ANSWER_ENVELOPE_PREFIX}${JSON.stringify({ answers })}`;\n}\n\nexport function decodeAnswerEnvelope(value: string | undefined): AnswerEnvelopeRead {\n if (value === undefined || !value.startsWith(ANSWER_ENVELOPE_PREFIX)) return { kind: 'absent' };\n if (value.length > MAX_ENVELOPE_BYTES) return { kind: 'malformed' };\n try {\n return { kind: 'envelope', payload: JSON.parse(value.slice(ANSWER_ENVELOPE_PREFIX.length)) };\n } catch {\n // Unreadable JSON behind the prefix: the sender meant an envelope and got\n // it wrong, which is a refusal rather than a label the model should see.\n return { kind: 'malformed' };\n }\n}\n","/**\n * The questionnaire the cockpit is filling in, as a value.\n *\n * Apart from React so the unit suite covers it without a DOM, the same way\n * askUserText.ts is. The questions come from the running tool call's\n * arguments, which are wire JSON: the shapes narrowed here mirror\n * src/schemas/questionnaire.ts, which a browser module may not import.\n *\n * Everything is held here until the reader submits, which is the whole point.\n * A step the reader goes back to still has what they chose, and the agent is\n * asked once rather than once per question.\n */\nimport type { QuestionAnswer } from '../../../../../../types/questionnaire';\n\n/** The row every question gets, so a reader always has a way past a bad set of options. */\nexport const CUSTOM_LABEL = 'Type something.';\n\nexport interface PromptOption {\n label: string;\n description: string;\n preview?: string;\n}\n\nexport interface PromptQuestion {\n question: string;\n header: string;\n multiSelect: boolean;\n options: PromptOption[];\n}\n\nexport interface QuestionDraft {\n /** Chosen option labels: at most one unless the question is multiSelect. */\n selected: string[];\n /** Text typed in place of an option; null while the reader has not typed any. */\n custom: string | null;\n notes: string;\n}\n\nexport type QuestionnaireDraft = readonly QuestionDraft[];\n\nconst EMPTY_ENTRY: QuestionDraft = { selected: [], custom: null, notes: '' };\n\nfunction isRecord(value: unknown): value is Record<string, unknown> {\n return typeof value === 'object' && value !== null && !Array.isArray(value);\n}\n\nfunction asString(value: unknown): string {\n return typeof value === 'string' ? value : '';\n}\n\nfunction readOption(value: unknown): PromptOption | null {\n if (!isRecord(value)) return null;\n const label = asString(value.label);\n if (label === '') return null;\n const preview = asString(value.preview);\n return { label, description: asString(value.description), ...(preview === '' ? {} : { preview }) };\n}\n\n/** The questions as the tool was called with them; an unreadable call yields none. */\nexport function readPromptQuestions(args: Readonly<Record<string, unknown>>): PromptQuestion[] {\n if (!Array.isArray(args.questions)) return [];\n return args.questions.flatMap((entry) => {\n if (!isRecord(entry)) return [];\n const question = asString(entry.question);\n if (question === '') return [];\n const options = (Array.isArray(entry.options) ? entry.options : []).flatMap((option) => {\n const read = readOption(option);\n return read === null ? [] : [read];\n });\n return [{ question, header: asString(entry.header), multiSelect: entry.multiSelect === true, options }];\n });\n}\n\nexport function emptyDraft(count: number): QuestionnaireDraft {\n return Array.from({ length: count }, () => EMPTY_ENTRY);\n}\n\nexport function draftEntry(draft: QuestionnaireDraft, index: number): QuestionDraft {\n return draft[index] ?? EMPTY_ENTRY;\n}\n\nfunction withEntry(draft: QuestionnaireDraft, index: number, patch: Partial<QuestionDraft>): QuestionnaireDraft {\n if (index < 0 || index >= draft.length) return draft;\n return draft.map((entry, position) => (position === index ? { ...entry, ...patch } : entry));\n}\n\n/**\n * Picks an option. A single-select question replaces its choice; a multiSelect\n * one toggles. Either way the typed answer is dropped, because an option and\n * free text are two answers to the same question and only one can be sent.\n */\nexport function chooseOption(\n draft: QuestionnaireDraft,\n index: number,\n label: string,\n multiSelect: boolean,\n): QuestionnaireDraft {\n const current = draftEntry(draft, index).selected;\n const selected = multiSelect\n ? current.includes(label)\n ? current.filter((entry) => entry !== label)\n : [...current, label]\n : [label];\n return withEntry(draft, index, { selected, custom: null });\n}\n\n/** Types an answer instead of choosing one; null returns to the options. */\nexport function setCustom(draft: QuestionnaireDraft, index: number, custom: string | null): QuestionnaireDraft {\n return withEntry(draft, index, { custom, selected: [] });\n}\n\nexport function setNotes(draft: QuestionnaireDraft, index: number, notes: string): QuestionnaireDraft {\n return withEntry(draft, index, { notes });\n}\n\nexport function isAnswered(entry: QuestionDraft): boolean {\n return entry.selected.length > 0 || (entry.custom !== null && entry.custom.trim() !== '');\n}\n\n/** The next question still needing an answer, searching after `from` first; -1 when none is left. */\nexport function nextUnanswered(draft: QuestionnaireDraft, from: number): number {\n const after = draft.findIndex((entry, index) => index > from && !isAnswered(entry));\n return after >= 0 ? after : draft.findIndex((entry) => !isAnswered(entry));\n}\n\nexport function isComplete(draft: QuestionnaireDraft): boolean {\n return draft.length > 0 && draft.every(isAnswered);\n}\n\n/**\n * The answers as the tool reads them back. `preview` is left off: the session\n * half looks it up from the option it declared, so sending one here would only\n * be a claim it has to ignore.\n */\nexport function draftAnswers(questions: readonly PromptQuestion[], draft: QuestionnaireDraft): QuestionAnswer[] {\n return questions.flatMap((question, index): QuestionAnswer[] => {\n const entry = draftEntry(draft, index);\n if (!isAnswered(entry)) return [];\n const notes = entry.notes.trim();\n const base = { questionIndex: index, question: question.question, ...(notes === '' ? {} : { notes }) };\n if (entry.custom !== null && entry.custom.trim() !== '') {\n return [{ ...base, kind: 'custom' as const, answer: entry.custom }];\n }\n if (question.multiSelect) {\n return [{ ...base, kind: 'multi' as const, answer: null, selected: [...entry.selected] }];\n }\n return [{ ...base, kind: 'option' as const, answer: entry.selected[0] ?? null }];\n });\n}\n","import type { ToolPromptRenderProps } from '@agimon-ai/po-core/native';\nimport { Button, fontOf, Markdown, SectionLabel, selectionTick, Textarea } from '@agimon-ai/po-native-components';\nimport { useMemo, useState } from 'react';\nimport { Pressable, ScrollView, Text, View } from 'react-native';\nimport { StyleSheet } from 'react-native-unistyles';\n\nimport { encodeAnswerEnvelope } from '../../../../../../types/askUserWire';\nimport {\n chooseOption,\n CUSTOM_LABEL,\n draftAnswers,\n draftEntry,\n emptyDraft,\n isAnswered,\n isComplete,\n nextUnanswered,\n type PromptQuestion,\n type QuestionnaireDraft,\n readPromptQuestions,\n setCustom,\n setNotes,\n} from '../_lib/questionnaireDraft';\n\nexport interface QuestionnaireViewProps {\n questions: readonly PromptQuestion[];\n draft: QuestionnaireDraft;\n current: number;\n previewIndex: number;\n onDraft: (draft: QuestionnaireDraft, settles: boolean) => void;\n onCurrent: (index: number) => void;\n onPreview: (index: number) => void;\n onSubmit: () => void;\n onCancel: () => void;\n}\n\n/** Pure presentation for the approved-target stories and the native prompt host. */\nexport function QuestionnaireView(props: QuestionnaireViewProps) {\n const { questions, draft, current, previewIndex, onDraft, onCurrent, onPreview, onSubmit, onCancel } = props;\n const question = questions[current];\n const entry = draftEntry(draft, current);\n const preview = question?.options[previewIndex]?.preview;\n return (\n <View style={styles.frame} testID=\"questionnaire\">\n <ScrollView horizontal contentContainerStyle={styles.steps} accessibilityLabel=\"Questions\">\n {questions.map((step, index) => (\n <Button\n key={`${String(index)}:${step.question}`}\n size=\"card\"\n variant={index === current ? 'secondary' : 'ghost'}\n aria-selected={index === current}\n accessibilityLabel={`${step.header || `Question ${String(index + 1)}`}, ${isAnswered(draftEntry(draft, index)) ? 'answered' : 'not answered'}`}\n testID={`questionnaire-step-${String(index)}`}\n onPress={() => {\n selectionTick();\n onCurrent(index);\n }}\n >\n {`${isAnswered(draftEntry(draft, index)) ? '✓ ' : ''}${step.header || `Question ${String(index + 1)}`}`}\n </Button>\n ))}\n </ScrollView>\n <ScrollView style={styles.body} contentContainerStyle={styles.content} keyboardShouldPersistTaps=\"handled\">\n {question ? (\n <>\n <Text style={styles.meta}>\n Question {current + 1} / {questions.length}\n {question.multiSelect ? ' · Choose any that fit' : ''}\n </Text>\n <Text style={styles.question} testID=\"questionnaire-question\">\n {question.question}\n </Text>\n {question.options.map((option, index) => {\n const chosen = entry.custom === null && entry.selected.includes(option.label);\n return (\n <Pressable\n key={`${String(index)}:${option.label}`}\n accessibilityRole={question.multiSelect ? 'checkbox' : 'radio'}\n aria-checked={chosen}\n accessibilityLabel={option.label}\n accessibilityHint={option.description}\n testID={`questionnaire-option-${String(index)}`}\n style={[styles.option, chosen && styles.chosen]}\n onFocus={() => onPreview(index)}\n onPress={() => {\n selectionTick();\n onPreview(index);\n onDraft(chooseOption(draft, current, option.label, question.multiSelect), !question.multiSelect);\n }}\n >\n <Text style={[styles.mark, chosen && styles.selectedInk]}>\n {question.multiSelect ? (chosen ? '☑' : '☐') : chosen ? '●' : '○'}\n </Text>\n <View style={styles.optionText}>\n <Text style={styles.label}>{option.label}</Text>\n {option.description ? <Text style={styles.meta}>{option.description}</Text> : null}\n </View>\n </Pressable>\n );\n })}\n <Button\n variant={entry.custom === null ? 'ghost' : 'secondary'}\n size=\"card\"\n testID=\"questionnaire-option-custom\"\n onPress={() => onDraft(setCustom(draft, current, entry.custom ?? ''), false)}\n >\n {CUSTOM_LABEL}\n </Button>\n {entry.custom !== null ? (\n <View style={styles.field}>\n <SectionLabel>Your answer</SectionLabel>\n <Textarea\n autoFocus\n rows={2}\n accessibilityLabel=\"Your answer\"\n testID=\"questionnaire-custom\"\n value={entry.custom}\n placeholder=\"type your answer…\"\n onChangeText={(value) => onDraft(setCustom(draft, current, value), false)}\n />\n </View>\n ) : null}\n {preview && entry.custom === null ? (\n <View style={styles.preview} testID=\"questionnaire-preview\">\n <SectionLabel>Preview</SectionLabel>\n <Markdown text={preview} />\n </View>\n ) : null}\n <View style={styles.field}>\n <SectionLabel>Note (optional)</SectionLabel>\n <Textarea\n rows={1}\n accessibilityLabel=\"Note (optional)\"\n testID=\"questionnaire-notes\"\n value={entry.notes}\n placeholder=\"anything the options do not cover\"\n onChangeText={(value) => onDraft(setNotes(draft, current, value), false)}\n />\n </View>\n </>\n ) : (\n <Text style={styles.meta}>the agent asked something this cockpit could not read</Text>\n )}\n </ScrollView>\n <View style={styles.actions}>\n {questions.length > 1 && !isComplete(draft) ? (\n <Button\n size=\"card\"\n disabled={!isAnswered(entry)}\n onPress={() => onDraft(draft, true)}\n testID=\"questionnaire-next\"\n >\n Next question\n </Button>\n ) : null}\n <Button size=\"card\" onPress={onCancel} testID=\"questionnaire-cancel\">\n cancel\n </Button>\n <Button\n size=\"card\"\n variant=\"primary\"\n disabled={!isComplete(draft)}\n onPress={onSubmit}\n testID=\"questionnaire-submit\"\n >\n submit answers\n </Button>\n </View>\n </View>\n );\n}\n\nfunction Questionnaire({\n questions,\n answer,\n cancel,\n}: {\n questions: readonly PromptQuestion[];\n answer: ToolPromptRenderProps['answer'];\n cancel: ToolPromptRenderProps['cancel'];\n}) {\n const [draft, setDraft] = useState(() => emptyDraft(questions.length));\n const [current, setCurrent] = useState(0);\n const [previewIndex, setPreviewIndex] = useState(0);\n const show = (index: number) => {\n setCurrent(index);\n setPreviewIndex(0);\n };\n return (\n <QuestionnaireView\n questions={questions}\n draft={draft}\n current={current}\n previewIndex={previewIndex}\n onDraft={(next, settles) => {\n setDraft(next);\n if (!settles) return;\n const pending = nextUnanswered(next, current);\n if (pending >= 0 && pending !== current) show(pending);\n }}\n onCurrent={show}\n onPreview={setPreviewIndex}\n onSubmit={() => {\n if (isComplete(draft)) answer(encodeAnswerEnvelope(draftAnswers(questions, draft)));\n }}\n onCancel={cancel}\n />\n );\n}\n\n/** The dialog identity owns the draft, so another session or request cannot inherit its answers. */\nexport function QuestionnairePrompt({ args, sessionId, dialog, answer, cancel }: ToolPromptRenderProps) {\n const questions = useMemo(() => readPromptQuestions(args), [args]);\n return (\n <Questionnaire\n key={`${sessionId}:${dialog.id}:${String(questions.length)}`}\n questions={questions}\n answer={answer}\n cancel={cancel}\n />\n );\n}\n\nconst styles = StyleSheet.create((theme) => ({\n frame: {\n maxHeight: '75%',\n flexShrink: 1,\n backgroundColor: theme.colors.rail,\n borderTopWidth: 1,\n borderColor: theme.colors['edge-magenta'],\n },\n steps: { gap: theme.spacing(2), padding: theme.spacing(3) },\n body: { flexShrink: 1 },\n content: { gap: theme.spacing(2), paddingHorizontal: theme.spacing(3), paddingBottom: theme.spacing(3) },\n question: {\n fontFamily: fontOf(theme.fontFamily.sans),\n fontSize: theme.fontSize.base,\n lineHeight: theme.lineHeightRelaxed.base,\n color: theme.colors.hi,\n },\n meta: {\n fontFamily: fontOf(theme.fontFamily.sans),\n fontSize: theme.fontSize.sm,\n lineHeight: theme.lineHeightRelaxed.sm,\n color: theme.colors.dim,\n },\n option: {\n flexDirection: 'row',\n gap: theme.spacing(3),\n minHeight: 44,\n padding: theme.spacing(3),\n borderWidth: 1,\n borderColor: theme.colors['border-soft'],\n borderRadius: theme.borderRadius.md,\n },\n chosen: { borderColor: theme.colors['edge-magenta'], backgroundColor: theme.colors['tint-magenta'] },\n mark: { fontFamily: fontOf(theme.fontFamily.sans), fontSize: theme.fontSize.lg, color: theme.colors.dim },\n selectedInk: { color: theme.colors.magenta },\n optionText: { flex: 1, gap: theme.spacing(1) },\n label: {\n fontFamily: fontOf(theme.fontFamily.sans),\n fontSize: theme.fontSize.base,\n lineHeight: theme.lineHeightRelaxed.base,\n fontWeight: theme.fontWeight.semibold,\n color: theme.colors.text,\n },\n field: { gap: theme.spacing(2) },\n preview: {\n gap: theme.spacing(2),\n paddingLeft: theme.spacing(3),\n borderLeftWidth: 2,\n borderColor: theme.colors['edge-magenta'],\n },\n actions: {\n flexDirection: 'row',\n flexWrap: 'wrap',\n justifyContent: 'flex-end',\n gap: theme.spacing(2),\n padding: theme.spacing(3),\n borderTopWidth: 1,\n borderColor: theme.colors['border-soft'],\n },\n}));\n","import { defineToolRenderer } from '@agimon-ai/po-core/native';\n\nimport { AskUserQuestionToolMessage } from './_components/AskUserQuestionToolMessage.native';\nimport { QuestionnairePrompt } from './_components/QuestionnairePrompt.native';\nimport { readPromptQuestions } from './_lib/questionnaireDraft';\n\nexport default defineToolRenderer({\n message: AskUserQuestionToolMessage,\n prompt: {\n claims: (dialog, args) =>\n dialog.method === 'select' &&\n readPromptQuestions(args).some((question) => dialog.title.startsWith(question.question)),\n component: QuestionnairePrompt,\n },\n});\n","// Generated by @agimon-ai/po-build. Do not edit by hand.\nimport { defineNativePlugin, type WebPluginContributions } from '@agimon-ai/po-core/native';\n\nimport toolAskUserQuestion from '../src/extensions/workspaces/sessions/(frontend)/tool/askUserQuestion.native';\n\nconst via = <T>(identity: Record<string, unknown>, value: unknown): T =>\n (value === undefined ? undefined : { ...identity, ...(value as object) }) as T;\n\nexport const nativePlugin = defineNativePlugin({\n id: 'ask-user',\n session: {\n get toolRenderers(): WebPluginContributions['toolRenderers'] { return [via({ tools: ['ask_user_question'] }, toolAskUserQuestion)]; },\n },\n});\n"],"mappings":";;;;;;;;;;AASA,SAASA,WAAS,OAAkD;CAClE,OAAO,OAAO,UAAU,YAAY,UAAU,QAAQ,CAAC,MAAM,QAAQ,KAAK;AAC5E;AAEA,SAASC,WAAS,OAAwB;CACxC,OAAO,OAAO,UAAU,WAAW,QAAQ;AAC7C;;AAUA,SAAgB,eAAe,MAA4B;CACzD,MAAM,YAAY,MAAM,QAAQ,KAAK,SAAS,IAAI,KAAK,UAAU,OAAOD,UAAQ,IAAI,CAAC;CACrF,MAAM,UAAU,UAAU,KAAK,aAAaC,WAAS,SAAS,MAAM,CAAC,CAAC,CAAC,OAAO,OAAO;CACrF,OAAO;EACL,OAAO,GAAG,UAAU,O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EAACF,mBAAA,CAAA,CAAA;CAAC;CAC/BnD,SAAS;EACPoD,KAAKT,MAAMU,QAAQ,CAAC;EACpByB,aAAanC,MAAMU,QAAQ,CAAC;EAC5B0B,iBAAiB;EACjB7B,aAAaP,MAAMI,OAAO;EAAeI,mBAAA,CAAA,CAAA;CAC3C;CACAxB,SAAS;EACPwC,eAAe;EACfa,UAAU;EACVC,gBAAgB;EAChB7B,KAAKT,MAAMU,QAAQ,CAAC;EACpBC,SAASX,MAAMU,QAAQ,CAAC;EACxBJ,gBAAgB;EAChBC,aAAaP,MAAMI,OAAO;EAAcI,mBAAA,CAAA,CAAA;CAC1C;AACF,EAAE;;;ACnRF,IAAA,iCAAe,mBAAmB;CAChC,SAAS;CACT,QAAQ;EACN,SAAS,QAAQ,SACf,OAAO,WAAW,YAClB,oBAAoB,IAAI,CAAC,CAAC,MAAM,aAAa,OAAO,MAAM,WAAW,SAAS,QAAQ,CAAC;EACzF,WAAW;CACb;AACF,CAAC;;;ACTD,MAAM,OAAU,UAAmC,UAChD,UAAU,KAAA,IAAY,KAAA,IAAY;CAAE,GAAG;CAAU,GAAI;AAAiB;AAEzE,MAAa,eAAe,mBAAmB;CAC7C,IAAI;CACJ,SAAS,EACP,IAAI,gBAAyD;EAAE,OAAO,CAAC,IAAI,EAAE,OAAO,CAAC,mBAAmB,EAAE,GAAG+B,8BAAmB,CAAC;CAAG,EACtI;AACF,CAAC"}
@@ -2,7 +2,7 @@ Object.defineProperties(exports, {
2
2
  __esModule: { value: true },
3
3
  [Symbol.toStringTag]: { value: "Module" }
4
4
  });
5
- let _agimon_ai_po_core_serverFacet = require("@agimon-ai/po-core/serverFacet");
5
+ let _agimon_ai_po_core_serverPlugin = require("@agimon-ai/po-core/serverPlugin");
6
6
  let _agimon_ai_po_core_extensionFile = require("@agimon-ai/po-core/extensionFile");
7
7
  let _agimon_ai_po_core_help = require("@agimon-ai/po-core/help");
8
8
  let _agimon_ai_po_core_voiceTools = require("@agimon-ai/po-core/voiceTools");
@@ -122,8 +122,7 @@ const root = (0, _agimon_ai_po_core_extensionFile.defineRoot)((_context) => {
122
122
  return {
123
123
  value: { coordinator },
124
124
  onDispose: async () => {
125
- coordinator.shutdown();
126
- await coordinator.waitForIdle();
125
+ await (0, _agimon_ai_po_core_extensionFile.runCleanups)([() => coordinator.shutdown(), () => coordinator.waitForIdle()], "User-feedback cleanup failed.");
127
126
  }
128
127
  };
129
128
  });
@@ -134,9 +133,9 @@ var root_server_default = (0, _agimon_ai_po_core_extensionFile.defineRoot)(root)
134
133
  //#region src/extensions/workspaces/sessions/(backend)/resource/poUseUserFeedback.server.ts
135
134
  var poUseUserFeedback_server_default = (0, _agimon_ai_po_core_extensionFile.defineResource)({
136
135
  name: "po-use-user-feedback",
137
- when: _agimon_ai_po_core_help.DOOM_HELP_WHEN,
136
+ when: _agimon_ai_po_core_help.PO_HELP_WHEN,
138
137
  kind: "skill",
139
- read: () => (0, _agimon_ai_po_core_serverFacet.readPackageResource)(require("url").pathToFileURL(__filename).href, "src/prompts/po-use-user-feedback/SKILL.md")
138
+ read: () => (0, _agimon_ai_po_core_serverPlugin.readPackageResource)(require("url").pathToFileURL(__filename).href, "src/prompts/po-use-user-feedback/SKILL.md")
140
139
  });
141
140
  //#endregion
142
141
  //#region src/constants/questionnaire.ts
@@ -151,7 +150,7 @@ const ASK_USER_QUESTION_TOOL_NAME = "ask_user_question";
151
150
  //#endregion
152
151
  //#region src/extensions/workspaces/sessions/(backend)/tool-restriction/askUserQuestion.server.ts
153
152
  var askUserQuestion_server_default$1 = (0, _agimon_ai_po_core_extensionFile.defineToolRestriction)({
154
- when: { state: { "minor-mode": _agimon_ai_po_core_voiceTools.DOOM_VOICE_AUTO_MODE_ID } },
153
+ when: { state: { "minor-mode": _agimon_ai_po_core_voiceTools.PO_VOICE_AUTO_MODE_ID } },
155
154
  excludedTools: [ASK_USER_QUESTION_TOOL_NAME]
156
155
  });
157
156
  //#endregion
@@ -186,12 +185,12 @@ const QuestionParamsSchema = typebox.Type.Object({ questions: typebox.Type.Array
186
185
  description: "Questions to ask the user (1-4 questions)."
187
186
  }) }, { additionalProperties: false });
188
187
  function decodeAnswerEnvelope(value) {
189
- if (value === void 0 || !value.startsWith("doom-ask-user/v1:")) return { kind: "absent" };
188
+ if (value === void 0 || !value.startsWith("po-ask-user/v1:")) return { kind: "absent" };
190
189
  if (value.length > 65536) return { kind: "malformed" };
191
190
  try {
192
191
  return {
193
192
  kind: "envelope",
194
- payload: JSON.parse(value.slice(17))
193
+ payload: JSON.parse(value.slice(15))
195
194
  };
196
195
  } catch {
197
196
  return { kind: "malformed" };
@@ -593,11 +592,12 @@ const via = (identity, value) => value === void 0 ? void 0 : {
593
592
  ...identity,
594
593
  ...value
595
594
  };
596
- const facet = (0, _agimon_ai_po_core_serverFacet.defineServerPlugin)({
595
+ const serverPlugin = (0, _agimon_ai_po_core_serverPlugin.defineServerPlugin)({
597
596
  name: "@agimon-ai/po-user-feedback",
598
- providerOverrides: (0, _agimon_ai_po_core_serverFacet.composeServerProviderOverrides)(root_server_default),
597
+ providerOverrides: (0, _agimon_ai_po_core_serverPlugin.composeServerProviderOverrides)(root_server_default),
598
+ injects: (0, _agimon_ai_po_core_extensionFile.composeRootInjects)({ session: [root_server_default] }),
599
599
  session: async (context) => {
600
- const scopeSession = await root_server_default(context);
600
+ const scopeSession = await context.scopeRoot("session", root_server_default, context);
601
601
  const contextSession = {
602
602
  ...context,
603
603
  root: scopeSession.value
@@ -621,7 +621,7 @@ const facet = (0, _agimon_ai_po_core_serverFacet.defineServerPlugin)({
621
621
  }
622
622
  });
623
623
  //#endregion
624
- exports.default = facet;
625
- exports.facet = facet;
624
+ exports.default = serverPlugin;
625
+ exports.serverPlugin = serverPlugin;
626
626
 
627
627
  //# sourceMappingURL=server.cjs.map