@agimon-ai/po-session 0.0.0-alpha.21 → 0.0.0-alpha.210

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.
Files changed (38) hide show
  1. package/LICENSE +21 -149
  2. package/README.md +47 -1
  3. package/dist/apiContracts.cjs +34 -2
  4. package/dist/apiContracts.cjs.map +1 -1
  5. package/dist/apiContracts.d.mts +2 -2
  6. package/dist/apiContracts.d.mts.map +1 -1
  7. package/dist/apiContracts.mjs +35 -2
  8. package/dist/apiContracts.mjs.map +1 -1
  9. package/dist/extensions/native.mjs +410 -0
  10. package/dist/extensions/native.mjs.map +1 -0
  11. package/dist/extensions/server.cjs +1661 -113
  12. package/dist/extensions/server.cjs.map +1 -1
  13. package/dist/extensions/server.d.mts.map +1 -1
  14. package/dist/extensions/server.mjs +1657 -109
  15. package/dist/extensions/server.mjs.map +1 -1
  16. package/dist/extensions/web.mjs +361 -0
  17. package/dist/extensions/web.mjs.map +1 -0
  18. package/dist/index.cjs +410 -25
  19. package/dist/index.cjs.map +1 -0
  20. package/dist/index.d.mts +599 -82
  21. package/dist/index.d.mts.map +1 -1
  22. package/dist/index.mjs +358 -1
  23. package/dist/index.mjs.map +1 -0
  24. package/dist/po-runtime-identity.json +1 -0
  25. package/dist/type-BlbiS10p.mjs +2622 -0
  26. package/dist/type-BlbiS10p.mjs.map +1 -0
  27. package/dist/type-DZtqhE4a.cjs +3083 -0
  28. package/dist/type-DZtqhE4a.cjs.map +1 -0
  29. package/llms.txt +4 -1
  30. package/locales/vi.json +29 -0
  31. package/locales/zh-CN.json +29 -0
  32. package/package.json +96 -11
  33. package/src/prompts/codemode-how-to-network/SKILL.md +49 -0
  34. package/src/prompts/codemode-how-to-session/SKILL.md +25 -0
  35. package/dist/sessionDelivery-4svjzWUW.mjs +0 -1028
  36. package/dist/sessionDelivery-4svjzWUW.mjs.map +0 -1
  37. package/dist/sessionDelivery-CGWuQyLV.cjs +0 -1219
  38. package/dist/sessionDelivery-CGWuQyLV.cjs.map +0 -1
@@ -0,0 +1,410 @@
1
+ import { defineFill, defineHostStore, defineNativePlugin, defineToolRenderer, defineWebLifecycle, useT } from "@agimon-ai/po-core/native";
2
+ import { View } from "react-native-unistyles/components/native/View";
3
+ import { Text } from "react-native-unistyles/components/native/Text";
4
+ import { Button, Dot, EmptyState, Input, ListRow, MessageIcon, MessageItem, MessageItemBody, MessageItemHeader, MessageItemStatus, SearchIcon, SheetBody, SheetDescription, SheetFooter, fontOf, resultTextLines, toolTone } from "@agimon-ai/po-native-components";
5
+ import { useEffect, useMemo, useRef, useState } from "react";
6
+ import { StyleSheet } from "react-native-unistyles";
7
+ import { Fragment, jsx, jsxs } from "react/jsx-runtime";
8
+ //#region src/extensions/workspaces/sessions/(frontend)/_lib/sendToSessionDelivery.ts
9
+ /**
10
+ * Delivers one send through the started runtime that owns the sending session.
11
+ *
12
+ * DESIGN PATTERNS:
13
+ * - Host-neutral and stateless: the web and native request files each keep
14
+ * their own runtime list (from their own po-core entry) and pass it in.
15
+ * The phone starts one runtime per computer; a send goes through the one
16
+ * that owns the sending session, with that computer's local ids.
17
+ *
18
+ * AVOID:
19
+ * - Value imports from a po-core entry here. Native plugins may not import
20
+ * `po-core/web`, and web plugins may not import `po-core/native`.
21
+ */
22
+ /** The runtime that owns `from`, with both ids as its computer knows them; undefined when none does. */
23
+ function route(runtimes, input) {
24
+ return runtimes.flatMap((runtime) => {
25
+ try {
26
+ const from = runtime.localSessionId?.(input.from) ?? input.from;
27
+ const to = runtime.localSessionId?.(input.to) ?? input.to;
28
+ return from !== input.from || (runtime.qualifySessionId?.(input.from) ?? input.from) === input.from ? [{
29
+ runtime,
30
+ from,
31
+ to
32
+ }] : [];
33
+ } catch {
34
+ return [];
35
+ }
36
+ }).at(-1);
37
+ }
38
+ /** Steers `text` into session `to`. Resolves to the reason shown when it was refused, or undefined once delivered. */
39
+ async function deliverToSession(runtimes, input) {
40
+ const owner = route(runtimes, input);
41
+ if (!owner) return "Po is not connected. Your text is kept; try again.";
42
+ try {
43
+ await owner.runtime.invokeServerMethod({
44
+ mount: { scope: "host" },
45
+ service: "sessions",
46
+ method: "sendToSession",
47
+ input: {
48
+ from: owner.from,
49
+ to: owner.to,
50
+ text: input.text
51
+ }
52
+ });
53
+ return;
54
+ } catch (error) {
55
+ return error instanceof Error && error.message !== "" ? error.message : "The message was not delivered.";
56
+ }
57
+ }
58
+ //#endregion
59
+ //#region src/extensions/workspaces/sessions/(frontend)/_lib/sendToSessionRequest.native.ts
60
+ /**
61
+ * The phone's started runtimes, one per computer, for the send-to-session panel.
62
+ *
63
+ * DESIGN PATTERNS:
64
+ * - The native twin of sendToSessionRequest.ts: a native plugin may import
65
+ * po-core/native only. The phone has no menu-to-overlay handoff, so only the
66
+ * runtime list and the send live here.
67
+ */
68
+ const runtimes = defineHostStore([]);
69
+ function startSendToSessionRuntime(runtime) {
70
+ runtimes.update((current) => [...current, runtime]);
71
+ return () => runtimes.update((current) => current.filter((entry) => entry !== runtime));
72
+ }
73
+ /** Steers `text` into session `to`. Resolves to the reason shown when it was refused, or undefined once delivered. */
74
+ function sendToSession(input) {
75
+ return deliverToSession(runtimes.store.state, input);
76
+ }
77
+ //#endregion
78
+ //#region src/extensions/workspaces/sessions/(frontend)/fill/_components/SendToSessionPanel.native.tsx
79
+ /**
80
+ * The phone's "Send to session…" page of the composer's Insert sheet: pick a
81
+ * live session, then Send steers what the person typed into it.
82
+ *
83
+ * DESIGN PATTERNS:
84
+ * - The draft is taken only at Send, so opening and leaving the page never
85
+ * touches it. A refused send keeps the taken text for a retry and hands it
86
+ * back to the composer when the page goes away.
87
+ * - The sheet closes when the page appends to the draft; an empty append
88
+ * closes it and leaves the draft alone.
89
+ *
90
+ * AVOID:
91
+ * - Sending on a row tap. On a phone a mis-tap would send; Send is its own button.
92
+ */
93
+ const TONE = {
94
+ running: "green",
95
+ waiting: "magenta",
96
+ idle: "neutral"
97
+ };
98
+ /** The Insert sheet page: lists the computer's live sessions and steers the composer's text into one. */
99
+ function SendToSessionPanel({ sessionId, listSessions, takeComposerDraft, appendComposerDraft }) {
100
+ const t = useT();
101
+ const [sessions] = useState(() => listSessions?.() ?? []);
102
+ const [to, setTo] = useState();
103
+ const [busy, setBusy] = useState(false);
104
+ const [error, setError] = useState("");
105
+ const held = useRef({
106
+ inFlight: false,
107
+ live: true
108
+ });
109
+ const giveBack = useRef(appendComposerDraft);
110
+ useEffect(() => {
111
+ giveBack.current = appendComposerDraft;
112
+ }, [appendComposerDraft]);
113
+ useEffect(() => {
114
+ const state = held.current;
115
+ state.live = true;
116
+ return () => {
117
+ state.live = false;
118
+ if (state.text !== void 0 && !state.inFlight) giveBack.current(state.text);
119
+ };
120
+ }, []);
121
+ const send = async () => {
122
+ if (to === void 0 || sessionId === null) return;
123
+ const state = held.current;
124
+ const text = state.text ?? takeComposerDraft?.() ?? "";
125
+ if (text.trim() === "") {
126
+ setError(t("session.ui.writeSomethingToSend", "Write something to send."));
127
+ return;
128
+ }
129
+ state.text = text;
130
+ state.inFlight = true;
131
+ setBusy(true);
132
+ setError("");
133
+ const refusal = await sendToSession({
134
+ from: sessionId,
135
+ to,
136
+ text: text.trim()
137
+ });
138
+ state.inFlight = false;
139
+ if (refusal === void 0) state.text = void 0;
140
+ if (!state.live) {
141
+ if (state.text !== void 0) giveBack.current(state.text);
142
+ return;
143
+ }
144
+ if (refusal === void 0) {
145
+ giveBack.current("");
146
+ return;
147
+ }
148
+ setBusy(false);
149
+ setError(refusal);
150
+ };
151
+ return /* @__PURE__ */ jsx(SendToSessionView, {
152
+ sessions,
153
+ to,
154
+ busy,
155
+ error,
156
+ onPick: setTo,
157
+ onSend: () => void send()
158
+ });
159
+ }
160
+ function SendToSessionView({ sessions, to, busy, error, onPick, onSend }) {
161
+ const t = useT();
162
+ const [filter, setFilter] = useState("");
163
+ const shown = useMemo(() => {
164
+ const query = filter.trim().toLowerCase();
165
+ return query === "" ? sessions : sessions.filter((session) => `${session.name} ${session.detail}`.toLowerCase().includes(query));
166
+ }, [filter, sessions]);
167
+ const target = sessions.find((session) => session.id === to);
168
+ return /* @__PURE__ */ jsxs(Fragment, { children: [/* @__PURE__ */ jsxs(SheetBody, { children: [
169
+ /* @__PURE__ */ jsx(SheetDescription, { children: t("session.ui.sendDraftDescription", "Send what you typed to another session. It arrives there from you.") }),
170
+ error === "" ? null : /* @__PURE__ */ jsx(Text, {
171
+ accessibilityRole: "alert",
172
+ style: styles$1.alert,
173
+ children: error
174
+ }),
175
+ sessions.length === 0 ? /* @__PURE__ */ jsx(EmptyState, {
176
+ size: "compact",
177
+ icon: /* @__PURE__ */ jsx(MessageIcon, { size: 16 }),
178
+ title: t("session.ui.noOtherSessionRunning", "No other session is running"),
179
+ description: t("session.ui.openThenSend", "Open one, then send.")
180
+ }) : /* @__PURE__ */ jsxs(Fragment, { children: [/* @__PURE__ */ jsx(Input, {
181
+ accessibilityLabel: t("session.ui.filterSessions", "Filter sessions"),
182
+ placeholder: t("session.ui.filterSessions", "Filter sessions"),
183
+ value: filter,
184
+ onChangeText: setFilter
185
+ }), shown.length === 0 ? /* @__PURE__ */ jsx(EmptyState, {
186
+ size: "compact",
187
+ icon: /* @__PURE__ */ jsx(SearchIcon, { size: 16 }),
188
+ title: t("session.ui.noFilterMatches", "Nothing matches that filter"),
189
+ secondaryAction: {
190
+ label: t("session.ui.clearFilter", "Clear filter"),
191
+ onAction: () => setFilter("")
192
+ }
193
+ }) : /* @__PURE__ */ jsx(View, {
194
+ style: styles$1.rows,
195
+ children: shown.map((session, index) => /* @__PURE__ */ jsxs(View, { children: [index > 0 ? /* @__PURE__ */ jsx(View, { style: styles$1.separator }) : null, /* @__PURE__ */ jsx(ListRow, {
196
+ accessibilityLabel: `${session.name}, ${session.detail}`,
197
+ selected: session.id === to,
198
+ disabled: busy,
199
+ onPress: () => onPick(session.id),
200
+ disclosure: false,
201
+ style: styles$1.row,
202
+ leading: /* @__PURE__ */ jsx(Dot, {
203
+ tone: TONE[session.state],
204
+ size: "md"
205
+ }),
206
+ title: session.name,
207
+ description: /* @__PURE__ */ jsx(Text, {
208
+ numberOfLines: 1,
209
+ style: styles$1.detail,
210
+ children: session.detail
211
+ })
212
+ })] }, session.id))
213
+ })] })
214
+ ] }), /* @__PURE__ */ jsx(SheetFooter, { children: /* @__PURE__ */ jsx(Button, {
215
+ variant: "primary",
216
+ disabled: busy || target === void 0,
217
+ onPress: onSend,
218
+ children: busy ? t("session.ui.sending", "Sending…") : target === void 0 ? t("session.ui.pickSession", "Pick a session") : t("session.ui.sendToName", "Send to {name}", { name: target.name })
219
+ }) })] });
220
+ }
221
+ const styles$1 = StyleSheet.create((theme) => {
222
+ const small = {
223
+ fontFamily: fontOf(theme.fontFamily.sans),
224
+ fontSize: theme.fontSize.sm,
225
+ lineHeight: theme.lineHeight.sm
226
+ };
227
+ return {
228
+ rows: {
229
+ borderTopWidth: StyleSheet.hairlineWidth,
230
+ borderBottomWidth: StyleSheet.hairlineWidth,
231
+ borderColor: theme.colors["border-soft"],
232
+ uni__dependencies: [0]
233
+ },
234
+ row: {
235
+ paddingHorizontal: theme.spacing(1),
236
+ uni__dependencies: [0]
237
+ },
238
+ separator: {
239
+ height: StyleSheet.hairlineWidth,
240
+ backgroundColor: theme.colors["border-soft"],
241
+ uni__dependencies: [0]
242
+ },
243
+ detail: {
244
+ ...small,
245
+ color: theme.colors.dim,
246
+ uni__dependencies: [0]
247
+ },
248
+ alert: {
249
+ ...small,
250
+ color: theme.colors.red,
251
+ uni__dependencies: [0]
252
+ }
253
+ };
254
+ });
255
+ //#endregion
256
+ //#region src/extensions/workspaces/sessions/(frontend)/fill/SendToSession.composer-menu.native.tsx
257
+ /** The phone's Insert sheet draws `data` as the row and `component` as the page it opens. */
258
+ var SendToSession_composer_menu_native_default = defineFill({
259
+ data: {
260
+ title: "Send to session…",
261
+ hint: "Steer another session with what you typed",
262
+ translateCopy: (t) => ({
263
+ title: t("session.insert.title", "Send to session…"),
264
+ hint: t("session.insert.hint", "Steer another session with what you typed")
265
+ })
266
+ },
267
+ component: SendToSessionPanel
268
+ });
269
+ //#endregion
270
+ //#region src/extensions/workspaces/sessions/(frontend)/lifecycle/start.native.ts
271
+ var start_native_default = defineWebLifecycle(startSendToSessionRuntime);
272
+ //#endregion
273
+ //#region src/extensions/workspaces/sessions/(frontend)/tool/_lib/networkActivity.ts
274
+ const ACTIVITY_CHARS = 72;
275
+ function asString(value) {
276
+ return typeof value === "string" ? value : "";
277
+ }
278
+ function clip(text) {
279
+ const flat = text.replace(/\s+/g, " ").trim();
280
+ return flat.length > ACTIVITY_CHARS ? `${flat.slice(0, 71)}…` : flat;
281
+ }
282
+ /** Who a message is for, or what it answers. */
283
+ function networkSummary(toolName, args) {
284
+ const verb = toolName.split(".").at(-1) ?? toolName;
285
+ return toolName === "network.reply" ? "reply" : `${verb} ${asString(args.to)}`.trim();
286
+ }
287
+ /** One line per outgoing session message: who it went to and what it said. */
288
+ function networkActivity({ toolName, args, isError }) {
289
+ const text = clip(asString(args.text));
290
+ if (isError || !text) return [];
291
+ if (toolName === "network.reply") return [`Replied "${text}"`];
292
+ return [`→ ${asString(args.to) || "session"}${toolName === "network.ask" ? " asks" : ""} "${text}"`];
293
+ }
294
+ //#endregion
295
+ //#region src/extensions/workspaces/sessions/(frontend)/tool/_components/NetworkToolMessage.native.tsx
296
+ /** A network.send, network.ask or network.reply recorded inside an exec. Collapsed to its summary; the body is the result text. */
297
+ function NetworkToolMessage({ args, result, output, running, isError, toolName }) {
298
+ const t = useT();
299
+ const lines = resultTextLines(result, output);
300
+ return /* @__PURE__ */ jsx(MessageItem, {
301
+ tone: toolTone({
302
+ running,
303
+ isError
304
+ }),
305
+ expandable: lines.length > 0,
306
+ children: ({ expanded }) => /* @__PURE__ */ jsxs(Fragment, { children: [/* @__PURE__ */ jsx(MessageItemHeader, {
307
+ title: "network",
308
+ children: /* @__PURE__ */ jsx(View, {
309
+ testID: "tool-call-network",
310
+ style: styles.summary,
311
+ children: /* @__PURE__ */ jsx(Text, {
312
+ numberOfLines: 1,
313
+ style: styles.primary,
314
+ children: networkSummary(toolName, args)
315
+ })
316
+ })
317
+ }), expanded ? /* @__PURE__ */ jsxs(MessageItemBody, {
318
+ testID: "tool-result-network",
319
+ style: styles.body,
320
+ children: [running ? /* @__PURE__ */ jsx(MessageItemStatus, {
321
+ tone: "running",
322
+ children: t("session.ui.working", "working")
323
+ }) : null, lines.map((line, index) => /* @__PURE__ */ jsx(Text, {
324
+ selectable: true,
325
+ style: isError ? styles.error : styles.dim,
326
+ children: line
327
+ }, `${String(index)}-${line}`))]
328
+ }) : null] })
329
+ });
330
+ }
331
+ const styles = StyleSheet.create((theme) => ({
332
+ summary: {
333
+ flex: 1,
334
+ flexDirection: "row",
335
+ alignItems: "center",
336
+ minWidth: 0
337
+ },
338
+ primary: {
339
+ flexShrink: 1,
340
+ minWidth: 0,
341
+ color: theme.colors.text,
342
+ fontFamily: fontOf(theme.fontFamily.sans),
343
+ fontSize: theme.fontSize.base,
344
+ uni__dependencies: [0]
345
+ },
346
+ body: {
347
+ gap: theme.spacing(1),
348
+ uni__dependencies: [0]
349
+ },
350
+ dim: {
351
+ color: theme.colors.dim,
352
+ fontFamily: fontOf(theme.fontFamily.sans),
353
+ fontSize: theme.fontSize.base,
354
+ uni__dependencies: [0]
355
+ },
356
+ error: {
357
+ color: theme.colors.red,
358
+ fontFamily: fontOf(theme.fontFamily.sans),
359
+ fontSize: theme.fontSize.base,
360
+ uni__dependencies: [0]
361
+ }
362
+ }));
363
+ //#endregion
364
+ //#region src/extensions/workspaces/sessions/(frontend)/tool/network.native.tsx
365
+ /** The network namespace's recorded calls. Named by hand: the dotted tool names are not a filename. */
366
+ var network_native_default = defineToolRenderer({
367
+ tools: [
368
+ "network.send",
369
+ "network.ask",
370
+ "network.reply"
371
+ ],
372
+ message: NetworkToolMessage,
373
+ activity: networkActivity
374
+ });
375
+ //#endregion
376
+ //#region generated/native.ts
377
+ const via = (identity, value) => {
378
+ if (value === void 0) return void 0;
379
+ const declaration = value;
380
+ return {
381
+ ...identity,
382
+ ...declaration,
383
+ ...declaration.relations === void 0 ? {} : { relations: declaration.relations.map((relation) => ({
384
+ evidence: "declared",
385
+ ...relation
386
+ })) }
387
+ };
388
+ };
389
+ const nativePlugin = defineNativePlugin({
390
+ id: "sessions",
391
+ packageName: "@agimon-ai/po-session",
392
+ session: {
393
+ get fills() {
394
+ return [via({
395
+ slot: "composer-menu",
396
+ id: "send-to-session"
397
+ }, SendToSession_composer_menu_native_default)];
398
+ },
399
+ get start() {
400
+ return start_native_default;
401
+ },
402
+ get toolRenderers() {
403
+ return [via({ tools: ["network"] }, network_native_default)];
404
+ }
405
+ }
406
+ });
407
+ //#endregion
408
+ export { nativePlugin };
409
+
410
+ //# sourceMappingURL=native.mjs.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"native.mjs","names":["useT","WebPluginSessionOption","WebPluginSlotProps","Button","Dot","EmptyState","fontOf","Input","ListRow","MessageIcon","SearchIcon","SheetBody","SheetDescription","SheetFooter","useEffect","useMemo","useRef","useState","StyleSheet","sendToSession","TONE","running","waiting","idle","const","SendToSessionPanel","sessionId","listSessions","takeComposerDraft","appendComposerDraft","t","sessions","to","setTo","busy","setBusy","error","setError","held","text","inFlight","live","giveBack","current","state","undefined","send","Promise","trim","refusal","from","SendToSessionViewProps","onPick","id","onSend","SendToSessionView","filter","setFilter","shown","query","toLowerCase","session","name","detail","includes","target","find","styles","alert","length","label","onAction","rows","map","index","separator","row","create","theme","small","fontFamily","sans","fontSize","sm","lineHeight","borderTopWidth","hairlineWidth","borderBottomWidth","borderColor","colors","uni__dependencies","paddingHorizontal","spacing","height","backgroundColor","color","dim","red","styles","useT","ToolMessageRenderProps","fontOf","MessageItem","MessageItemBody","MessageItemHeader","MessageItemStatus","resultTextLines","toolTone","PoNativeTheme","StyleSheet","networkSummary","NetworkToolMessage","args","result","output","running","isError","toolName","t","lines","length","expanded","styles","summary","primary","body","map","line","index","String","error","dim","create","theme","flex","flexDirection","alignItems","minWidth","flexShrink","color","colors","text","fontFamily","sans","fontSize","base","uni__dependencies","gap","spacing","red","fillSendToSession","lifecycleStart","toolNetwork"],"sources":["../../src/extensions/workspaces/sessions/(frontend)/_lib/sendToSessionDelivery.ts","../../src/extensions/workspaces/sessions/(frontend)/_lib/sendToSessionRequest.native.ts","../../src/extensions/workspaces/sessions/(frontend)/fill/_components/SendToSessionPanel.native.tsx","../../src/extensions/workspaces/sessions/(frontend)/fill/SendToSession.composer-menu.native.tsx","../../src/extensions/workspaces/sessions/(frontend)/lifecycle/start.native.ts","../../src/extensions/workspaces/sessions/(frontend)/tool/_lib/networkActivity.ts","../../src/extensions/workspaces/sessions/(frontend)/tool/_components/NetworkToolMessage.native.tsx","../../src/extensions/workspaces/sessions/(frontend)/tool/network.native.tsx","../../generated/native.ts"],"sourcesContent":["import type { WebPluginRuntime } from '@agimon-ai/po-core/web';\n\n/**\n * Delivers one send through the started runtime that owns the sending session.\n *\n * DESIGN PATTERNS:\n * - Host-neutral and stateless: the web and native request files each keep\n * their own runtime list (from their own po-core entry) and pass it in.\n * The phone starts one runtime per computer; a send goes through the one\n * that owns the sending session, with that computer's local ids.\n *\n * AVOID:\n * - Value imports from a po-core entry here. Native plugins may not import\n * `po-core/web`, and web plugins may not import `po-core/native`.\n */\n\n/** The runtime that owns `from`, with both ids as its computer knows them; undefined when none does. */\nfunction route(runtimes: readonly WebPluginRuntime[], input: { from: string; to: string }) {\n const owners = runtimes.flatMap((runtime) => {\n try {\n const from = runtime.localSessionId?.(input.from) ?? input.from;\n const to = runtime.localSessionId?.(input.to) ?? input.to;\n // An unqualified id belongs to the computer that would leave it unqualified (the local hub).\n const owns = from !== input.from || (runtime.qualifySessionId?.(input.from) ?? input.from) === input.from;\n return owns ? [{ runtime, from, to }] : [];\n } catch {\n // localSessionId refuses an id of another computer: this runtime does not own the send.\n return [];\n }\n });\n return owners.at(-1);\n}\n\n/** Steers `text` into session `to`. Resolves to the reason shown when it was refused, or undefined once delivered. */\nexport async function deliverToSession(\n runtimes: readonly WebPluginRuntime[],\n input: { from: string; to: string; text: string },\n): Promise<string | undefined> {\n const owner = route(runtimes, input);\n if (!owner) return 'Po is not connected. Your text is kept; try again.';\n try {\n await owner.runtime.invokeServerMethod({\n mount: { scope: 'host' },\n service: 'sessions',\n method: 'sendToSession',\n input: { from: owner.from, to: owner.to, text: input.text },\n });\n return undefined;\n } catch (error) {\n return error instanceof Error && error.message !== '' ? error.message : 'The message was not delivered.';\n }\n}\n","import { defineHostStore, type WebPluginRuntime } from '@agimon-ai/po-core/native';\n\nimport { deliverToSession } from './sendToSessionDelivery';\n\n/**\n * The phone's started runtimes, one per computer, for the send-to-session panel.\n *\n * DESIGN PATTERNS:\n * - The native twin of sendToSessionRequest.ts: a native plugin may import\n * po-core/native only. The phone has no menu-to-overlay handoff, so only the\n * runtime list and the send live here.\n */\n\nconst runtimes = defineHostStore<readonly WebPluginRuntime[]>([]);\n\nexport function startSendToSessionRuntime(runtime: WebPluginRuntime): () => void {\n runtimes.update((current) => [...current, runtime]);\n return () => runtimes.update((current) => current.filter((entry) => entry !== runtime));\n}\n\n/** Steers `text` into session `to`. Resolves to the reason shown when it was refused, or undefined once delivered. */\nexport function sendToSession(input: { from: string; to: string; text: string }): Promise<string | undefined> {\n return deliverToSession(runtimes.store.state, input);\n}\n","import { useT } from '@agimon-ai/po-core/native';\nimport type { WebPluginSessionOption, WebPluginSlotProps } from '@agimon-ai/po-core/native';\nimport {\n Button,\n Dot,\n EmptyState,\n fontOf,\n Input,\n ListRow,\n MessageIcon,\n SearchIcon,\n SheetBody,\n SheetDescription,\n SheetFooter,\n} from '@agimon-ai/po-native-components';\nimport { useEffect, useMemo, useRef, useState } from 'react';\nimport { Text, View } from 'react-native';\nimport { StyleSheet } from 'react-native-unistyles';\n\nimport { sendToSession } from '../../_lib/sendToSessionRequest.native';\n\n/**\n * The phone's \"Send to session…\" page of the composer's Insert sheet: pick a\n * live session, then Send steers what the person typed into it.\n *\n * DESIGN PATTERNS:\n * - The draft is taken only at Send, so opening and leaving the page never\n * touches it. A refused send keeps the taken text for a retry and hands it\n * back to the composer when the page goes away.\n * - The sheet closes when the page appends to the draft; an empty append\n * closes it and leaves the draft alone.\n *\n * AVOID:\n * - Sending on a row tap. On a phone a mis-tap would send; Send is its own button.\n */\n\nconst TONE = { running: 'green', waiting: 'magenta', idle: 'neutral' } as const;\n\n/** The Insert sheet page: lists the computer's live sessions and steers the composer's text into one. */\nexport function SendToSessionPanel({\n sessionId,\n listSessions,\n takeComposerDraft,\n appendComposerDraft,\n}: WebPluginSlotProps) {\n const t = useT();\n const [sessions] = useState(() => listSessions?.() ?? []);\n const [to, setTo] = useState<string>();\n const [busy, setBusy] = useState(false);\n const [error, setError] = useState('');\n // Text taken from the composer and not yet delivered; `live` is false once the page is gone.\n const held = useRef<{ text?: string; inFlight: boolean; live: boolean }>({ inFlight: false, live: true });\n const giveBack = useRef(appendComposerDraft);\n useEffect(() => {\n giveBack.current = appendComposerDraft;\n }, [appendComposerDraft]);\n useEffect(() => {\n const state = held.current;\n state.live = true;\n return () => {\n state.live = false;\n if (state.text !== undefined && !state.inFlight) giveBack.current(state.text);\n };\n }, []);\n\n const send = async (): Promise<void> => {\n if (to === undefined || sessionId === null) return;\n const state = held.current;\n const text = state.text ?? takeComposerDraft?.() ?? '';\n if (text.trim() === '') {\n setError(t('session.ui.writeSomethingToSend', 'Write something to send.'));\n return;\n }\n state.text = text;\n state.inFlight = true;\n setBusy(true);\n setError('');\n const refusal = await sendToSession({ from: sessionId, to, text: text.trim() });\n state.inFlight = false;\n if (refusal === undefined) state.text = undefined;\n if (!state.live) {\n if (state.text !== undefined) giveBack.current(state.text);\n return;\n }\n if (refusal === undefined) {\n giveBack.current('');\n return;\n }\n setBusy(false);\n setError(refusal);\n };\n\n return (\n <SendToSessionView\n sessions={sessions}\n to={to}\n busy={busy}\n error={error}\n onPick={setTo}\n onSend={() => void send()}\n />\n );\n}\n\nexport interface SendToSessionViewProps {\n sessions: readonly WebPluginSessionOption[];\n to: string | undefined;\n busy: boolean;\n /** The server's refusal, shown above the list; empty when there is none. */\n error: string;\n onPick: (id: string) => void;\n onSend: () => void;\n}\n\nexport function SendToSessionView({ sessions, to, busy, error, onPick, onSend }: SendToSessionViewProps) {\n const t = useT();\n const [filter, setFilter] = useState('');\n const shown = useMemo(() => {\n const query = filter.trim().toLowerCase();\n return query === ''\n ? sessions\n : sessions.filter((session) => `${session.name} ${session.detail}`.toLowerCase().includes(query));\n }, [filter, sessions]);\n const target = sessions.find((session) => session.id === to);\n\n return (\n <>\n <SheetBody>\n <SheetDescription>\n {t('session.ui.sendDraftDescription', 'Send what you typed to another session. It arrives there from you.')}\n </SheetDescription>\n {error === '' ? null : (\n <Text accessibilityRole=\"alert\" style={styles.alert}>\n {error}\n </Text>\n )}\n {sessions.length === 0 ? (\n <EmptyState\n size=\"compact\"\n icon={<MessageIcon size={16} />}\n title={t('session.ui.noOtherSessionRunning', 'No other session is running')}\n description={t('session.ui.openThenSend', 'Open one, then send.')}\n />\n ) : (\n <>\n <Input\n accessibilityLabel={t('session.ui.filterSessions', 'Filter sessions')}\n placeholder={t('session.ui.filterSessions', 'Filter sessions')}\n value={filter}\n onChangeText={setFilter}\n />\n {shown.length === 0 ? (\n <EmptyState\n size=\"compact\"\n icon={<SearchIcon size={16} />}\n title={t('session.ui.noFilterMatches', 'Nothing matches that filter')}\n secondaryAction={{ label: t('session.ui.clearFilter', 'Clear filter'), onAction: () => setFilter('') }}\n />\n ) : (\n <View style={styles.rows}>\n {shown.map((session, index) => (\n <View key={session.id}>\n {index > 0 ? <View style={styles.separator} /> : null}\n <ListRow\n accessibilityLabel={`${session.name}, ${session.detail}`}\n selected={session.id === to}\n disabled={busy}\n onPress={() => onPick(session.id)}\n disclosure={false}\n style={styles.row}\n leading={<Dot tone={TONE[session.state]} size=\"md\" />}\n title={session.name}\n description={\n <Text numberOfLines={1} style={styles.detail}>\n {session.detail}\n </Text>\n }\n />\n </View>\n ))}\n </View>\n )}\n </>\n )}\n </SheetBody>\n <SheetFooter>\n <Button variant=\"primary\" disabled={busy || target === undefined} onPress={onSend}>\n {busy\n ? t('session.ui.sending', 'Sending…')\n : target === undefined\n ? t('session.ui.pickSession', 'Pick a session')\n : t('session.ui.sendToName', 'Send to {name}', { name: target.name })}\n </Button>\n </SheetFooter>\n </>\n );\n}\n\nconst styles = StyleSheet.create((theme) => {\n const small = {\n fontFamily: fontOf(theme.fontFamily.sans),\n fontSize: theme.fontSize.sm,\n lineHeight: theme.lineHeight.sm,\n };\n return {\n rows: {\n borderTopWidth: StyleSheet.hairlineWidth,\n borderBottomWidth: StyleSheet.hairlineWidth,\n borderColor: theme.colors['border-soft'],\n },\n row: { paddingHorizontal: theme.spacing(1) },\n separator: { height: StyleSheet.hairlineWidth, backgroundColor: theme.colors['border-soft'] },\n detail: { ...small, color: theme.colors.dim },\n alert: { ...small, color: theme.colors.red },\n };\n});\n","import { defineFill } from '@agimon-ai/po-core/native';\n\nimport { SendToSessionPanel } from './_components/SendToSessionPanel.native';\n\n/** The phone's Insert sheet draws `data` as the row and `component` as the page it opens. */\nexport default defineFill({\n data: {\n title: 'Send to session…',\n hint: 'Steer another session with what you typed',\n translateCopy: (t: (key: string, fallback: string) => string) => ({\n title: t('session.insert.title', 'Send to session…'),\n hint: t('session.insert.hint', 'Steer another session with what you typed'),\n }),\n },\n component: SendToSessionPanel,\n});\n","import { defineWebLifecycle } from '@agimon-ai/po-core/native';\n\nimport { startSendToSessionRuntime } from '../_lib/sendToSessionRequest.native';\n\nexport default defineWebLifecycle(startSendToSessionRuntime);\n","import type { ToolMessageRenderProps } from '@agimon-ai/po-core/web';\n\nconst ACTIVITY_CHARS = 72;\n\nfunction asString(value: unknown): string {\n return typeof value === 'string' ? value : '';\n}\n\nfunction clip(text: string): string {\n const flat = text.replace(/\\s+/g, ' ').trim();\n return flat.length > ACTIVITY_CHARS ? `${flat.slice(0, ACTIVITY_CHARS - 1)}…` : flat;\n}\n\n/** Who a message is for, or what it answers. */\nexport function networkSummary(toolName: string, args: Record<string, unknown>): string {\n const verb = toolName.split('.').at(-1) ?? toolName;\n return toolName === 'network.reply' ? 'reply' : `${verb} ${asString(args.to)}`.trim();\n}\n\n/** One line per outgoing session message: who it went to and what it said. */\nexport function networkActivity({\n toolName,\n args,\n isError,\n}: Pick<ToolMessageRenderProps, 'toolName' | 'args' | 'isError'>): string[] {\n const text = clip(asString(args.text));\n if (isError || !text) return [];\n if (toolName === 'network.reply') return [`Replied \"${text}\"`];\n const to = asString(args.to) || 'session';\n return [`→ ${to}${toolName === 'network.ask' ? ' asks' : ''} \"${text}\"`];\n}\n","import { useT } from '@agimon-ai/po-core/native';\nimport type { ToolMessageRenderProps } from '@agimon-ai/po-core/native';\nimport {\n fontOf,\n MessageItem,\n MessageItemBody,\n MessageItemHeader,\n MessageItemStatus,\n resultTextLines,\n toolTone,\n} from '@agimon-ai/po-native-components';\nimport type { PoNativeTheme } from '@agimon-ai/po-web-components/nativeTheme';\nimport { Text, View } from 'react-native';\nimport { StyleSheet } from 'react-native-unistyles';\n\nimport { networkSummary } from '../_lib/networkActivity';\n\n/** A network.send, network.ask or network.reply recorded inside an exec. Collapsed to its summary; the body is the result text. */\nexport function NetworkToolMessage({ args, result, output, running, isError, toolName }: ToolMessageRenderProps) {\n const t = useT();\n const lines = resultTextLines(result, output);\n return (\n <MessageItem tone={toolTone({ running, isError })} expandable={lines.length > 0}>\n {({ expanded }) => (\n <>\n {/* no-untranslated-jsx: ignore - Preserve the technical tool identifier. */}\n <MessageItemHeader title=\"network\">\n <View testID=\"tool-call-network\" style={styles.summary}>\n <Text numberOfLines={1} style={styles.primary}>\n {networkSummary(toolName, args)}\n </Text>\n </View>\n </MessageItemHeader>\n {expanded ? (\n <MessageItemBody testID=\"tool-result-network\" style={styles.body}>\n {running ? (\n <MessageItemStatus tone=\"running\">{t('session.ui.working', 'working')}</MessageItemStatus>\n ) : null}\n {lines.map((line, index) => (\n <Text key={`${String(index)}-${line}`} selectable style={isError ? styles.error : styles.dim}>\n {line}\n </Text>\n ))}\n </MessageItemBody>\n ) : null}\n </>\n )}\n </MessageItem>\n );\n}\n\nconst styles = StyleSheet.create((theme: PoNativeTheme) => ({\n summary: { flex: 1, flexDirection: 'row', alignItems: 'center', minWidth: 0 },\n primary: {\n flexShrink: 1,\n minWidth: 0,\n color: theme.colors.text,\n fontFamily: fontOf(theme.fontFamily.sans),\n fontSize: theme.fontSize.base,\n },\n body: { gap: theme.spacing(1) },\n dim: { color: theme.colors.dim, fontFamily: fontOf(theme.fontFamily.sans), fontSize: theme.fontSize.base },\n error: { color: theme.colors.red, fontFamily: fontOf(theme.fontFamily.sans), fontSize: theme.fontSize.base },\n}));\n","import { defineToolRenderer } from '@agimon-ai/po-core/native';\n\nimport { NetworkToolMessage } from './_components/NetworkToolMessage.native';\nimport { networkActivity } from './_lib/networkActivity';\n\n/** The network namespace's recorded calls. Named by hand: the dotted tool names are not a filename. */\nexport default defineToolRenderer({\n tools: ['network.send', 'network.ask', 'network.reply'],\n message: NetworkToolMessage,\n activity: networkActivity,\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 fillSendToSession from '../src/extensions/workspaces/sessions/(frontend)/fill/SendToSession.composer-menu.native';\nimport lifecycleStart from '../src/extensions/workspaces/sessions/(frontend)/lifecycle/start.native';\nimport toolNetwork from '../src/extensions/workspaces/sessions/(frontend)/tool/network.native';\n\nconst via = <T>(identity: Record<string, unknown>, value: unknown): T => {\n if (value === undefined) return undefined as T;\n const declaration = value as { relations?: readonly Record<string, unknown>[] };\n return { ...identity, ...declaration, ...(declaration.relations === undefined ? {} : {\n relations: declaration.relations.map((relation) => ({ evidence: 'declared', ...relation })),\n }) } as T;\n};\n\nexport const nativePlugin = defineNativePlugin({\n id: 'sessions',\n packageName: '@agimon-ai/po-session',\n session: {\n get fills(): WebPluginContributions['fills'] { return [via({ slot: 'composer-menu', id: 'send-to-session' }, fillSendToSession)]; },\n get start(): WebPluginContributions['start'] { return lifecycleStart; },\n get toolRenderers(): WebPluginContributions['toolRenderers'] { return [via({ tools: ['network'] }, toolNetwork)]; },\n },\n});\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;AAiBA,SAAS,MAAM,UAAuC,OAAqC;CAazF,OAZe,SAAS,SAAS,YAAY;EAC3C,IAAI;GACF,MAAM,OAAO,QAAQ,iBAAiB,MAAM,IAAI,KAAK,MAAM;GAC3D,MAAM,KAAK,QAAQ,iBAAiB,MAAM,EAAE,KAAK,MAAM;GAGvD,OADa,SAAS,MAAM,SAAS,QAAQ,mBAAmB,MAAM,IAAI,KAAK,MAAM,UAAU,MAAM,OACvF,CAAC;IAAE;IAAS;IAAM;GAAG,CAAC,IAAI,CAAC;EAC3C,QAAQ;GAEN,OAAO,CAAC;EACV;CACF,CACY,CAAC,CAAC,GAAG,EAAE;AACrB;;AAGA,eAAsB,iBACpB,UACA,OAC6B;CAC7B,MAAM,QAAQ,MAAM,UAAU,KAAK;CACnC,IAAI,CAAC,OAAO,OAAO;CACnB,IAAI;EACF,MAAM,MAAM,QAAQ,mBAAmB;GACrC,OAAO,EAAE,OAAO,OAAO;GACvB,SAAS;GACT,QAAQ;GACR,OAAO;IAAE,MAAM,MAAM;IAAM,IAAI,MAAM;IAAI,MAAM,MAAM;GAAK;EAC5D,CAAC;EACD;CACF,SAAS,OAAO;EACd,OAAO,iBAAiB,SAAS,MAAM,YAAY,KAAK,MAAM,UAAU;CAC1E;AACF;;;;;;;;;;;ACtCA,MAAM,WAAW,gBAA6C,CAAC,CAAC;AAEhE,SAAgB,0BAA0B,SAAuC;CAC/E,SAAS,QAAQ,YAAY,CAAC,GAAG,SAAS,OAAO,CAAC;CAClD,aAAa,SAAS,QAAQ,YAAY,QAAQ,QAAQ,UAAU,UAAU,OAAO,CAAC;AACxF;;AAGA,SAAgB,cAAc,OAAgF;CAC5G,OAAO,iBAAiB,SAAS,MAAM,OAAO,KAAK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