@agimon-ai/po-approval 0.0.0-alpha.73 → 0.0.0-alpha.75
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.
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { defineActivityGroup, defineChannelFile, defineFill, defineGlobalStore, defineNativePlugin, defineSessionStore, defineWebLifecycle, parsePoApprovalPrompt } from "@agimon-ai/po-core/native";
|
|
2
|
-
import { Button, ShieldIcon, fontOf } from "@agimon-ai/po-native-components";
|
|
1
|
+
import { defineActivityGroup, defineChannelFile, defineFill, defineGlobalStore, defineNativePlugin, defineSessionStore, defineToolRenderer, defineWebLifecycle, parsePoApprovalPrompt } from "@agimon-ai/po-core/native";
|
|
2
|
+
import { Button, MessageItem, MessageItemBody, MessageItemHeader, MessageItemStatus, ShieldIcon, fontOf, toolTone } from "@agimon-ai/po-native-components";
|
|
3
3
|
import { createElement, useSyncExternalStore } from "react";
|
|
4
4
|
import { View } from "react-native-unistyles/components/native/View";
|
|
5
5
|
import { Text } from "react-native-unistyles/components/native/Text";
|
|
@@ -251,20 +251,20 @@ const approvalVoiceHintSlot = {
|
|
|
251
251
|
*/
|
|
252
252
|
function ApprovalActivitySection({ approvals, busy = [], error, voiceHint, onDecide, onDismiss }) {
|
|
253
253
|
if (approvals.length === 0) return /* @__PURE__ */ jsx(Text, {
|
|
254
|
-
style: styles.meta,
|
|
254
|
+
style: styles$1.meta,
|
|
255
255
|
children: "Nothing is waiting for your approval."
|
|
256
256
|
});
|
|
257
257
|
const first = approvals.find((card) => card.state === "pending" && card.sessionGone !== true)?.id;
|
|
258
258
|
return /* @__PURE__ */ jsxs(View, {
|
|
259
|
-
style: styles.section,
|
|
259
|
+
style: styles$1.section,
|
|
260
260
|
children: [
|
|
261
261
|
/* @__PURE__ */ jsx(Text, {
|
|
262
|
-
style: styles.meta,
|
|
262
|
+
style: styles$1.meta,
|
|
263
263
|
children: approvalSummary(approvals)
|
|
264
264
|
}),
|
|
265
265
|
error ? /* @__PURE__ */ jsx(Text, {
|
|
266
266
|
accessibilityRole: "alert",
|
|
267
|
-
style: styles.error,
|
|
267
|
+
style: styles$1.error,
|
|
268
268
|
children: error
|
|
269
269
|
}) : null,
|
|
270
270
|
approvals.map((card) => /* @__PURE__ */ jsx(ApprovalCard, {
|
|
@@ -283,59 +283,59 @@ function ApprovalCard({ card, primary, busy, voiceHint, onDecide, onDismiss }) {
|
|
|
283
283
|
const pending = card.state === "pending" && !gone;
|
|
284
284
|
const note = gone ? "Nothing will run. Dismiss this request to clear it." : pending ? card.requirement === "human" ? "Only you can approve this in the app." : voiceHint ?? "Po keeps working while it waits." : card.reason ?? (card.state === "running" ? "Po is running this approved call." : card.state === "interrupted" ? "Check what happened before retrying. This will not run again automatically." : "It runs when the session can.");
|
|
285
285
|
return /* @__PURE__ */ jsxs(View, {
|
|
286
|
-
style:
|
|
286
|
+
style: styles$1.card,
|
|
287
287
|
accessibilityLabel: card.title,
|
|
288
288
|
accessibilityState: { busy: busy || card.state === "running" },
|
|
289
289
|
children: [
|
|
290
290
|
/* @__PURE__ */ jsx(Text, {
|
|
291
291
|
style: [
|
|
292
|
-
styles.label,
|
|
293
|
-
!pending && styles.decidedLabel,
|
|
294
|
-
(gone || card.state === "interrupted") && styles.uncertainLabel
|
|
292
|
+
styles$1.label,
|
|
293
|
+
!pending && styles$1.decidedLabel,
|
|
294
|
+
(gone || card.state === "interrupted") && styles$1.uncertainLabel
|
|
295
295
|
],
|
|
296
296
|
children: gone ? "This session is gone" : approvalStateLabel(card.state)
|
|
297
297
|
}),
|
|
298
298
|
/* @__PURE__ */ jsx(Text, {
|
|
299
299
|
accessibilityRole: "header",
|
|
300
|
-
style: styles.title,
|
|
300
|
+
style: styles$1.title,
|
|
301
301
|
children: card.title
|
|
302
302
|
}),
|
|
303
303
|
card.summary ? /* @__PURE__ */ jsx(Text, {
|
|
304
|
-
style: styles.summary,
|
|
304
|
+
style: styles$1.summary,
|
|
305
305
|
children: card.summary
|
|
306
306
|
}) : null,
|
|
307
307
|
card.details && card.details.length > 0 ? /* @__PURE__ */ jsx(View, {
|
|
308
|
-
style: styles.details,
|
|
308
|
+
style: styles$1.details,
|
|
309
309
|
children: card.details.map(({ label, value }) => /* @__PURE__ */ jsxs(View, { children: [/* @__PURE__ */ jsx(Text, {
|
|
310
|
-
style: styles.meta,
|
|
310
|
+
style: styles$1.meta,
|
|
311
311
|
children: label
|
|
312
312
|
}), /* @__PURE__ */ jsx(Text, {
|
|
313
313
|
selectable: true,
|
|
314
|
-
style: styles.value,
|
|
314
|
+
style: styles$1.value,
|
|
315
315
|
children: value
|
|
316
316
|
})] }, label))
|
|
317
317
|
}) : null,
|
|
318
318
|
/* @__PURE__ */ jsx(Text, {
|
|
319
|
-
style: styles.meta,
|
|
319
|
+
style: styles$1.meta,
|
|
320
320
|
children: note
|
|
321
321
|
}),
|
|
322
322
|
/* @__PURE__ */ jsx(View, {
|
|
323
|
-
style: styles.actions,
|
|
323
|
+
style: styles$1.actions,
|
|
324
324
|
children: pending ? /* @__PURE__ */ jsxs(Fragment, { children: [/* @__PURE__ */ jsx(Button, {
|
|
325
325
|
variant: primary ? "primary" : "outline",
|
|
326
|
-
style: styles.action,
|
|
326
|
+
style: styles$1.action,
|
|
327
327
|
disabled: busy,
|
|
328
328
|
onPress: () => onDecide(card, "approve"),
|
|
329
329
|
children: "Approve"
|
|
330
330
|
}), /* @__PURE__ */ jsx(Button, {
|
|
331
331
|
variant: "ghost",
|
|
332
|
-
style: styles.action,
|
|
332
|
+
style: styles$1.action,
|
|
333
333
|
disabled: busy,
|
|
334
334
|
onPress: () => onDecide(card, "deny"),
|
|
335
335
|
children: "Deny"
|
|
336
336
|
})] }) : gone ? /* @__PURE__ */ jsx(Button, {
|
|
337
337
|
variant: "ghost",
|
|
338
|
-
style: styles.action,
|
|
338
|
+
style: styles$1.action,
|
|
339
339
|
disabled: busy,
|
|
340
340
|
onPress: () => onDismiss(card),
|
|
341
341
|
children: "Dismiss"
|
|
@@ -344,7 +344,7 @@ function ApprovalCard({ card, primary, busy, voiceHint, onDecide, onDismiss }) {
|
|
|
344
344
|
]
|
|
345
345
|
});
|
|
346
346
|
}
|
|
347
|
-
const styles = StyleSheet.create((theme) => ({
|
|
347
|
+
const styles$1 = StyleSheet.create((theme) => ({
|
|
348
348
|
section: {
|
|
349
349
|
gap: theme.spacing(2),
|
|
350
350
|
uni__dependencies: [0]
|
|
@@ -353,15 +353,11 @@ const styles = StyleSheet.create((theme) => ({
|
|
|
353
353
|
gap: theme.spacing(2),
|
|
354
354
|
padding: theme.spacing(3),
|
|
355
355
|
borderWidth: 1,
|
|
356
|
-
borderColor: theme.colors
|
|
356
|
+
borderColor: theme.colors.border,
|
|
357
357
|
borderRadius: theme.borderRadius.md,
|
|
358
358
|
backgroundColor: theme.colors.panel,
|
|
359
359
|
uni__dependencies: [0]
|
|
360
360
|
},
|
|
361
|
-
decidedCard: {
|
|
362
|
-
borderColor: theme.colors.border,
|
|
363
|
-
uni__dependencies: [0]
|
|
364
|
-
},
|
|
365
361
|
decidedLabel: {
|
|
366
362
|
color: theme.colors.green,
|
|
367
363
|
uni__dependencies: [0]
|
|
@@ -473,6 +469,112 @@ var start_native_default = defineWebLifecycle(startApprovalRuntime);
|
|
|
473
469
|
//#region src/extensions/workspaces/sessions/(frontend)/channel/approval-activity.native.ts
|
|
474
470
|
var approval_activity_native_default = defineChannelFile(approvalActivityChannel);
|
|
475
471
|
//#endregion
|
|
472
|
+
//#region src/extensions/workspaces/sessions/(frontend)/tool/_lib/approvalWithdrawView.ts
|
|
473
|
+
/** What the approval_withdraw card shows, read from its arguments and result details. */
|
|
474
|
+
function approvalWithdrawView(args, result, output) {
|
|
475
|
+
const approvalId = typeof args.id === "string" ? args.id : "";
|
|
476
|
+
const details = typeof result?.details === "object" && result.details !== null ? result.details : {};
|
|
477
|
+
return {
|
|
478
|
+
approvalId,
|
|
479
|
+
outcome: typeof details.withdrawn === "boolean" ? details.withdrawn ? "withdrawn" : "not pending" : void 0,
|
|
480
|
+
message: result === null ? output : result.content.flatMap((block) => {
|
|
481
|
+
const record = typeof block === "object" && block !== null ? block : {};
|
|
482
|
+
return record.type === "text" && typeof record.text === "string" ? [record.text] : [];
|
|
483
|
+
}).join("\n")
|
|
484
|
+
};
|
|
485
|
+
}
|
|
486
|
+
//#endregion
|
|
487
|
+
//#region src/extensions/workspaces/sessions/(frontend)/tool/_components/ApprovalWithdrawToolMessage.native.tsx
|
|
488
|
+
/** The approval_withdraw tool's timeline item on native, as the web's: id and outcome, then the tool's sentence. */
|
|
489
|
+
function ApprovalWithdrawToolMessage({ args, result, output, running, isError }) {
|
|
490
|
+
const view = approvalWithdrawView(args, result, output);
|
|
491
|
+
return /* @__PURE__ */ jsx(MessageItem, {
|
|
492
|
+
tone: toolTone({
|
|
493
|
+
running,
|
|
494
|
+
isError
|
|
495
|
+
}),
|
|
496
|
+
expandable: true,
|
|
497
|
+
children: ({ expanded }) => /* @__PURE__ */ jsxs(Fragment, { children: [/* @__PURE__ */ jsx(MessageItemHeader, {
|
|
498
|
+
title: "approval_withdraw",
|
|
499
|
+
children: /* @__PURE__ */ jsxs(View, {
|
|
500
|
+
testID: "tool-call-approval_withdraw",
|
|
501
|
+
style: styles.summary,
|
|
502
|
+
children: [/* @__PURE__ */ jsx(Text, {
|
|
503
|
+
numberOfLines: 1,
|
|
504
|
+
ellipsizeMode: "middle",
|
|
505
|
+
style: styles.id,
|
|
506
|
+
children: view.approvalId
|
|
507
|
+
}), view.outcome !== void 0 ? /* @__PURE__ */ jsxs(Text, {
|
|
508
|
+
numberOfLines: 1,
|
|
509
|
+
style: [styles.sans, styles.detail],
|
|
510
|
+
children: ["· ", view.outcome]
|
|
511
|
+
}) : null]
|
|
512
|
+
})
|
|
513
|
+
}), !expanded ? null : isError ? /* @__PURE__ */ jsx(MessageItemBody, {
|
|
514
|
+
testID: "tool-result-approval_withdraw",
|
|
515
|
+
children: /* @__PURE__ */ jsx(Text, {
|
|
516
|
+
selectable: true,
|
|
517
|
+
style: [styles.sans, styles.error],
|
|
518
|
+
children: view.message
|
|
519
|
+
})
|
|
520
|
+
}) : result === null ? running ? /* @__PURE__ */ jsx(MessageItemBody, {
|
|
521
|
+
testID: "tool-result-approval_withdraw",
|
|
522
|
+
children: /* @__PURE__ */ jsx(MessageItemStatus, {
|
|
523
|
+
tone: "running",
|
|
524
|
+
children: "running"
|
|
525
|
+
})
|
|
526
|
+
}) : null : view.message.length === 0 ? null : /* @__PURE__ */ jsx(MessageItemBody, {
|
|
527
|
+
testID: "tool-result-approval_withdraw",
|
|
528
|
+
children: /* @__PURE__ */ jsx(Text, {
|
|
529
|
+
selectable: true,
|
|
530
|
+
style: [styles.sans, styles.message],
|
|
531
|
+
children: view.message
|
|
532
|
+
})
|
|
533
|
+
})] })
|
|
534
|
+
});
|
|
535
|
+
}
|
|
536
|
+
const styles = StyleSheet.create((theme) => ({
|
|
537
|
+
summary: {
|
|
538
|
+
flex: 1,
|
|
539
|
+
flexDirection: "row",
|
|
540
|
+
flexWrap: "wrap",
|
|
541
|
+
alignItems: "center",
|
|
542
|
+
columnGap: theme.spacing(2),
|
|
543
|
+
minWidth: 0,
|
|
544
|
+
uni__dependencies: [0]
|
|
545
|
+
},
|
|
546
|
+
sans: {
|
|
547
|
+
fontFamily: fontOf(theme.fontFamily.sans),
|
|
548
|
+
fontSize: theme.fontSize.base,
|
|
549
|
+
lineHeight: theme.lineHeight.base,
|
|
550
|
+
uni__dependencies: [0]
|
|
551
|
+
},
|
|
552
|
+
id: {
|
|
553
|
+
flexShrink: 1,
|
|
554
|
+
maxWidth: "100%",
|
|
555
|
+
fontFamily: fontOf(theme.fontFamily.mono),
|
|
556
|
+
fontSize: theme.fontSize.sm,
|
|
557
|
+
color: theme.colors.text,
|
|
558
|
+
uni__dependencies: [0]
|
|
559
|
+
},
|
|
560
|
+
detail: {
|
|
561
|
+
flexShrink: 0,
|
|
562
|
+
color: theme.colors.faint,
|
|
563
|
+
uni__dependencies: [0]
|
|
564
|
+
},
|
|
565
|
+
message: {
|
|
566
|
+
color: theme.colors.text,
|
|
567
|
+
uni__dependencies: [0]
|
|
568
|
+
},
|
|
569
|
+
error: {
|
|
570
|
+
color: theme.colors.red,
|
|
571
|
+
uni__dependencies: [0]
|
|
572
|
+
}
|
|
573
|
+
}));
|
|
574
|
+
//#endregion
|
|
575
|
+
//#region src/extensions/workspaces/sessions/(frontend)/tool/approval-withdraw.native.tsx
|
|
576
|
+
var approval_withdraw_native_default = defineToolRenderer({ message: ApprovalWithdrawToolMessage });
|
|
577
|
+
//#endregion
|
|
476
578
|
//#region generated/native.ts
|
|
477
579
|
const via = (identity, value) => value === void 0 ? void 0 : {
|
|
478
580
|
...identity,
|
|
@@ -494,9 +596,14 @@ const nativePlugin = defineNativePlugin({
|
|
|
494
596
|
return start_native_default;
|
|
495
597
|
}
|
|
496
598
|
},
|
|
497
|
-
session: {
|
|
498
|
-
|
|
499
|
-
|
|
599
|
+
session: {
|
|
600
|
+
get channels() {
|
|
601
|
+
return [via({ channel: "approval_activity" }, approval_activity_native_default)];
|
|
602
|
+
},
|
|
603
|
+
get toolRenderers() {
|
|
604
|
+
return [via({ tools: ["approval_withdraw"] }, approval_withdraw_native_default)];
|
|
605
|
+
}
|
|
606
|
+
}
|
|
500
607
|
});
|
|
501
608
|
//#endregion
|
|
502
609
|
export { nativePlugin };
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"native.mjs","names":["Button","fontOf","StyleSheet","ApprovalCardWire","approvalStateLabel","approvalSummary","ApprovalActivitySectionProps","ApprovalActivitySection","approvals","busy","error","voiceHint","onDecide","onDismiss","length","styles","meta","first","find","card","state","sessionGone","id","section","map","includes","undefined","ApprovalCardProps","primary","ApprovalCard","gone","pending","note","requirement","reason","decidedCard","title","label","decidedLabel","uncertainLabel","summary","details","value","actions","action","create","theme","gap","spacing","uni__dependencies","padding","borderWidth","borderColor","colors","borderRadius","md","backgroundColor","panel","border","color","green","dim","fontFamily","sans","fontSize","sm","magenta","fontWeight","medium","base","lineHeight","hi","semibold","lineHeightRelaxed","text","red","flexDirection","minHeight","flex","activityGroupApproval","fillApproval","lifecycleStart","channelApprovalActivity"],"sources":["../../src/types/approvalActivity.ts","../../src/extensions/workspaces/sessions/(frontend)/_lib/approvalActivityModel.ts","../../src/extensions/workspaces/sessions/(frontend)/_lib/approvalActivityStore.native.ts","../../src/extensions/(frontend)/activity-group/approval.native.ts","../../src/types/voiceHint.ts","../../src/extensions/workspaces/sessions/(frontend)/_components/ApprovalActivitySection.native.tsx","../../src/extensions/workspaces/sessions/(frontend)/fill/_components/ApprovalActivityFill.native.tsx","../../src/extensions/(frontend)/fill/Approval.activity.approval.native.tsx","../../src/extensions/(frontend)/lifecycle/start.native.ts","../../src/extensions/workspaces/sessions/(frontend)/channel/approval-activity.native.ts","../../generated/native.ts"],"sourcesContent":["import type { PoApprovalPrompt } from '@agimon-ai/po-core/web';\n\n/** The session channel the Activity card reads. */\nexport const approvalActivityChannelType = 'approval_activity';\n/** The session methods the card answers through. */\nexport const approvalMethodService = 'approval';\n\n/** One open request as the card shows it: the bounded description, never the call's arguments. */\nexport interface ApprovalCardWire extends PoApprovalPrompt {\n /** The revision a decision must name, so a stale answer is refused. */\n readonly revision: number;\n /** Running calls and uncertain outcomes have no retry or decision controls. */\n readonly state: 'pending' | 'approved' | 'running' | 'interrupted';\n /** Why a call is waiting, or what is known about an interrupted call. */\n readonly reason?: string;\n /** Host-confirmed orphan; only these pending or approved requests may be dismissed. */\n readonly sessionGone?: true;\n}\n\nexport interface ApprovalActivityPayload {\n readonly approvals: readonly ApprovalCardWire[];\n}\n","import type { PoApprovalPrompt } from '@agimon-ai/po-core/web';\n\nimport type { ApprovalActivityPayload, ApprovalCardWire } from '../../../../../types/approvalActivity';\n\n/** The host contract's prompt parser (`parsePoApprovalPrompt`), passed in so this stays host-neutral. */\nexport type ParsePrompt = (input: unknown) => PoApprovalPrompt | undefined;\n\nconst REASON_LIMIT = 600;\n\nfunction parseCard(input: unknown, parsePrompt: ParsePrompt): ApprovalCardWire | null {\n const prompt = parsePrompt(input);\n if (prompt === undefined) return null;\n const { revision, state, reason, sessionGone } = input as Record<string, unknown>;\n if (typeof revision !== 'number' || !Number.isSafeInteger(revision) || revision < 1) return null;\n if (state !== 'pending' && state !== 'approved' && state !== 'running' && state !== 'interrupted') return null;\n return {\n ...prompt,\n revision,\n state,\n ...((state === 'pending' || state === 'approved') && sessionGone === true ? { sessionGone: true as const } : {}),\n ...(typeof reason === 'string' ? { reason: reason.slice(0, REASON_LIMIT) } : {}),\n };\n}\n\n/** The channel payload; malformed items are dropped, a malformed payload is refused. */\nexport function parseApprovalActivity(input: unknown, parsePrompt: ParsePrompt): ApprovalActivityPayload | null {\n const approvals = (input as { approvals?: unknown } | null)?.approvals;\n if (!Array.isArray(approvals)) return null;\n return {\n approvals: approvals\n .map((item) => parseCard(item, parsePrompt))\n .filter((card): card is ApprovalCardWire => card !== null),\n };\n}\n\n/** A method reply; anything malformed reads as a failure with a plain sentence. */\nexport function decisionFailure(reply: unknown): string | undefined {\n const value = reply as { ok?: unknown; message?: unknown } | null;\n if (value?.ok === true) return undefined;\n return typeof value?.message === 'string' && value.message !== ''\n ? value.message\n : 'Po could not record that answer. The card shows where things stand now.';\n}\n\n/** Same state labels in the cockpit and phone. */\nexport function approvalStateLabel(state: ApprovalCardWire['state']): string {\n return { pending: 'Your approval', approved: 'Approved', running: 'Running…', interrupted: 'Outcome uncertain' }[\n state\n ];\n}\n\n/** The section's lead line: calm, whatever the count. */\nexport function approvalSummary(approvals: readonly ApprovalCardWire[]): string {\n const current = approvals.filter((card) => card.sessionGone !== true);\n const pending = current.filter((card) => card.state === 'pending').length;\n if (approvals.length > 0 && current.length === 0) return 'This session is gone. Nothing will run.';\n if (pending === 0 && current.some((card) => card.state === 'interrupted'))\n return 'Outcome uncertain. Check before retrying.';\n if (pending === 0 && current.some((card) => card.state === 'running')) return 'Po is running an approved call.';\n if (pending === 0)\n return current.length === 1\n ? 'Approved. It runs when the session can.'\n : 'Approved. They run when the session can.';\n if (pending === 1) return 'One thing would like your eye, whenever you are ready.';\n return `${pending} things would like your eye, whenever you are ready.`;\n}\n","/**\n * The Activity card's view of this session's open approvals, and the person's answers.\n *\n * DESIGN PATTERNS:\n * - Session store fed by the live channel and paginated global snapshots for dormant sessions.\n * - Answers are typed global methods, not channel frames, so a refusal reaches the card that asked.\n * - The method caller lives in a store rather than a module variable, because a web plugin keeps no\n * mutable module state and the page may reconnect.\n */\nimport {\n defineGlobalStore,\n defineSessionStore,\n parsePoApprovalPrompt,\n type WebPluginRuntime,\n} from '@agimon-ai/po-core/native';\nimport { useCallback, useSyncExternalStore } from 'react';\n\nimport {\n approvalActivityChannelType,\n approvalMethodService,\n type ApprovalActivityPayload,\n type ApprovalCardWire,\n} from '../../../../../types/approvalActivity';\nimport { decisionFailure, parseApprovalActivity } from './approvalActivityModel';\n\nexport interface ApprovalActivitySession {\n approvals: readonly ApprovalCardWire[];\n /** Requests with an answer still on its way, so their buttons wait. */\n busy: readonly string[];\n /** The last answer the server refused, in plain words. */\n error?: string;\n /** A transport failure, cleared when an authoritative snapshot arrives. */\n snapshotError?: string;\n}\n\nexport const approvalActivity = defineSessionStore<ApprovalActivitySession>({ approvals: [], busy: [] });\n\nexport function useApprovalActivity(sessionId: string | null): ApprovalActivitySession {\n const subscribe = useCallback((listener: () => void) => {\n const subscription = approvalActivity.store.subscribe(listener);\n return () => subscription.unsubscribe();\n }, []);\n return useSyncExternalStore(subscribe, () => approvalActivity.select(approvalActivity.store.state, sessionId));\n}\n\n/** Keep each orphan's owning identity, exposing only authoritative gone cards from other sessions. */\nexport function selectApprovalActivityGroups(state: typeof approvalActivity.store.state, sessionId: string | null) {\n const groups = [{ sessionId, activity: approvalActivity.select(state, sessionId) }];\n for (const [ownerId, activity] of Object.entries(state)) {\n if (ownerId === sessionId || activity === undefined) continue;\n const approvals = activity.approvals.filter((card) => card.sessionGone === true);\n if (approvals.length > 0) groups.push({ sessionId: ownerId, activity: { ...activity, approvals } });\n }\n return groups.some(({ activity }) => activity.approvals.length > 0)\n ? groups.filter(({ activity }) => activity.approvals.length > 0)\n : groups;\n}\n\nexport function useApprovalActivityGroups(sessionId: string | null) {\n const state = useSyncExternalStore(\n approvalActivitySource.subscribe,\n () => approvalActivity.store.state,\n () => approvalActivity.store.state,\n );\n return selectApprovalActivityGroups(state, sessionId);\n}\n\n/** The group shows while this session or a gone session waits for the person. */\nexport const approvalActivitySource = {\n subscribe(this: void, listener: () => void) {\n const subscription = approvalActivity.store.subscribe(listener);\n return () => subscription.unsubscribe();\n },\n isActive(sessionId: string | null) {\n return selectApprovalActivityGroups(approvalActivity.store.state, sessionId).some(\n ({ activity }) => activity.approvals.length > 0,\n );\n },\n};\n\nexport const approvalActivityChannel = approvalActivity.channel<ApprovalActivityPayload>({\n channel: approvalActivityChannelType,\n parse: (input) => parseApprovalActivity(input, parsePoApprovalPrompt),\n reduce: (current, { approvals }) => ({ ...current, approvals }),\n});\n\nconst approvalRuntime = defineGlobalStore<WebPluginRuntime | undefined>(undefined);\nconst approvalRefresh = defineGlobalStore<(() => Promise<void>) | undefined>(undefined);\nconst SNAPSHOT_INTERVAL_MS = 5_000;\n\n/** Hydrates persisted cards even when their session plugin is not mounted. Never wakes a session. */\nexport function startApprovalRuntime(runtime: WebPluginRuntime): () => void {\n const invoke: WebPluginRuntime['invokeServerMethod'] = (call) => runtime.invokeServerMethod(call);\n let stopped = false;\n let refreshing: Promise<void> | undefined;\n let requested = false;\n const refresh = (): Promise<void> => {\n requested = true;\n if (refreshing !== undefined) return refreshing;\n refreshing = (async () => {\n while (requested && !stopped) {\n requested = false;\n try {\n const cards = new Map<string, ApprovalCardWire[]>();\n let offset: number | null = 0;\n while (offset !== null && !stopped) {\n const reply = (await invoke({\n mount: { scope: 'global' },\n service: approvalMethodService,\n method: 'snapshot',\n input: { offset },\n })) as {\n cards: (ApprovalCardWire & { sessionId: string })[];\n nextOffset: number | null;\n };\n if (\n !Array.isArray(reply.cards) ||\n (reply.nextOffset !== null && (!Number.isSafeInteger(reply.nextOffset) || reply.nextOffset <= offset))\n )\n throw new Error('Invalid approval snapshot.');\n for (const card of reply.cards) {\n if (typeof card.sessionId !== 'string') continue;\n const parsed = parseApprovalActivity({ approvals: [card] }, parsePoApprovalPrompt)?.approvals[0];\n if (parsed === undefined) continue;\n const sessionId = runtime.qualifySessionId?.(card.sessionId) ?? card.sessionId;\n const sessionCards = cards.get(sessionId) ?? [];\n sessionCards.push(parsed);\n cards.set(sessionId, sessionCards);\n }\n offset = reply.nextOffset;\n }\n if (stopped) return;\n // Include old sessions so decisions made on another client clear dormant cards too.\n for (const sessionId of new Set([...Object.keys(approvalActivity.store.state), ...cards.keys()])) {\n approvalActivity.update(sessionId, (current) => ({\n ...current,\n approvals: cards.get(sessionId) ?? [],\n snapshotError: undefined,\n }));\n }\n } catch (error) {\n if (stopped) return;\n // Keep the last known cards during disconnect; a reconnect retries immediately.\n for (const sessionId of Object.keys(approvalActivity.store.state))\n approvalActivity.update(sessionId, (current) => ({\n ...current,\n snapshotError: error instanceof Error ? error.message : String(error),\n }));\n }\n }\n })().finally(() => {\n refreshing = undefined;\n });\n return refreshing;\n };\n approvalRuntime.update(() => runtime);\n approvalRefresh.update(() => refresh);\n const disconnect = runtime.onHubConnected(() => void refresh());\n const timer = setInterval(() => void refresh(), SNAPSHOT_INTERVAL_MS);\n void refresh();\n return () => {\n stopped = true;\n clearInterval(timer);\n disconnect();\n approvalRuntime.update((current) => (current === runtime ? undefined : current));\n approvalRefresh.update((current) => (current === refresh ? undefined : current));\n };\n}\n\n/**\n * Sends one answer, holding the card's buttons until it lands. Undefined on success, otherwise the\n * sentence the card shows. Refreshes persisted state after both accepted and refused answers.\n */\nexport async function answerApproval(\n sessionId: string,\n id: string,\n method: 'decide' | 'dismiss',\n input: Record<string, unknown>,\n): Promise<string | undefined> {\n approvalActivity.update(sessionId, (current) => ({ ...current, busy: [...current.busy, id], error: undefined }));\n let reply: unknown;\n try {\n const runtime = approvalRuntime.store.state;\n if (!runtime) throw new Error('Approvals are not connected yet.');\n reply = await runtime.invokeServerMethod({\n mount: { scope: 'global' },\n service: approvalMethodService,\n method,\n input: { ...input, sessionId: runtime.localSessionId?.(sessionId) ?? sessionId, id },\n });\n } catch (error) {\n reply = { ok: false, message: error instanceof Error ? error.message : String(error) };\n }\n const error = decisionFailure(reply);\n approvalActivity.update(sessionId, (current) => ({\n ...current,\n busy: current.busy.filter((busy) => busy !== id),\n ...(error === undefined ? {} : { error }),\n }));\n await approvalRefresh.store.state?.();\n return error;\n}\n","import { defineActivityGroup } from '@agimon-ai/po-core/native';\nimport { ShieldIcon } from '@agimon-ai/po-native-components';\nimport { createElement } from 'react';\n\nimport { approvalActivitySource } from '../../workspaces/sessions/(frontend)/_lib/approvalActivityStore.native';\n\nexport default defineActivityGroup({\n keys: 'g a',\n icon: () => createElement(ShieldIcon),\n activeSource: approvalActivitySource,\n // A request waiting for the person is a question, not work running.\n marksBackgroundWork: false,\n // Only there while something waits for the person; an empty Approval row would say nothing.\n hideWhenEmpty: true,\n order: 5,\n});\n","import type { SlotDeclaration } from '@agimon-ai/po-core/web';\n\n/** Whether a voice surface can take a spoken approve or deny for a session right now. */\nexport interface ApprovalVoiceHintSource {\n subscribe(listener: () => void): () => void;\n isActive(sessionId: string | null): boolean;\n}\n\nfunction parseApprovalVoiceHintSource(input: unknown): ApprovalVoiceHintSource | null {\n const source = input as Partial<ApprovalVoiceHintSource> | null;\n return typeof source?.subscribe === 'function' && typeof source.isActive === 'function'\n ? (source as ApprovalVoiceHintSource)\n : null;\n}\n\n/** Voice fills this while installed; the hint shows only for `ask` approvals and only while a source is active. */\nexport const approvalVoiceHintSlot: SlotDeclaration<ApprovalVoiceHintSource> = {\n slot: 'approval.voice-hint',\n parse: parseApprovalVoiceHintSource,\n};\n","import { Button, fontOf } from '@agimon-ai/po-native-components';\nimport { Text, View } from 'react-native';\nimport { StyleSheet } from 'react-native-unistyles';\n\nimport type { ApprovalCardWire } from '../../../../../types/approvalActivity';\nimport { approvalStateLabel, approvalSummary } from '../_lib/approvalActivityModel';\nimport type { ApprovalActivitySectionProps } from './ApprovalActivitySection.types';\n\n/**\n * The Approval group's body in the phone's Activity sheet: one card per request this session is\n * waiting on, the same states and copy as the cockpit.\n */\nexport function ApprovalActivitySection({\n approvals,\n busy = [],\n error,\n voiceHint,\n onDecide,\n onDismiss,\n}: ApprovalActivitySectionProps) {\n if (approvals.length === 0) return <Text style={styles.meta}>Nothing is waiting for your approval.</Text>;\n const first = approvals.find((card) => card.state === 'pending' && card.sessionGone !== true)?.id;\n return (\n <View style={styles.section}>\n <Text style={styles.meta}>{approvalSummary(approvals)}</Text>\n {error ? (\n <Text accessibilityRole=\"alert\" style={styles.error}>\n {error}\n </Text>\n ) : null}\n {approvals.map((card) => (\n <ApprovalCard\n key={card.id}\n card={card}\n primary={card.id === first}\n busy={busy.includes(card.id)}\n voiceHint={typeof voiceHint === 'string' ? voiceHint : undefined}\n onDecide={onDecide}\n onDismiss={onDismiss}\n />\n ))}\n </View>\n );\n}\n\ninterface ApprovalCardProps {\n card: ApprovalCardWire;\n primary: boolean;\n busy: boolean;\n voiceHint?: string;\n onDecide: ApprovalActivitySectionProps['onDecide'];\n onDismiss: ApprovalActivitySectionProps['onDismiss'];\n}\n\nfunction ApprovalCard({ card, primary, busy, voiceHint, onDecide, onDismiss }: ApprovalCardProps) {\n const gone = card.sessionGone === true && (card.state === 'pending' || card.state === 'approved');\n const pending = card.state === 'pending' && !gone;\n const note = gone\n ? 'Nothing will run. Dismiss this request to clear it.'\n : pending\n ? card.requirement === 'human'\n ? 'Only you can approve this in the app.'\n : (voiceHint ?? 'Po keeps working while it waits.')\n : (card.reason ??\n (card.state === 'running'\n ? 'Po is running this approved call.'\n : card.state === 'interrupted'\n ? 'Check what happened before retrying. This will not run again automatically.'\n : 'It runs when the session can.'));\n return (\n <View\n style={[styles.card, !pending && styles.decidedCard]}\n accessibilityLabel={card.title}\n accessibilityState={{ busy: busy || card.state === 'running' }}\n >\n <Text\n style={[\n styles.label,\n !pending && styles.decidedLabel,\n (gone || card.state === 'interrupted') && styles.uncertainLabel,\n ]}\n >\n {gone ? 'This session is gone' : approvalStateLabel(card.state)}\n </Text>\n <Text accessibilityRole=\"header\" style={styles.title}>\n {card.title}\n </Text>\n {card.summary ? <Text style={styles.summary}>{card.summary}</Text> : null}\n {card.details && card.details.length > 0 ? (\n <View style={styles.details}>\n {card.details.map(({ label, value }) => (\n <View key={label}>\n <Text style={styles.meta}>{label}</Text>\n <Text selectable style={styles.value}>\n {value}\n </Text>\n </View>\n ))}\n </View>\n ) : null}\n <Text style={styles.meta}>{note}</Text>\n <View style={styles.actions}>\n {pending ? (\n <>\n <Button\n variant={primary ? 'primary' : 'outline'}\n style={styles.action}\n disabled={busy}\n onPress={() => onDecide(card, 'approve')}\n >\n Approve\n </Button>\n <Button variant=\"ghost\" style={styles.action} disabled={busy} onPress={() => onDecide(card, 'deny')}>\n Deny\n </Button>\n </>\n ) : gone ? (\n <Button variant=\"ghost\" style={styles.action} disabled={busy} onPress={() => onDismiss(card)}>\n Dismiss\n </Button>\n ) : null}\n </View>\n </View>\n );\n}\n\nconst styles = StyleSheet.create((theme) => ({\n section: { gap: theme.spacing(2) },\n card: {\n gap: theme.spacing(2),\n padding: theme.spacing(3),\n borderWidth: 1,\n borderColor: theme.colors['edge-magenta'],\n borderRadius: theme.borderRadius.md,\n backgroundColor: theme.colors.panel,\n },\n decidedCard: { borderColor: theme.colors.border },\n decidedLabel: { color: theme.colors.green },\n uncertainLabel: { color: theme.colors.dim },\n label: {\n fontFamily: fontOf(theme.fontFamily.sans),\n fontSize: theme.fontSize.sm,\n color: theme.colors.magenta,\n fontWeight: theme.fontWeight.medium,\n },\n title: {\n fontFamily: fontOf(theme.fontFamily.sans),\n fontSize: theme.fontSize.base,\n lineHeight: theme.lineHeight.base,\n color: theme.colors.hi,\n fontWeight: theme.fontWeight.semibold,\n },\n summary: {\n fontFamily: fontOf(theme.fontFamily.sans),\n fontSize: theme.fontSize.base,\n lineHeight: theme.lineHeightRelaxed.base,\n color: theme.colors.text,\n },\n details: { gap: theme.spacing(2) },\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 error: {\n fontFamily: fontOf(theme.fontFamily.sans),\n fontSize: theme.fontSize.sm,\n lineHeight: theme.lineHeightRelaxed.sm,\n color: theme.colors.red,\n },\n value: {\n fontFamily: fontOf(theme.fontFamily.sans),\n fontSize: theme.fontSize.sm,\n lineHeight: theme.lineHeightRelaxed.sm,\n color: theme.colors.hi,\n },\n actions: { flexDirection: 'row', gap: theme.spacing(2) },\n action: { minHeight: theme.spacing(11), flex: 1 },\n}));\n","import type { WebPluginSlotProps } from '@agimon-ai/po-core/native';\nimport { useSyncExternalStore } from 'react';\n\nimport { approvalVoiceHintSlot, type ApprovalVoiceHintSource } from '../../../../../../types/voiceHint';\nimport { ApprovalActivitySection } from '../../_components/ApprovalActivitySection.native';\nimport { answerApproval, useApprovalActivityGroups } from '../../_lib/approvalActivityStore.native';\n\nconst VOICE_HINT = 'Or say “approve” or “deny”.';\nconst NO_SOURCES = (): (() => void) => () => undefined;\n\n/** Whether any installed voice surface can take a spoken answer for this session right now. */\nfunction useVoiceActive(sources: readonly ApprovalVoiceHintSource[], sessionId: string | null): boolean {\n const subscribe =\n sources.length === 0\n ? NO_SOURCES\n : (listener: () => void) => {\n const stops = sources.map((source) => source.subscribe(listener));\n return () => {\n for (const stop of stops) stop();\n };\n };\n const read = () => sources.some((source) => source.isActive(sessionId));\n return useSyncExternalStore(subscribe, read, read);\n}\n\n/** This session's requests and dismissible gone-session groups, each answered through its owner. */\nexport function ApprovalActivityFill({ sessionId, slotData }: WebPluginSlotProps) {\n const groups = useApprovalActivityGroups(sessionId);\n const voice = useVoiceActive(\n slotData(approvalVoiceHintSlot).map((fill) => fill.data),\n sessionId,\n );\n return (\n <>\n {groups.map(({ sessionId: ownerId, activity }) => (\n <ApprovalActivitySection\n key={ownerId ?? ''}\n approvals={activity.approvals}\n busy={activity.busy}\n error={activity.error ?? activity.snapshotError}\n {...(voice && ownerId === sessionId && !activity.approvals.some((card) => card.sessionGone === true)\n ? { voiceHint: VOICE_HINT }\n : {})}\n onDecide={(card, decision) =>\n ownerId &&\n ownerId === sessionId &&\n card.sessionGone !== true &&\n void answerApproval(ownerId, card.id, 'decide', { id: card.id, revision: card.revision, decision })\n }\n onDismiss={(card) =>\n ownerId && void answerApproval(ownerId, card.id, 'dismiss', { id: card.id, revision: card.revision })\n }\n />\n ))}\n </>\n );\n}\n","import { defineFill } from '@agimon-ai/po-core/native';\n\nimport { ApprovalActivityFill } from '../../workspaces/sessions/(frontend)/fill/_components/ApprovalActivityFill.native';\n\nexport default defineFill({ component: ApprovalActivityFill });\n","import { defineWebLifecycle } from '@agimon-ai/po-core/native';\n\nimport { startApprovalRuntime } from '../../workspaces/sessions/(frontend)/_lib/approvalActivityStore.native';\n\nexport default defineWebLifecycle(startApprovalRuntime);\n","import { defineChannelFile } from '@agimon-ai/po-core/native';\n\nimport { approvalActivityChannel } from '../_lib/approvalActivityStore.native';\n\nexport default defineChannelFile(approvalActivityChannel);\n","// Generated by @agimon-ai/po-build. Do not edit by hand.\nimport { defineNativePlugin, type WebPluginContributions } from '@agimon-ai/po-core/native';\n\nimport activityGroupApproval from '../src/extensions/(frontend)/activity-group/approval.native';\nimport fillApproval from '../src/extensions/(frontend)/fill/Approval.activity.approval.native';\nimport lifecycleStart from '../src/extensions/(frontend)/lifecycle/start.native';\nimport channelApprovalActivity from '../src/extensions/workspaces/sessions/(frontend)/channel/approval-activity.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: 'approval',\n global: {\n get activityGroups(): WebPluginContributions['activityGroups'] { return [via({ name: 'approval' }, activityGroupApproval)]; },\n get fills(): WebPluginContributions['fills'] { return [via({ slot: 'activity.approval', id: 'approval' }, fillApproval)]; },\n get start(): WebPluginContributions['start'] { return lifecycleStart; },\n },\n session: {\n get channels(): WebPluginContributions['channels'] { return [via({ channel: 'approval_activity' }, channelApprovalActivity)]; },\n },\n});\n"],"mappings":";;;;;;;;;AAGA,MAAa,8BAA8B;;AAE3C,MAAa,wBAAwB;;;ACErC,MAAM,eAAe;AAErB,SAAS,UAAU,OAAgB,aAAmD;CACpF,MAAM,SAAS,YAAY,KAAK;CAChC,IAAI,WAAW,KAAA,GAAW,OAAO;CACjC,MAAM,EAAE,UAAU,OAAO,QAAQ,gBAAgB;CACjD,IAAI,OAAO,aAAa,YAAY,CAAC,OAAO,cAAc,QAAQ,KAAK,WAAW,GAAG,OAAO;CAC5F,IAAI,UAAU,aAAa,UAAU,cAAc,UAAU,aAAa,UAAU,eAAe,OAAO;CAC1G,OAAO;EACL,GAAG;EACH;EACA;EACA,IAAK,UAAU,aAAa,UAAU,eAAe,gBAAgB,OAAO,EAAE,aAAa,KAAc,IAAI,CAAC;EAC9G,GAAI,OAAO,WAAW,WAAW,EAAE,QAAQ,OAAO,MAAM,GAAG,YAAY,EAAE,IAAI,CAAC;CAChF;AACF;;AAGA,SAAgB,sBAAsB,OAAgB,aAA0D;CAC9G,MAAM,YAAa,OAA0C;CAC7D,IAAI,CAAC,MAAM,QAAQ,SAAS,GAAG,OAAO;CACtC,OAAO,EACL,WAAW,UACR,KAAK,SAAS,UAAU,MAAM,WAAW,CAAC,CAAC,CAC3C,QAAQ,SAAmC,SAAS,IAAI,EAC7D;AACF;;AAGA,SAAgB,gBAAgB,OAAoC;CAClE,MAAM,QAAQ;CACd,IAAI,OAAO,OAAO,MAAM,OAAO,KAAA;CAC/B,OAAO,OAAO,OAAO,YAAY,YAAY,MAAM,YAAY,KAC3D,MAAM,UACN;AACN;;AAGA,SAAgB,mBAAmB,OAA0C;CAC3E,OA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GAAGC,gCAAuB,CAAC;CAAG,EAChI;AACF,CAAC"}
|
|
1
|
+
{"version":3,"file":"native.mjs","names":["Button","fontOf","StyleSheet","ApprovalCardWire","approvalStateLabel","approvalSummary","ApprovalActivitySectionProps","ApprovalActivitySection","approvals","busy","error","voiceHint","onDecide","onDismiss","length","styles","meta","first","find","card","state","sessionGone","id","section","map","includes","undefined","ApprovalCardProps","primary","ApprovalCard","gone","pending","note","requirement","reason","title","label","decidedLabel","uncertainLabel","summary","details","value","actions","action","create","theme","gap","spacing","uni__dependencies","padding","borderWidth","borderColor","colors","border","borderRadius","md","backgroundColor","panel","color","green","dim","fontFamily","sans","fontSize","sm","magenta","fontWeight","medium","base","lineHeight","hi","semibold","lineHeightRelaxed","text","red","flexDirection","minHeight","flex","styles","ToolMessageRenderProps","fontOf","MessageItem","MessageItemBody","MessageItemHeader","MessageItemStatus","toolTone","PoNativeTheme","StyleSheet","approvalWithdrawView","ApprovalWithdrawToolMessage","args","result","output","running","isError","view","expanded","styles","summary","id","approvalId","outcome","undefined","sans","detail","error","message","length","create","theme","flex","flexDirection","flexWrap","alignItems","columnGap","spacing","minWidth","uni__dependencies","fontFamily","fontSize","base","lineHeight","flexShrink","maxWidth","mono","sm","color","colors","text","faint","red","activityGroupApproval","fillApproval","lifecycleStart","channelApprovalActivity","toolApprovalWithdraw"],"sources":["../../src/types/approvalActivity.ts","../../src/extensions/workspaces/sessions/(frontend)/_lib/approvalActivityModel.ts","../../src/extensions/workspaces/sessions/(frontend)/_lib/approvalActivityStore.native.ts","../../src/extensions/(frontend)/activity-group/approval.native.ts","../../src/types/voiceHint.ts","../../src/extensions/workspaces/sessions/(frontend)/_components/ApprovalActivitySection.native.tsx","../../src/extensions/workspaces/sessions/(frontend)/fill/_components/ApprovalActivityFill.native.tsx","../../src/extensions/(frontend)/fill/Approval.activity.approval.native.tsx","../../src/extensions/(frontend)/lifecycle/start.native.ts","../../src/extensions/workspaces/sessions/(frontend)/channel/approval-activity.native.ts","../../src/extensions/workspaces/sessions/(frontend)/tool/_lib/approvalWithdrawView.ts","../../src/extensions/workspaces/sessions/(frontend)/tool/_components/ApprovalWithdrawToolMessage.native.tsx","../../src/extensions/workspaces/sessions/(frontend)/tool/approval-withdraw.native.tsx","../../generated/native.ts"],"sourcesContent":["import type { PoApprovalPrompt } from '@agimon-ai/po-core/web';\n\n/** The session channel the Activity card reads. */\nexport const approvalActivityChannelType = 'approval_activity';\n/** The session methods the card answers through. */\nexport const approvalMethodService = 'approval';\n\n/** One open request as the card shows it: the bounded description, never the call's arguments. */\nexport interface ApprovalCardWire extends PoApprovalPrompt {\n /** The revision a decision must name, so a stale answer is refused. */\n readonly revision: number;\n /** Running calls and uncertain outcomes have no retry or decision controls. */\n readonly state: 'pending' | 'approved' | 'running' | 'interrupted';\n /** Why a call is waiting, or what is known about an interrupted call. */\n readonly reason?: string;\n /** Host-confirmed orphan; only these pending or approved requests may be dismissed. */\n readonly sessionGone?: true;\n}\n\nexport interface ApprovalActivityPayload {\n readonly approvals: readonly ApprovalCardWire[];\n}\n","import type { PoApprovalPrompt } from '@agimon-ai/po-core/web';\n\nimport type { ApprovalActivityPayload, ApprovalCardWire } from '../../../../../types/approvalActivity';\n\n/** The host contract's prompt parser (`parsePoApprovalPrompt`), passed in so this stays host-neutral. */\nexport type ParsePrompt = (input: unknown) => PoApprovalPrompt | undefined;\n\nconst REASON_LIMIT = 600;\n\nfunction parseCard(input: unknown, parsePrompt: ParsePrompt): ApprovalCardWire | null {\n const prompt = parsePrompt(input);\n if (prompt === undefined) return null;\n const { revision, state, reason, sessionGone } = input as Record<string, unknown>;\n if (typeof revision !== 'number' || !Number.isSafeInteger(revision) || revision < 1) return null;\n if (state !== 'pending' && state !== 'approved' && state !== 'running' && state !== 'interrupted') return null;\n return {\n ...prompt,\n revision,\n state,\n ...((state === 'pending' || state === 'approved') && sessionGone === true ? { sessionGone: true as const } : {}),\n ...(typeof reason === 'string' ? { reason: reason.slice(0, REASON_LIMIT) } : {}),\n };\n}\n\n/** The channel payload; malformed items are dropped, a malformed payload is refused. */\nexport function parseApprovalActivity(input: unknown, parsePrompt: ParsePrompt): ApprovalActivityPayload | null {\n const approvals = (input as { approvals?: unknown } | null)?.approvals;\n if (!Array.isArray(approvals)) return null;\n return {\n approvals: approvals\n .map((item) => parseCard(item, parsePrompt))\n .filter((card): card is ApprovalCardWire => card !== null),\n };\n}\n\n/** A method reply; anything malformed reads as a failure with a plain sentence. */\nexport function decisionFailure(reply: unknown): string | undefined {\n const value = reply as { ok?: unknown; message?: unknown } | null;\n if (value?.ok === true) return undefined;\n return typeof value?.message === 'string' && value.message !== ''\n ? value.message\n : 'Po could not record that answer. The card shows where things stand now.';\n}\n\n/** Same state labels in the cockpit and phone. */\nexport function approvalStateLabel(state: ApprovalCardWire['state']): string {\n return { pending: 'Your approval', approved: 'Approved', running: 'Running…', interrupted: 'Outcome uncertain' }[\n state\n ];\n}\n\n/** The section's lead line: calm, whatever the count. */\nexport function approvalSummary(approvals: readonly ApprovalCardWire[]): string {\n const current = approvals.filter((card) => card.sessionGone !== true);\n const pending = current.filter((card) => card.state === 'pending').length;\n if (approvals.length > 0 && current.length === 0) return 'This session is gone. Nothing will run.';\n if (pending === 0 && current.some((card) => card.state === 'interrupted'))\n return 'Outcome uncertain. Check before retrying.';\n if (pending === 0 && current.some((card) => card.state === 'running')) return 'Po is running an approved call.';\n if (pending === 0)\n return current.length === 1\n ? 'Approved. It runs when the session can.'\n : 'Approved. They run when the session can.';\n if (pending === 1) return 'One thing would like your eye, whenever you are ready.';\n return `${pending} things would like your eye, whenever you are ready.`;\n}\n","/**\n * The Activity card's view of this session's open approvals, and the person's answers.\n *\n * DESIGN PATTERNS:\n * - Session store fed by the live channel and paginated global snapshots for dormant sessions.\n * - Answers are typed global methods, not channel frames, so a refusal reaches the card that asked.\n * - The method caller lives in a store rather than a module variable, because a web plugin keeps no\n * mutable module state and the page may reconnect.\n */\nimport {\n defineGlobalStore,\n defineSessionStore,\n parsePoApprovalPrompt,\n type WebPluginRuntime,\n} from '@agimon-ai/po-core/native';\nimport { useCallback, useSyncExternalStore } from 'react';\n\nimport {\n approvalActivityChannelType,\n approvalMethodService,\n type ApprovalActivityPayload,\n type ApprovalCardWire,\n} from '../../../../../types/approvalActivity';\nimport { decisionFailure, parseApprovalActivity } from './approvalActivityModel';\n\nexport interface ApprovalActivitySession {\n approvals: readonly ApprovalCardWire[];\n /** Requests with an answer still on its way, so their buttons wait. */\n busy: readonly string[];\n /** The last answer the server refused, in plain words. */\n error?: string;\n /** A transport failure, cleared when an authoritative snapshot arrives. */\n snapshotError?: string;\n}\n\nexport const approvalActivity = defineSessionStore<ApprovalActivitySession>({ approvals: [], busy: [] });\n\nexport function useApprovalActivity(sessionId: string | null): ApprovalActivitySession {\n const subscribe = useCallback((listener: () => void) => {\n const subscription = approvalActivity.store.subscribe(listener);\n return () => subscription.unsubscribe();\n }, []);\n return useSyncExternalStore(subscribe, () => approvalActivity.select(approvalActivity.store.state, sessionId));\n}\n\n/** Keep each orphan's owning identity, exposing only authoritative gone cards from other sessions. */\nexport function selectApprovalActivityGroups(state: typeof approvalActivity.store.state, sessionId: string | null) {\n const groups = [{ sessionId, activity: approvalActivity.select(state, sessionId) }];\n for (const [ownerId, activity] of Object.entries(state)) {\n if (ownerId === sessionId || activity === undefined) continue;\n const approvals = activity.approvals.filter((card) => card.sessionGone === true);\n if (approvals.length > 0) groups.push({ sessionId: ownerId, activity: { ...activity, approvals } });\n }\n return groups.some(({ activity }) => activity.approvals.length > 0)\n ? groups.filter(({ activity }) => activity.approvals.length > 0)\n : groups;\n}\n\nexport function useApprovalActivityGroups(sessionId: string | null) {\n const state = useSyncExternalStore(\n approvalActivitySource.subscribe,\n () => approvalActivity.store.state,\n () => approvalActivity.store.state,\n );\n return selectApprovalActivityGroups(state, sessionId);\n}\n\n/** The group shows while this session or a gone session waits for the person. */\nexport const approvalActivitySource = {\n subscribe(this: void, listener: () => void) {\n const subscription = approvalActivity.store.subscribe(listener);\n return () => subscription.unsubscribe();\n },\n isActive(sessionId: string | null) {\n return selectApprovalActivityGroups(approvalActivity.store.state, sessionId).some(\n ({ activity }) => activity.approvals.length > 0,\n );\n },\n};\n\nexport const approvalActivityChannel = approvalActivity.channel<ApprovalActivityPayload>({\n channel: approvalActivityChannelType,\n parse: (input) => parseApprovalActivity(input, parsePoApprovalPrompt),\n reduce: (current, { approvals }) => ({ ...current, approvals }),\n});\n\nconst approvalRuntime = defineGlobalStore<WebPluginRuntime | undefined>(undefined);\nconst approvalRefresh = defineGlobalStore<(() => Promise<void>) | undefined>(undefined);\nconst SNAPSHOT_INTERVAL_MS = 5_000;\n\n/** Hydrates persisted cards even when their session plugin is not mounted. Never wakes a session. */\nexport function startApprovalRuntime(runtime: WebPluginRuntime): () => void {\n const invoke: WebPluginRuntime['invokeServerMethod'] = (call) => runtime.invokeServerMethod(call);\n let stopped = false;\n let refreshing: Promise<void> | undefined;\n let requested = false;\n const refresh = (): Promise<void> => {\n requested = true;\n if (refreshing !== undefined) return refreshing;\n refreshing = (async () => {\n while (requested && !stopped) {\n requested = false;\n try {\n const cards = new Map<string, ApprovalCardWire[]>();\n let offset: number | null = 0;\n while (offset !== null && !stopped) {\n const reply = (await invoke({\n mount: { scope: 'global' },\n service: approvalMethodService,\n method: 'snapshot',\n input: { offset },\n })) as {\n cards: (ApprovalCardWire & { sessionId: string })[];\n nextOffset: number | null;\n };\n if (\n !Array.isArray(reply.cards) ||\n (reply.nextOffset !== null && (!Number.isSafeInteger(reply.nextOffset) || reply.nextOffset <= offset))\n )\n throw new Error('Invalid approval snapshot.');\n for (const card of reply.cards) {\n if (typeof card.sessionId !== 'string') continue;\n const parsed = parseApprovalActivity({ approvals: [card] }, parsePoApprovalPrompt)?.approvals[0];\n if (parsed === undefined) continue;\n const sessionId = runtime.qualifySessionId?.(card.sessionId) ?? card.sessionId;\n const sessionCards = cards.get(sessionId) ?? [];\n sessionCards.push(parsed);\n cards.set(sessionId, sessionCards);\n }\n offset = reply.nextOffset;\n }\n if (stopped) return;\n // Include old sessions so decisions made on another client clear dormant cards too.\n for (const sessionId of new Set([...Object.keys(approvalActivity.store.state), ...cards.keys()])) {\n approvalActivity.update(sessionId, (current) => ({\n ...current,\n approvals: cards.get(sessionId) ?? [],\n snapshotError: undefined,\n }));\n }\n } catch (error) {\n if (stopped) return;\n // Keep the last known cards during disconnect; a reconnect retries immediately.\n for (const sessionId of Object.keys(approvalActivity.store.state))\n approvalActivity.update(sessionId, (current) => ({\n ...current,\n snapshotError: error instanceof Error ? error.message : String(error),\n }));\n }\n }\n })().finally(() => {\n refreshing = undefined;\n });\n return refreshing;\n };\n approvalRuntime.update(() => runtime);\n approvalRefresh.update(() => refresh);\n const disconnect = runtime.onHubConnected(() => void refresh());\n const timer = setInterval(() => void refresh(), SNAPSHOT_INTERVAL_MS);\n void refresh();\n return () => {\n stopped = true;\n clearInterval(timer);\n disconnect();\n approvalRuntime.update((current) => (current === runtime ? undefined : current));\n approvalRefresh.update((current) => (current === refresh ? undefined : current));\n };\n}\n\n/**\n * Sends one answer, holding the card's buttons until it lands. Undefined on success, otherwise the\n * sentence the card shows. Refreshes persisted state after both accepted and refused answers.\n */\nexport async function answerApproval(\n sessionId: string,\n id: string,\n method: 'decide' | 'dismiss',\n input: Record<string, unknown>,\n): Promise<string | undefined> {\n approvalActivity.update(sessionId, (current) => ({ ...current, busy: [...current.busy, id], error: undefined }));\n let reply: unknown;\n try {\n const runtime = approvalRuntime.store.state;\n if (!runtime) throw new Error('Approvals are not connected yet.');\n reply = await runtime.invokeServerMethod({\n mount: { scope: 'global' },\n service: approvalMethodService,\n method,\n input: { ...input, sessionId: runtime.localSessionId?.(sessionId) ?? sessionId, id },\n });\n } catch (error) {\n reply = { ok: false, message: error instanceof Error ? error.message : String(error) };\n }\n const error = decisionFailure(reply);\n approvalActivity.update(sessionId, (current) => ({\n ...current,\n busy: current.busy.filter((busy) => busy !== id),\n ...(error === undefined ? {} : { error }),\n }));\n await approvalRefresh.store.state?.();\n return error;\n}\n","import { defineActivityGroup } from '@agimon-ai/po-core/native';\nimport { ShieldIcon } from '@agimon-ai/po-native-components';\nimport { createElement } from 'react';\n\nimport { approvalActivitySource } from '../../workspaces/sessions/(frontend)/_lib/approvalActivityStore.native';\n\nexport default defineActivityGroup({\n keys: 'g a',\n icon: () => createElement(ShieldIcon),\n activeSource: approvalActivitySource,\n // A request waiting for the person is a question, not work running.\n marksBackgroundWork: false,\n // Only there while something waits for the person; an empty Approval row would say nothing.\n hideWhenEmpty: true,\n order: 5,\n});\n","import type { SlotDeclaration } from '@agimon-ai/po-core/web';\n\n/** Whether a voice surface can take a spoken approve or deny for a session right now. */\nexport interface ApprovalVoiceHintSource {\n subscribe(listener: () => void): () => void;\n isActive(sessionId: string | null): boolean;\n}\n\nfunction parseApprovalVoiceHintSource(input: unknown): ApprovalVoiceHintSource | null {\n const source = input as Partial<ApprovalVoiceHintSource> | null;\n return typeof source?.subscribe === 'function' && typeof source.isActive === 'function'\n ? (source as ApprovalVoiceHintSource)\n : null;\n}\n\n/** Voice fills this while installed; the hint shows only for `ask` approvals and only while a source is active. */\nexport const approvalVoiceHintSlot: SlotDeclaration<ApprovalVoiceHintSource> = {\n slot: 'approval.voice-hint',\n parse: parseApprovalVoiceHintSource,\n};\n","import { Button, fontOf } from '@agimon-ai/po-native-components';\nimport { Text, View } from 'react-native';\nimport { StyleSheet } from 'react-native-unistyles';\n\nimport type { ApprovalCardWire } from '../../../../../types/approvalActivity';\nimport { approvalStateLabel, approvalSummary } from '../_lib/approvalActivityModel';\nimport type { ApprovalActivitySectionProps } from './ApprovalActivitySection.types';\n\n/**\n * The Approval group's body in the phone's Activity sheet: one card per request this session is\n * waiting on, the same states and copy as the cockpit.\n */\nexport function ApprovalActivitySection({\n approvals,\n busy = [],\n error,\n voiceHint,\n onDecide,\n onDismiss,\n}: ApprovalActivitySectionProps) {\n if (approvals.length === 0) return <Text style={styles.meta}>Nothing is waiting for your approval.</Text>;\n const first = approvals.find((card) => card.state === 'pending' && card.sessionGone !== true)?.id;\n return (\n <View style={styles.section}>\n <Text style={styles.meta}>{approvalSummary(approvals)}</Text>\n {error ? (\n <Text accessibilityRole=\"alert\" style={styles.error}>\n {error}\n </Text>\n ) : null}\n {approvals.map((card) => (\n <ApprovalCard\n key={card.id}\n card={card}\n primary={card.id === first}\n busy={busy.includes(card.id)}\n voiceHint={typeof voiceHint === 'string' ? voiceHint : undefined}\n onDecide={onDecide}\n onDismiss={onDismiss}\n />\n ))}\n </View>\n );\n}\n\ninterface ApprovalCardProps {\n card: ApprovalCardWire;\n primary: boolean;\n busy: boolean;\n voiceHint?: string;\n onDecide: ApprovalActivitySectionProps['onDecide'];\n onDismiss: ApprovalActivitySectionProps['onDismiss'];\n}\n\nfunction ApprovalCard({ card, primary, busy, voiceHint, onDecide, onDismiss }: ApprovalCardProps) {\n const gone = card.sessionGone === true && (card.state === 'pending' || card.state === 'approved');\n const pending = card.state === 'pending' && !gone;\n const note = gone\n ? 'Nothing will run. Dismiss this request to clear it.'\n : pending\n ? card.requirement === 'human'\n ? 'Only you can approve this in the app.'\n : (voiceHint ?? 'Po keeps working while it waits.')\n : (card.reason ??\n (card.state === 'running'\n ? 'Po is running this approved call.'\n : card.state === 'interrupted'\n ? 'Check what happened before retrying. This will not run again automatically.'\n : 'It runs when the session can.'));\n return (\n <View\n style={styles.card}\n accessibilityLabel={card.title}\n accessibilityState={{ busy: busy || card.state === 'running' }}\n >\n <Text\n style={[\n styles.label,\n !pending && styles.decidedLabel,\n (gone || card.state === 'interrupted') && styles.uncertainLabel,\n ]}\n >\n {gone ? 'This session is gone' : approvalStateLabel(card.state)}\n </Text>\n <Text accessibilityRole=\"header\" style={styles.title}>\n {card.title}\n </Text>\n {card.summary ? <Text style={styles.summary}>{card.summary}</Text> : null}\n {card.details && card.details.length > 0 ? (\n <View style={styles.details}>\n {card.details.map(({ label, value }) => (\n <View key={label}>\n <Text style={styles.meta}>{label}</Text>\n <Text selectable style={styles.value}>\n {value}\n </Text>\n </View>\n ))}\n </View>\n ) : null}\n <Text style={styles.meta}>{note}</Text>\n <View style={styles.actions}>\n {pending ? (\n <>\n <Button\n variant={primary ? 'primary' : 'outline'}\n style={styles.action}\n disabled={busy}\n onPress={() => onDecide(card, 'approve')}\n >\n Approve\n </Button>\n <Button variant=\"ghost\" style={styles.action} disabled={busy} onPress={() => onDecide(card, 'deny')}>\n Deny\n </Button>\n </>\n ) : gone ? (\n <Button variant=\"ghost\" style={styles.action} disabled={busy} onPress={() => onDismiss(card)}>\n Dismiss\n </Button>\n ) : null}\n </View>\n </View>\n );\n}\n\nconst styles = StyleSheet.create((theme) => ({\n section: { gap: theme.spacing(2) },\n card: {\n gap: theme.spacing(2),\n padding: theme.spacing(3),\n borderWidth: 1,\n borderColor: theme.colors.border,\n borderRadius: theme.borderRadius.md,\n backgroundColor: theme.colors.panel,\n },\n decidedLabel: { color: theme.colors.green },\n uncertainLabel: { color: theme.colors.dim },\n label: {\n fontFamily: fontOf(theme.fontFamily.sans),\n fontSize: theme.fontSize.sm,\n color: theme.colors.magenta,\n fontWeight: theme.fontWeight.medium,\n },\n title: {\n fontFamily: fontOf(theme.fontFamily.sans),\n fontSize: theme.fontSize.base,\n lineHeight: theme.lineHeight.base,\n color: theme.colors.hi,\n fontWeight: theme.fontWeight.semibold,\n },\n summary: {\n fontFamily: fontOf(theme.fontFamily.sans),\n fontSize: theme.fontSize.base,\n lineHeight: theme.lineHeightRelaxed.base,\n color: theme.colors.text,\n },\n details: { gap: theme.spacing(2) },\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 error: {\n fontFamily: fontOf(theme.fontFamily.sans),\n fontSize: theme.fontSize.sm,\n lineHeight: theme.lineHeightRelaxed.sm,\n color: theme.colors.red,\n },\n value: {\n fontFamily: fontOf(theme.fontFamily.sans),\n fontSize: theme.fontSize.sm,\n lineHeight: theme.lineHeightRelaxed.sm,\n color: theme.colors.hi,\n },\n actions: { flexDirection: 'row', gap: theme.spacing(2) },\n action: { minHeight: theme.spacing(11), flex: 1 },\n}));\n","import type { WebPluginSlotProps } from '@agimon-ai/po-core/native';\nimport { useSyncExternalStore } from 'react';\n\nimport { approvalVoiceHintSlot, type ApprovalVoiceHintSource } from '../../../../../../types/voiceHint';\nimport { ApprovalActivitySection } from '../../_components/ApprovalActivitySection.native';\nimport { answerApproval, useApprovalActivityGroups } from '../../_lib/approvalActivityStore.native';\n\nconst VOICE_HINT = 'Or say “approve” or “deny”.';\nconst NO_SOURCES = (): (() => void) => () => undefined;\n\n/** Whether any installed voice surface can take a spoken answer for this session right now. */\nfunction useVoiceActive(sources: readonly ApprovalVoiceHintSource[], sessionId: string | null): boolean {\n const subscribe =\n sources.length === 0\n ? NO_SOURCES\n : (listener: () => void) => {\n const stops = sources.map((source) => source.subscribe(listener));\n return () => {\n for (const stop of stops) stop();\n };\n };\n const read = () => sources.some((source) => source.isActive(sessionId));\n return useSyncExternalStore(subscribe, read, read);\n}\n\n/** This session's requests and dismissible gone-session groups, each answered through its owner. */\nexport function ApprovalActivityFill({ sessionId, slotData }: WebPluginSlotProps) {\n const groups = useApprovalActivityGroups(sessionId);\n const voice = useVoiceActive(\n slotData(approvalVoiceHintSlot).map((fill) => fill.data),\n sessionId,\n );\n return (\n <>\n {groups.map(({ sessionId: ownerId, activity }) => (\n <ApprovalActivitySection\n key={ownerId ?? ''}\n approvals={activity.approvals}\n busy={activity.busy}\n error={activity.error ?? activity.snapshotError}\n {...(voice && ownerId === sessionId && !activity.approvals.some((card) => card.sessionGone === true)\n ? { voiceHint: VOICE_HINT }\n : {})}\n onDecide={(card, decision) =>\n ownerId &&\n ownerId === sessionId &&\n card.sessionGone !== true &&\n void answerApproval(ownerId, card.id, 'decide', { id: card.id, revision: card.revision, decision })\n }\n onDismiss={(card) =>\n ownerId && void answerApproval(ownerId, card.id, 'dismiss', { id: card.id, revision: card.revision })\n }\n />\n ))}\n </>\n );\n}\n","import { defineFill } from '@agimon-ai/po-core/native';\n\nimport { ApprovalActivityFill } from '../../workspaces/sessions/(frontend)/fill/_components/ApprovalActivityFill.native';\n\nexport default defineFill({ component: ApprovalActivityFill });\n","import { defineWebLifecycle } from '@agimon-ai/po-core/native';\n\nimport { startApprovalRuntime } from '../../workspaces/sessions/(frontend)/_lib/approvalActivityStore.native';\n\nexport default defineWebLifecycle(startApprovalRuntime);\n","import { defineChannelFile } from '@agimon-ai/po-core/native';\n\nimport { approvalActivityChannel } from '../_lib/approvalActivityStore.native';\n\nexport default defineChannelFile(approvalActivityChannel);\n","import type { ToolResultView } from '@agimon-ai/po-core/web';\n\nexport interface ApprovalWithdrawView {\n readonly approvalId: string;\n /** `withdrawn` or `not pending` once the result arrives; undefined while running or failed. */\n readonly outcome: string | undefined;\n /** The tool's own sentence, which names the operation that will not run. */\n readonly message: string;\n}\n\n/** What the approval_withdraw card shows, read from its arguments and result details. */\nexport function approvalWithdrawView(\n args: Readonly<Record<string, unknown>>,\n result: ToolResultView | null,\n output: string,\n): ApprovalWithdrawView {\n const approvalId = typeof args.id === 'string' ? args.id : '';\n const details =\n typeof result?.details === 'object' && result.details !== null ? (result.details as Record<string, unknown>) : {};\n const outcome =\n typeof details.withdrawn === 'boolean' ? (details.withdrawn ? 'withdrawn' : 'not pending') : undefined;\n const message =\n result === null\n ? output\n : result.content\n .flatMap((block) => {\n const record =\n typeof block === 'object' && block !== null ? (block as { type?: unknown; text?: unknown }) : {};\n return record.type === 'text' && typeof record.text === 'string' ? [record.text] : [];\n })\n .join('\\n');\n return { approvalId, outcome, message };\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 type { PoNativeTheme } from '@agimon-ai/po-web-components/nativeTheme';\nimport { Text, View } from 'react-native';\nimport { StyleSheet } from 'react-native-unistyles';\n\nimport { approvalWithdrawView } from '../_lib/approvalWithdrawView';\n\n/** The approval_withdraw tool's timeline item on native, as the web's: id and outcome, then the tool's sentence. */\nexport function ApprovalWithdrawToolMessage({ args, result, output, running, isError }: ToolMessageRenderProps) {\n const view = approvalWithdrawView(args, result, output);\n return (\n <MessageItem tone={toolTone({ running, isError })} expandable>\n {({ expanded }) => (\n <>\n <MessageItemHeader title=\"approval_withdraw\">\n <View testID=\"tool-call-approval_withdraw\" style={styles.summary}>\n <Text numberOfLines={1} ellipsizeMode=\"middle\" style={styles.id}>\n {view.approvalId}\n </Text>\n {view.outcome !== undefined ? (\n <Text numberOfLines={1} style={[styles.sans, styles.detail]}>\n · {view.outcome}\n </Text>\n ) : null}\n </View>\n </MessageItemHeader>\n {!expanded ? null : isError ? (\n <MessageItemBody testID=\"tool-result-approval_withdraw\">\n <Text selectable style={[styles.sans, styles.error]}>\n {view.message}\n </Text>\n </MessageItemBody>\n ) : result === null ? (\n running ? (\n <MessageItemBody testID=\"tool-result-approval_withdraw\">\n <MessageItemStatus tone=\"running\">running</MessageItemStatus>\n </MessageItemBody>\n ) : null\n ) : view.message.length === 0 ? null : (\n <MessageItemBody testID=\"tool-result-approval_withdraw\">\n <Text selectable style={[styles.sans, styles.message]}>\n {view.message}\n </Text>\n </MessageItemBody>\n )}\n </>\n )}\n </MessageItem>\n );\n}\n\nconst styles = StyleSheet.create((theme: PoNativeTheme) => ({\n // Wraps rather than cuts: beside the long tool name a phone row cannot hold the id and the\n // outcome, so the outcome drops to a second line only when it has no room.\n summary: {\n flex: 1,\n flexDirection: 'row',\n flexWrap: 'wrap',\n alignItems: 'center',\n columnGap: theme.spacing(2),\n minWidth: 0,\n },\n sans: {\n fontFamily: fontOf(theme.fontFamily.sans),\n fontSize: theme.fontSize.base,\n lineHeight: theme.lineHeight.base,\n },\n id: {\n // Whole up to the row's width; only an id longer than the row itself cuts, in the middle.\n flexShrink: 1,\n maxWidth: '100%',\n fontFamily: fontOf(theme.fontFamily.mono),\n fontSize: theme.fontSize.sm,\n color: theme.colors.text,\n },\n detail: { flexShrink: 0, color: theme.colors.faint },\n message: { color: theme.colors.text },\n error: { color: theme.colors.red },\n}));\n","import { defineToolRenderer } from '@agimon-ai/po-core/native';\n\nimport { ApprovalWithdrawToolMessage } from './_components/ApprovalWithdrawToolMessage.native';\n\nexport default defineToolRenderer({ message: ApprovalWithdrawToolMessage });\n","// Generated by @agimon-ai/po-build. Do not edit by hand.\nimport { defineNativePlugin, type WebPluginContributions } from '@agimon-ai/po-core/native';\n\nimport activityGroupApproval from '../src/extensions/(frontend)/activity-group/approval.native';\nimport fillApproval from '../src/extensions/(frontend)/fill/Approval.activity.approval.native';\nimport lifecycleStart from '../src/extensions/(frontend)/lifecycle/start.native';\nimport channelApprovalActivity from '../src/extensions/workspaces/sessions/(frontend)/channel/approval-activity.native';\nimport toolApprovalWithdraw from '../src/extensions/workspaces/sessions/(frontend)/tool/approval-withdraw.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: 'approval',\n global: {\n get activityGroups(): WebPluginContributions['activityGroups'] { return [via({ name: 'approval' }, activityGroupApproval)]; },\n get fills(): WebPluginContributions['fills'] { return [via({ slot: 'activity.approval', id: 'approval' }, fillApproval)]; },\n get start(): WebPluginContributions['start'] { return lifecycleStart; },\n },\n session: {\n get channels(): WebPluginContributions['channels'] { return [via({ channel: 'approval_activity' }, channelApprovalActivity)]; },\n get toolRenderers(): WebPluginContributions['toolRenderers'] { return [via({ tools: ['approval_withdraw'] }, toolApprovalWithdraw)]; },\n },\n});\n"],"mappings":";;;;;;;;;AAGA,MAAa,8BAA8B;;AAE3C,MAAa,wBAAwB;;;ACErC,MAAM,eAAe;AAErB,SAAS,UAAU,OAAgB,aAAmD;CACpF,MAAM,SAAS,YAAY,KAAK;CAChC,IAAI,WAAW,KAAA,GAAW,OAAO;CACjC,MAAM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