@agimon-ai/po-spreadsheet 0.0.1-alpha.7 → 0.0.1-alpha.8
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,4 +1,4 @@
|
|
|
1
|
-
import { createApiClient, defineFill, defineNativePlugin, nativeApiTransport, sessionApiAddress } from "@agimon-ai/po-core/native";
|
|
1
|
+
import { createApiClient, defineFill, defineNativePlugin, nativeApiTransport, sessionApiAddress, useT } from "@agimon-ai/po-core/native";
|
|
2
2
|
import { DeviceEventEmitter } from "react-native";
|
|
3
3
|
import { useCallback, useEffect, useState } from "react";
|
|
4
4
|
import { View } from "react-native-unistyles/components/native/View";
|
|
@@ -63,12 +63,13 @@ const MIN_ROW = 44;
|
|
|
63
63
|
* stay on the web for now.
|
|
64
64
|
*/
|
|
65
65
|
function SpreadsheetCanvasViewNative({ view, state = "ready", message, selection, draft, busy = false, onSelectSheet, onSelect, onDraft, onCommit, onAction }) {
|
|
66
|
+
const t = useT();
|
|
66
67
|
if (state === "loading" || view === void 0) return /* @__PURE__ */ jsx(View, {
|
|
67
68
|
style: styles.root,
|
|
68
69
|
children: /* @__PURE__ */ jsx(Text, {
|
|
69
70
|
accessibilityRole: state === "error" ? "alert" : void 0,
|
|
70
71
|
style: [styles.note, state === "error" ? styles.red : null],
|
|
71
|
-
children: state === "error" ? message?.text ?? "Po could not open this workbook." : "Opening workbook…"
|
|
72
|
+
children: state === "error" ? message?.text ?? t("spreadsheet.cannotOpen", "Po could not open this workbook.") : t("spreadsheet.opening", "Opening workbook…")
|
|
72
73
|
})
|
|
73
74
|
});
|
|
74
75
|
const { sheet } = view;
|
|
@@ -91,18 +92,18 @@ function SpreadsheetCanvasViewNative({ view, state = "ready", message, selection
|
|
|
91
92
|
style: styles.bar,
|
|
92
93
|
contentContainerStyle: styles.toolbar,
|
|
93
94
|
children: [
|
|
94
|
-
action("insertRow", "Insert row", lineEdits),
|
|
95
|
-
action("deleteRow", "Delete row", lineEdits),
|
|
96
|
-
action("insertColumn", "Insert column", lineEdits),
|
|
97
|
-
action("deleteColumn", "Delete column", lineEdits),
|
|
98
|
-
action("addSheet", "Add sheet", !busy),
|
|
99
|
-
action("undo", "Undo", !busy && view.revision > 0)
|
|
95
|
+
action("insertRow", t("spreadsheet.insertRow", "Insert row"), lineEdits),
|
|
96
|
+
action("deleteRow", t("spreadsheet.deleteRow", "Delete row"), lineEdits),
|
|
97
|
+
action("insertColumn", t("spreadsheet.insertColumn", "Insert column"), lineEdits),
|
|
98
|
+
action("deleteColumn", t("spreadsheet.deleteColumn", "Delete column"), lineEdits),
|
|
99
|
+
action("addSheet", t("spreadsheet.addSheet", "Add sheet"), !busy),
|
|
100
|
+
action("undo", t("spreadsheet.undo", "Undo"), !busy && view.revision > 0)
|
|
100
101
|
]
|
|
101
102
|
}),
|
|
102
103
|
/* @__PURE__ */ jsx(Text, {
|
|
103
104
|
accessibilityRole: "text",
|
|
104
105
|
style: styles.status,
|
|
105
|
-
children: view.file.state === "saved" ? "Changes save to the file" : view.file.state === "readOnly" ? "Artifact: changes stay here" : "Not saved yet"
|
|
106
|
+
children: view.file.state === "saved" ? t("spreadsheet.saved", "Changes save to the file") : view.file.state === "readOnly" ? t("spreadsheet.artifactLocal", "Artifact: changes stay here") : t("spreadsheet.unsaved", "Not saved yet")
|
|
106
107
|
}),
|
|
107
108
|
/* @__PURE__ */ jsxs(View, {
|
|
108
109
|
style: styles.field,
|
|
@@ -112,8 +113,8 @@ function SpreadsheetCanvasViewNative({ view, state = "ready", message, selection
|
|
|
112
113
|
}), /* @__PURE__ */ jsx(Input, {
|
|
113
114
|
size: "sm",
|
|
114
115
|
style: styles.input,
|
|
115
|
-
accessibilityLabel: "Cell contents",
|
|
116
|
-
placeholder: selection === void 0 ? "Tap a cell" : void 0,
|
|
116
|
+
accessibilityLabel: t("spreadsheet.cellContents", "Cell contents"),
|
|
117
|
+
placeholder: selection === void 0 ? t("spreadsheet.tapCell", "Tap a cell") : void 0,
|
|
117
118
|
disabled: !editable || selection === void 0,
|
|
118
119
|
value: draft ?? active?.input ?? "",
|
|
119
120
|
onFocus: () => {
|
|
@@ -129,30 +130,26 @@ function SpreadsheetCanvasViewNative({ view, state = "ready", message, selection
|
|
|
129
130
|
children: [/* @__PURE__ */ jsx(LockIcon, {
|
|
130
131
|
size: 16,
|
|
131
132
|
color: "dim"
|
|
132
|
-
}), /* @__PURE__ */
|
|
133
|
+
}), /* @__PURE__ */ jsx(Text, {
|
|
133
134
|
style: [styles.note, styles.flex],
|
|
134
|
-
children:
|
|
135
|
+
children: t("spreadsheet.protectedSheet", "{name} is protected in the workbook, so Po keeps it read-only.", { name: sheet.name })
|
|
135
136
|
})]
|
|
136
137
|
}) : null,
|
|
137
138
|
view.file.state === "consent" ? /* @__PURE__ */ jsxs(View, {
|
|
138
139
|
style: styles.banner,
|
|
139
|
-
children: [/* @__PURE__ */
|
|
140
|
+
children: [/* @__PURE__ */ jsx(Text, {
|
|
140
141
|
style: [
|
|
141
142
|
styles.note,
|
|
142
143
|
styles.ask,
|
|
143
144
|
styles.flex
|
|
144
145
|
],
|
|
145
|
-
children:
|
|
146
|
-
"This workbook has parts Po's engine may simplify when it saves (",
|
|
147
|
-
view.file.lossyParts.join(", "),
|
|
148
|
-
"). Your changes stay here until you choose to save."
|
|
149
|
-
]
|
|
146
|
+
children: t("spreadsheet.lossy", "This workbook has parts Po's engine may simplify when it saves ({parts}). Your changes stay here until you choose to save.", { parts: view.file.lossyParts.join(", ") })
|
|
150
147
|
}), /* @__PURE__ */ jsx(Button, {
|
|
151
148
|
size: "sm",
|
|
152
149
|
variant: "outline",
|
|
153
150
|
disabled: busy,
|
|
154
151
|
onPress: () => onAction?.("consent"),
|
|
155
|
-
children: "Save to the file"
|
|
152
|
+
children: t("spreadsheet.save", "Save to the file")
|
|
156
153
|
})]
|
|
157
154
|
}) : null,
|
|
158
155
|
message === void 0 ? null : /* @__PURE__ */ jsx(Text, {
|
|
@@ -197,7 +194,7 @@ function SpreadsheetCanvasViewNative({ view, state = "ready", message, selection
|
|
|
197
194
|
const selected = selection?.row === row && selection.column === column;
|
|
198
195
|
return /* @__PURE__ */ jsx(Pressable, {
|
|
199
196
|
accessibilityRole: "button",
|
|
200
|
-
accessibilityLabel: `${cellName(row, column)} ${cell?.text ?? "empty"}`,
|
|
197
|
+
accessibilityLabel: `${cellName(row, column)} ${cell?.text ?? t("spreadsheet.empty", "empty")}`,
|
|
201
198
|
accessibilityState: { selected },
|
|
202
199
|
onPress: () => onSelect?.({
|
|
203
200
|
row,
|
|
@@ -240,7 +237,7 @@ function SpreadsheetCanvasViewNative({ view, state = "ready", message, selection
|
|
|
240
237
|
style: styles.tab,
|
|
241
238
|
children: [/* @__PURE__ */ jsx(LockIcon, {
|
|
242
239
|
size: 14,
|
|
243
|
-
accessibilityLabel: "protected"
|
|
240
|
+
accessibilityLabel: t("spreadsheet.protected", "protected")
|
|
244
241
|
}), /* @__PURE__ */ jsx(Text, {
|
|
245
242
|
style: styles.headerText,
|
|
246
243
|
children: entry.name
|
|
@@ -388,6 +385,7 @@ const styles = StyleSheet.create((theme) => ({
|
|
|
388
385
|
//#region src/extensions/workspaces/sessions/(frontend)/fill/_components/SpreadsheetCanvasPanel.native.tsx
|
|
389
386
|
/** The phone's `.xlsx` canvas: the same session API and save rules as the web canvas, a cell at a time. */
|
|
390
387
|
function SpreadsheetCanvasPanelNative({ sessionId, source }) {
|
|
388
|
+
const t = useT();
|
|
391
389
|
const { path } = source;
|
|
392
390
|
const [view, setView] = useState();
|
|
393
391
|
const [failed, setFailed] = useState();
|
|
@@ -403,12 +401,16 @@ function SpreadsheetCanvasPanelNative({ sessionId, source }) {
|
|
|
403
401
|
sheet: name
|
|
404
402
|
} });
|
|
405
403
|
if (!result.ok) {
|
|
406
|
-
setFailed(result.error || "Po could not open this workbook.");
|
|
404
|
+
setFailed(result.error || t("spreadsheet.cannotOpen", "Po could not open this workbook."));
|
|
407
405
|
return;
|
|
408
406
|
}
|
|
409
407
|
setFailed(void 0);
|
|
410
408
|
setView(result.data);
|
|
411
|
-
}, [
|
|
409
|
+
}, [
|
|
410
|
+
path,
|
|
411
|
+
sessionId,
|
|
412
|
+
t
|
|
413
|
+
]);
|
|
412
414
|
useEffect(() => {
|
|
413
415
|
load("");
|
|
414
416
|
}, [load]);
|
|
@@ -441,7 +443,7 @@ function SpreadsheetCanvasPanelNative({ sessionId, source }) {
|
|
|
441
443
|
if (result.status === 409) await load(sheet);
|
|
442
444
|
setMessage({
|
|
443
445
|
tone: "red",
|
|
444
|
-
text: result.status === 409 ? "The workbook changed while you were editing. Po reloaded it; try again." : result.status === 0 ? "Po lost the connection to the server. Your change was not made." : result.error || "Po could not make that change."
|
|
446
|
+
text: result.status === 409 ? t("spreadsheet.conflict", "The workbook changed while you were editing. Po reloaded it; try again.") : result.status === 0 ? t("spreadsheet.disconnected", "Po lost the connection to the server. Your change was not made.") : result.error || t("spreadsheet.cannotChange", "Po could not make that change.")
|
|
445
447
|
});
|
|
446
448
|
return false;
|
|
447
449
|
}
|
|
@@ -466,7 +468,7 @@ function SpreadsheetCanvasPanelNative({ sessionId, source }) {
|
|
|
466
468
|
setMessage(void 0);
|
|
467
469
|
} else setMessage({
|
|
468
470
|
tone: "red",
|
|
469
|
-
text: result.error || "Po could not save the workbook."
|
|
471
|
+
text: result.error || t("spreadsheet.cannotSave", "Po could not save the workbook.")
|
|
470
472
|
});
|
|
471
473
|
} finally {
|
|
472
474
|
setBusy(false);
|
|
@@ -474,7 +476,7 @@ function SpreadsheetCanvasPanelNative({ sessionId, source }) {
|
|
|
474
476
|
return;
|
|
475
477
|
}
|
|
476
478
|
if (action === "undo") {
|
|
477
|
-
await change([{ kind: "undo" }], "Undoing…");
|
|
479
|
+
await change([{ kind: "undo" }], t("spreadsheet.undoing", "Undoing…"));
|
|
478
480
|
return;
|
|
479
481
|
}
|
|
480
482
|
if (action === "addSheet") {
|
|
@@ -484,7 +486,7 @@ function SpreadsheetCanvasPanelNative({ sessionId, source }) {
|
|
|
484
486
|
await change([{
|
|
485
487
|
kind: "addSheet",
|
|
486
488
|
name: `Sheet${index}`
|
|
487
|
-
}], "Adding a sheet…");
|
|
489
|
+
}], t("spreadsheet.addingSheet", "Adding a sheet…"));
|
|
488
490
|
return;
|
|
489
491
|
}
|
|
490
492
|
if (selection === void 0) return;
|
|
@@ -498,7 +500,7 @@ function SpreadsheetCanvasPanelNative({ sessionId, source }) {
|
|
|
498
500
|
await change([{
|
|
499
501
|
kind,
|
|
500
502
|
at: (rows ? selection.row : selection.column) + 1
|
|
501
|
-
}], "Updating the sheet…");
|
|
503
|
+
}], t("spreadsheet.updating", "Updating the sheet…"));
|
|
502
504
|
}
|
|
503
505
|
return /* @__PURE__ */ jsx(SpreadsheetCanvasViewNative, {
|
|
504
506
|
view,
|
|
@@ -527,7 +529,7 @@ function SpreadsheetCanvasPanelNative({ sessionId, source }) {
|
|
|
527
529
|
kind: "setCell",
|
|
528
530
|
cell,
|
|
529
531
|
input: draft
|
|
530
|
-
}],
|
|
532
|
+
}], t("spreadsheet.savingCell", "Saving {cell}…", { cell })).then((saved) => {
|
|
531
533
|
if (saved) setDraft(void 0);
|
|
532
534
|
});
|
|
533
535
|
},
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"native.mjs","names":["Button","fontOf","Input","LockIcon","PoNativeTheme","StyleSheet","SpreadsheetView","cellName","columnName","SpreadsheetPhoneAction","SpreadsheetCanvasViewNativeProps","view","state","message","tone","text","selection","row","column","draft","busy","onSelectSheet","name","onSelect","cell","onDraft","onCommit","onAction","action","ROW_HEADER","COLUMN_HEADER","MIN_ROW","SpreadsheetCanvasViewNative","undefined","styles","root","note","red","sheet","editable","protected","active","rows","lineEdits","label","enabled","bar","toolbar","revision","status","file","field","input","banner","flex","ask","lossyParts","join","header","width","height","widths","map","headerText","hi","cells","Math","max","heights","selected","cellText","numeric","bold","tabBar","tabs","sheets","entry","tab","create","theme","backgroundColor","colors","panel","uni__dependencies","flexGrow","flexShrink","borderTopWidth","borderColor","border","gap","spacing","paddingHorizontal","paddingVertical","fontFamily","sans","fontSize","sm","color","dim","flexDirection","alignItems","padding","borderBottomWidth","minWidth","mono","magenta","justifyContent","rail","borderRightWidth","borderWidth","base","textAlign","fontVariant","fontWeight","semibold","useCallback","useEffect","useState","DeviceEventEmitter","api","SPREADSHEET_CHANGED_EVENT","AuthorCanvasPanelProps","SpreadsheetEdit","SpreadsheetView","cellName","SpreadsheetPhoneAction","SpreadsheetCanvasViewNative","Message","tone","text","SpreadsheetCanvasPanelNative","sessionId","source","path","view","setView","failed","setFailed","message","setMessage","busy","setBusy","selection","setSelection","row","column","draft","setDraft","sheet","name","load","result","session","query","ok","error","undefined","data","subscription","addListener","detail","remove","change","edits","doing","Promise","edit","body","revision","status","act","action","consent","kind","names","Set","sheets","map","entry","index","length","has","rows","insertRow","deleteRow","insertColumn","deleteColumn","const","at","cell","input","then","saved","defineFill","DeviceEventEmitter","api","SPREADSHEET_CANVAS_TYPE","SPREADSHEET_CHANGED_EVENT","SPREADSHEET_SUFFIX","AuthorCanvasTypeContribution","SpreadsheetCanvasPanelNative","createSpreadsheetTools","data","version","type","match","path","toLowerCase","endsWith","tools","client","sessionId","session","changed","detail","emit","panel","fillSpreadsheet"],"sources":["../../src/types/apiRoutes.ts","../../generated/client.native.ts","../../src/constants/spreadsheet.ts","../../src/extensions/workspaces/sessions/(frontend)/fill/_lib/spreadsheetRange.ts","../../src/extensions/workspaces/sessions/(frontend)/fill/_components/SpreadsheetCanvasView.native.tsx","../../src/extensions/workspaces/sessions/(frontend)/fill/_components/SpreadsheetCanvasPanel.native.tsx","../../src/extensions/workspaces/sessions/(frontend)/fill/_lib/spreadsheetTools.ts","../../src/extensions/workspaces/sessions/(frontend)/fill/Spreadsheet.author.canvas-type.native.tsx","../../generated/native.ts"],"sourcesContent":["import type { ApiResponseOf, ApiRoutes } from '@agimon-ai/po-core/web';\n\nimport type { SpreadsheetDownload, SpreadsheetView } from './spreadsheetApi';\n\nexport const routes = {\n view: {\n method: 'GET',\n path: '/workbook',\n query: ['path', 'sheet'],\n response: undefined as unknown as ApiResponseOf<SpreadsheetView>,\n },\n /** Body: `SpreadsheetEditRequest`. Answers with the edited sheet. */\n edit: { method: 'POST', path: '/workbook/edit', response: undefined as unknown as ApiResponseOf<SpreadsheetView> },\n /** Body: `{ path, sheet }`. The person agreed to save a workbook whose file state is `consent`. */\n consent: {\n method: 'POST',\n path: '/workbook/consent',\n response: undefined as unknown as ApiResponseOf<SpreadsheetView>,\n },\n download: {\n method: 'GET',\n path: '/workbook/download',\n query: ['path'],\n response: undefined as unknown as ApiResponseOf<SpreadsheetDownload>,\n },\n} as const satisfies ApiRoutes;\n","// Generated by @agimon-ai/po-build. Do not edit by hand.\nimport { createApiClient, nativeApiTransport, sessionApiAddress } from '@agimon-ai/po-core/native';\n\nimport { routes } from '../src/types/apiRoutes';\n\n/** Scopes the tree mounts 'spreadsheet' at. */\nexport const apiScopes = ['session'] as const;\n\nexport const api = createApiClient(routes, {\n scopes: apiScopes,\n basePath: 'spreadsheet',\n transport: nativeApiTransport,\n sessionAddress: sessionApiAddress,\n});\n","/** Window event an agent tool fires after it changes a workbook, so an open canvas reloads. Detail: `{ sessionId, path }`. */\nexport const SPREADSHEET_CHANGED_EVENT = 'po-spreadsheet:changed';\n\n/** The canvas type id, shared by the server registration and the browser fill. */\nexport const SPREADSHEET_CANVAS_TYPE = 'spreadsheet';\n\n/** Lowercase path suffix both sides match. CSV stays with Author's built-in view. */\nexport const SPREADSHEET_SUFFIX = '.xlsx';\n","/** A zero-based block of cells. */\nexport interface SpreadsheetRange {\n row: number;\n column: number;\n rows: number;\n columns: number;\n}\n\nexport const columnName = (index: number): string =>\n (index >= 26 ? columnName(Math.floor(index / 26) - 1) : '') + String.fromCodePoint(65 + (index % 26));\n\nexport const cellName = (row: number, column: number): string => `${columnName(column)}${row + 1}`;\n\n/** `B5`, or `B5:D6` for a block. */\nexport function rangeName({ row, column, rows, columns }: SpreadsheetRange): string {\n const start = cellName(row, column);\n return rows === 1 && columns === 1 ? start : `${start}:${cellName(row + rows - 1, column + columns - 1)}`;\n}\n\nfunction parseCell(reference: string): { row: number; column: number } | undefined {\n const match = /^([A-Z]{1,3})([1-9]\\d{0,6})$/.exec(reference);\n if (match === null) return undefined;\n let column = 0;\n for (const letter of match[1]!) column = column * 26 + letter.charCodeAt(0) - 64;\n return { row: Number(match[2]) - 1, column: column - 1 };\n}\n\n/** The block an A1 reference names, in either corner order; undefined when it is not one. */\nexport function parseRange(reference: string): SpreadsheetRange | undefined {\n const [first, second = first] = reference.toUpperCase().split(':');\n const a = parseCell(first ?? '');\n const b = parseCell(second ?? '');\n if (a === undefined || b === undefined) return undefined;\n return {\n row: Math.min(a.row, b.row),\n column: Math.min(a.column, b.column),\n rows: Math.abs(a.row - b.row) + 1,\n columns: Math.abs(a.column - b.column) + 1,\n };\n}\n\n/** The block between two cells a drag started and ended on. */\nexport function spanning(a: { row: number; column: number }, b: { row: number; column: number }): SpreadsheetRange {\n return {\n row: Math.min(a.row, b.row),\n column: Math.min(a.column, b.column),\n rows: Math.abs(a.row - b.row) + 1,\n columns: Math.abs(a.column - b.column) + 1,\n };\n}\n\n/** The corner of `selection` opposite `origin`, the cell a keyboard extension moves. */\nexport function farCorner(origin: { row: number; column: number }, selection: SpreadsheetRange) {\n return {\n row: origin.row === selection.row ? selection.row + selection.rows - 1 : selection.row,\n column: origin.column === selection.column ? selection.column + selection.columns - 1 : selection.column,\n };\n}\n\n/** Tab-separated text of a block, rows on lines, as other spreadsheets copy it. */\nexport function blockText(\n rows: readonly (readonly ({ text: string } | null | undefined)[])[],\n { row, column, rows: height, columns }: SpreadsheetRange,\n): string {\n return rows\n .slice(row, row + height)\n .map((cells) => Array.from({ length: columns }, (_, index) => cells[column + index]?.text ?? '').join('\\t'))\n .join('\\n');\n}\n\n/** Cells that pasting tab-separated `text` at `at` sets, left to right then down. */\nexport function pastedCells(text: string, at: { row: number; column: number }): { cell: string; input: string }[] {\n const lines = text.replace(/\\r\\n?/g, '\\n').split('\\n');\n if (lines.at(-1) === '') lines.pop();\n return lines.flatMap((line, row) =>\n line.split('\\t').map((input, column) => ({ cell: cellName(at.row + row, at.column + column), input })),\n );\n}\n","import { Button, fontOf, Input, LockIcon } from '@agimon-ai/po-native-components';\nimport type { PoNativeTheme } from '@agimon-ai/po-web-components/nativeTheme';\nimport { Pressable, ScrollView, Text, View } from 'react-native';\nimport { StyleSheet } from 'react-native-unistyles';\n\nimport type { SpreadsheetView } from '../../../../../../types/spreadsheetApi';\nimport type {} from '../../../../../../types/unistyles.native';\nimport { cellName, columnName } from '../_lib/spreadsheetRange';\n\nexport type SpreadsheetPhoneAction =\n | 'insertRow'\n | 'deleteRow'\n | 'insertColumn'\n | 'deleteColumn'\n | 'addSheet'\n | 'undo'\n | 'consent';\n\nexport interface SpreadsheetCanvasViewNativeProps {\n view?: SpreadsheetView;\n /** Set while the workbook opens for the first time, or when it could not open. */\n state?: 'ready' | 'loading' | 'error';\n message?: { tone: 'dim' | 'red'; text: string };\n /** The one selected cell; the phone edits a cell at a time. */\n selection?: { row: number; column: number };\n /** The text in the cell field while the selected cell is being edited. */\n draft?: string;\n busy?: boolean;\n onSelectSheet?: (name: string) => void;\n onSelect?: (cell: { row: number; column: number }) => void;\n onDraft?: (text: string | undefined) => void;\n onCommit?: () => void;\n onAction?: (action: SpreadsheetPhoneAction) => void;\n}\n\nconst ROW_HEADER = 44;\nconst COLUMN_HEADER = 28;\n/** Tap targets stay at least this tall even where the workbook's rows are shorter. */\nconst MIN_ROW = 44;\n\n/**\n * The phone's spreadsheet canvas: the web canvas's toolbar, cell field, banners and sheet tabs on one\n * column. Tap a cell to select it and edit it in the cell field. Resizing and Region/Comment marks\n * stay on the web for now.\n */\nexport function SpreadsheetCanvasViewNative({\n view,\n state = 'ready',\n message,\n selection,\n draft,\n busy = false,\n onSelectSheet,\n onSelect,\n onDraft,\n onCommit,\n onAction,\n}: SpreadsheetCanvasViewNativeProps) {\n if (state === 'loading' || view === undefined)\n return (\n <View style={styles.root}>\n <Text\n accessibilityRole={state === 'error' ? 'alert' : undefined}\n style={[styles.note, state === 'error' ? styles.red : null]}\n >\n {state === 'error' ? (message?.text ?? 'Po could not open this workbook.') : 'Opening workbook…'}\n </Text>\n </View>\n );\n\n const { sheet } = view;\n const editable = !sheet.protected && !busy;\n const active = selection === undefined ? undefined : sheet.rows[selection.row]?.[selection.column];\n const lineEdits = editable && selection !== undefined;\n const action = (name: SpreadsheetPhoneAction, label: string, enabled: boolean) => (\n <Button key={name} size=\"sm\" variant=\"ghost\" disabled={!enabled} onPress={() => onAction?.(name)}>\n {label}\n </Button>\n );\n\n return (\n <View style={styles.root}>\n <ScrollView\n horizontal\n showsHorizontalScrollIndicator={false}\n style={styles.bar}\n contentContainerStyle={styles.toolbar}\n >\n {action('insertRow', 'Insert row', lineEdits)}\n {action('deleteRow', 'Delete row', lineEdits)}\n {action('insertColumn', 'Insert column', lineEdits)}\n {action('deleteColumn', 'Delete column', lineEdits)}\n {action('addSheet', 'Add sheet', !busy)}\n {action('undo', 'Undo', !busy && view.revision > 0)}\n </ScrollView>\n <Text accessibilityRole=\"text\" style={styles.status}>\n {view.file.state === 'saved'\n ? 'Changes save to the file'\n : view.file.state === 'readOnly'\n ? 'Artifact: changes stay here'\n : 'Not saved yet'}\n </Text>\n <View style={styles.field}>\n <Text style={styles.cellName}>{selection === undefined ? '' : cellName(selection.row, selection.column)}</Text>\n <Input\n size=\"sm\"\n style={styles.input}\n accessibilityLabel=\"Cell contents\"\n placeholder={selection === undefined ? 'Tap a cell' : undefined}\n disabled={!editable || selection === undefined}\n value={draft ?? active?.input ?? ''}\n onFocus={() => {\n if (draft === undefined) onDraft?.(active?.input ?? '');\n }}\n onChangeText={(text) => onDraft?.(text)}\n onSubmitEditing={() => onCommit?.()}\n returnKeyType=\"done\"\n />\n </View>\n {sheet.protected ? (\n <View style={styles.banner}>\n <LockIcon size={16} color=\"dim\" />\n <Text style={[styles.note, styles.flex]}>\n {sheet.name} is protected in the workbook, so Po keeps it read-only.\n </Text>\n </View>\n ) : null}\n {view.file.state === 'consent' ? (\n <View style={styles.banner}>\n <Text style={[styles.note, styles.ask, styles.flex]}>\n This workbook has parts Po's engine may simplify when it saves ({view.file.lossyParts.join(', ')}). Your\n changes stay here until you choose to save.\n </Text>\n <Button size=\"sm\" variant=\"outline\" disabled={busy} onPress={() => onAction?.('consent')}>\n Save to the file\n </Button>\n </View>\n ) : null}\n {message === undefined ? null : (\n <Text\n accessibilityRole={message.tone === 'red' ? 'alert' : undefined}\n accessibilityLiveRegion=\"polite\"\n style={[styles.note, message.tone === 'red' ? styles.red : null]}\n >\n {message.text}\n </Text>\n )}\n <ScrollView horizontal style={styles.flex}>\n <ScrollView>\n <View style={styles.row}>\n <View style={[styles.header, { width: ROW_HEADER, height: COLUMN_HEADER }]} />\n {sheet.widths.map((width, column) => (\n <View key={column} style={[styles.header, { width, height: COLUMN_HEADER }]}>\n <Text style={[styles.headerText, selection?.column === column ? styles.hi : null]}>\n {columnName(column)}\n </Text>\n </View>\n ))}\n </View>\n {sheet.rows.map((cells, row) => {\n const height = Math.max(MIN_ROW, sheet.heights[row] ?? 0);\n return (\n <View key={row} style={styles.row}>\n <View style={[styles.header, { width: ROW_HEADER, height }]}>\n <Text style={[styles.headerText, selection?.row === row ? styles.hi : null]}>{row + 1}</Text>\n </View>\n {sheet.widths.map((width, column) => {\n const cell = cells[column];\n const selected = selection?.row === row && selection.column === column;\n return (\n <Pressable\n key={column}\n accessibilityRole=\"button\"\n accessibilityLabel={`${cellName(row, column)} ${cell?.text ?? 'empty'}`}\n accessibilityState={{ selected }}\n onPress={() => onSelect?.({ row, column })}\n style={[styles.cell, { width, height }, selected ? styles.selected : null]}\n >\n <Text\n numberOfLines={1}\n style={[\n styles.cellText,\n cell?.numeric ? styles.numeric : null,\n cell?.bold ? styles.bold : null,\n ]}\n >\n {cell?.text ?? ''}\n </Text>\n </Pressable>\n );\n })}\n </View>\n );\n })}\n </ScrollView>\n </ScrollView>\n <ScrollView\n horizontal\n showsHorizontalScrollIndicator={false}\n style={[styles.bar, styles.tabBar]}\n contentContainerStyle={styles.tabs}\n >\n {view.sheets.map((entry) => (\n <Button\n key={entry.name}\n size=\"sm\"\n variant={entry.name === sheet.name ? 'secondary' : 'ghost'}\n accessibilityState={{ selected: entry.name === sheet.name }}\n disabled={busy}\n onPress={() => onSelectSheet?.(entry.name)}\n >\n {entry.protected ? (\n <View style={styles.tab}>\n <LockIcon size={14} accessibilityLabel=\"protected\" />\n <Text style={styles.headerText}>{entry.name}</Text>\n </View>\n ) : (\n entry.name\n )}\n </Button>\n ))}\n </ScrollView>\n </View>\n );\n}\n\nconst styles = StyleSheet.create((theme: PoNativeTheme) => ({\n root: { flex: 1, backgroundColor: theme.colors.panel },\n flex: { flex: 1 },\n // A horizontal ScrollView grows to fill a column unless told not to.\n bar: { flexGrow: 0, flexShrink: 0 },\n tabBar: { borderTopWidth: 1, borderColor: theme.colors.border },\n toolbar: {\n gap: theme.spacing(1),\n paddingHorizontal: theme.spacing(2),\n // A 28pt sm button plus this padding keeps its 44pt tap target inside the bar.\n paddingVertical: theme.spacing(2),\n },\n status: {\n paddingHorizontal: theme.spacing(3),\n fontFamily: fontOf(theme.fontFamily.sans),\n fontSize: theme.fontSize.sm,\n color: theme.colors.dim,\n },\n field: {\n flexDirection: 'row',\n alignItems: 'center',\n gap: theme.spacing(2),\n padding: theme.spacing(2),\n borderBottomWidth: 1,\n borderColor: theme.colors.border,\n },\n cellName: {\n minWidth: 48,\n fontFamily: fontOf(theme.fontFamily.mono),\n fontSize: theme.fontSize.sm,\n color: theme.colors.text,\n },\n input: { flex: 1 },\n banner: {\n flexDirection: 'row',\n alignItems: 'center',\n gap: theme.spacing(2),\n paddingHorizontal: theme.spacing(3),\n paddingVertical: theme.spacing(2),\n borderBottomWidth: 1,\n borderColor: theme.colors.border,\n },\n note: {\n padding: theme.spacing(3),\n fontFamily: fontOf(theme.fontFamily.sans),\n fontSize: theme.fontSize.sm,\n color: theme.colors.dim,\n },\n ask: { padding: 0, color: theme.colors.magenta },\n red: { color: theme.colors.red },\n row: { flexDirection: 'row' },\n header: {\n alignItems: 'center',\n justifyContent: 'center',\n backgroundColor: theme.colors.rail,\n borderRightWidth: 1,\n borderBottomWidth: 1,\n borderColor: theme.colors.border,\n },\n headerText: { fontFamily: fontOf(theme.fontFamily.sans), fontSize: theme.fontSize.sm, color: theme.colors.dim },\n hi: { color: theme.colors.hi },\n cell: {\n justifyContent: 'center',\n paddingHorizontal: theme.spacing(2),\n borderRightWidth: 1,\n borderBottomWidth: 1,\n borderColor: theme.colors['border-soft'],\n },\n selected: { borderWidth: 2, borderColor: theme.colors.selected },\n cellText: { fontFamily: fontOf(theme.fontFamily.sans), fontSize: theme.fontSize.base, color: theme.colors.text },\n numeric: { textAlign: 'right', fontVariant: ['tabular-nums'] },\n bold: { fontWeight: theme.fontWeight.semibold, color: theme.colors.hi },\n tab: { flexDirection: 'row', alignItems: 'center', gap: theme.spacing(1) },\n tabs: {\n gap: theme.spacing(1),\n paddingHorizontal: theme.spacing(2),\n paddingVertical: theme.spacing(2),\n },\n}));\n","import { useCallback, useEffect, useState } from 'react';\nimport { DeviceEventEmitter } from 'react-native';\n\nimport { api } from '../../../../../../../generated/client.native';\nimport { SPREADSHEET_CHANGED_EVENT } from '../../../../../../constants/spreadsheet';\nimport type { AuthorCanvasPanelProps } from '../../../../../../types/authorCanvas';\nimport type { SpreadsheetEdit, SpreadsheetView } from '../../../../../../types/spreadsheetApi';\nimport { cellName } from '../_lib/spreadsheetRange';\nimport { type SpreadsheetPhoneAction, SpreadsheetCanvasViewNative } from './SpreadsheetCanvasView.native';\n\ntype Message = { tone: 'dim' | 'red'; text: string };\n\n/** The phone's `.xlsx` canvas: the same session API and save rules as the web canvas, a cell at a time. */\nexport function SpreadsheetCanvasPanelNative({ sessionId, source }: AuthorCanvasPanelProps) {\n const { path } = source;\n const [view, setView] = useState<SpreadsheetView>();\n const [failed, setFailed] = useState<string>();\n const [message, setMessage] = useState<Message>();\n const [busy, setBusy] = useState(false);\n const [selection, setSelection] = useState<{ row: number; column: number }>();\n const [draft, setDraft] = useState<string>();\n const sheet = view?.sheet.name ?? '';\n\n const load = useCallback(\n async (name: string) => {\n if (sessionId === null) return;\n const result = await api.session(sessionId).view({ query: { path, sheet: name } });\n if (!result.ok) {\n setFailed(result.error || 'Po could not open this workbook.');\n return;\n }\n setFailed(undefined);\n setView(result.data);\n },\n [path, sessionId],\n );\n\n useEffect(() => {\n void load('');\n }, [load]);\n\n // An agent tool changed this workbook: show its result.\n useEffect(() => {\n const subscription = DeviceEventEmitter.addListener(\n SPREADSHEET_CHANGED_EVENT,\n (detail: { sessionId?: string; path?: string }) => {\n if (detail.sessionId === sessionId && detail.path === path) void load(sheet);\n },\n );\n return () => subscription.remove();\n }, [load, path, sessionId, sheet]);\n\n async function change(edits: SpreadsheetEdit[], doing: string): Promise<boolean> {\n if (sessionId === null || view === undefined) return false;\n setBusy(true);\n setMessage({ tone: 'dim', text: doing });\n try {\n const result = await api.session(sessionId).edit({ body: { path, sheet, revision: view.revision, edits } });\n if (!result.ok) {\n // Someone else changed the workbook first: show theirs rather than overwrite it.\n if (result.status === 409) await load(sheet);\n setMessage({\n tone: 'red',\n text:\n result.status === 409\n ? 'The workbook changed while you were editing. Po reloaded it; try again.'\n : result.status === 0\n ? 'Po lost the connection to the server. Your change was not made.'\n : result.error || 'Po could not make that change.',\n });\n return false;\n }\n setView(result.data);\n setMessage(undefined);\n return true;\n } finally {\n setBusy(false);\n }\n }\n\n async function act(action: SpreadsheetPhoneAction) {\n if (view === undefined || sessionId === null) return;\n if (action === 'consent') {\n setBusy(true);\n try {\n const result = await api.session(sessionId).consent({ body: { path, sheet } });\n if (result.ok) {\n setView(result.data);\n setMessage(undefined);\n } else setMessage({ tone: 'red', text: result.error || 'Po could not save the workbook.' });\n } finally {\n setBusy(false);\n }\n return;\n }\n if (action === 'undo') {\n await change([{ kind: 'undo' }], 'Undoing…');\n return;\n }\n if (action === 'addSheet') {\n const names = new Set(view.sheets.map((entry) => entry.name));\n let index = view.sheets.length + 1;\n while (names.has(`Sheet${index}`)) index += 1;\n await change([{ kind: 'addSheet', name: `Sheet${index}` }], 'Adding a sheet…');\n return;\n }\n if (selection === undefined) return;\n const rows = action === 'insertRow' || action === 'deleteRow';\n const kind = (\n {\n insertRow: 'insertRows',\n deleteRow: 'deleteRows',\n insertColumn: 'insertColumns',\n deleteColumn: 'deleteColumns',\n } as const\n )[action];\n await change([{ kind, at: (rows ? selection.row : selection.column) + 1 }], 'Updating the sheet…');\n }\n\n return (\n <SpreadsheetCanvasViewNative\n view={view}\n state={failed !== undefined ? 'error' : view === undefined ? 'loading' : 'ready'}\n message={failed !== undefined ? { tone: 'red', text: failed } : message}\n selection={selection}\n draft={draft}\n busy={busy}\n onSelectSheet={(name) => {\n setSelection(undefined);\n setDraft(undefined);\n void load(name);\n }}\n onSelect={(cell) => {\n setDraft(undefined);\n setSelection(cell);\n }}\n onDraft={setDraft}\n onCommit={() => {\n if (selection === undefined || draft === undefined) return;\n const cell = cellName(selection.row, selection.column);\n void change([{ kind: 'setCell', cell, input: draft }], `Saving ${cell}…`).then((saved) => {\n if (saved) setDraft(undefined);\n });\n }}\n onAction={(action) => void act(action)}\n />\n );\n}\n","import type { AuthorCanvasTypeTarget, AuthorCanvasTypeTool } from '../../../../../../types/authorCanvas';\nimport type {\n SpreadsheetEdit,\n SpreadsheetSessionClient,\n SpreadsheetView,\n} from '../../../../../../types/spreadsheetApi';\nimport { cellName } from './spreadsheetRange';\n\n/** What the tools need from the web or phone host: its session client, and a way to tell an open canvas to reload. */\nexport interface SpreadsheetToolHost {\n client(sessionId: string): SpreadsheetSessionClient;\n changed(target: AuthorCanvasTypeTarget): void;\n}\n\nconst MAX_CELLS = 2000;\n\n/** What the agent reads: the sheet's non-empty cells in A1 terms, and the revision to quote back. */\nfunction summary(view: SpreadsheetView) {\n const cells = view.sheet.rows.flatMap((row, r) =>\n row.flatMap((cell, c) => (cell === null ? [] : [{ cell: cellName(r, c), text: cell.text, input: cell.input }])),\n );\n return {\n revision: view.revision,\n sheets: view.sheets,\n sheet: view.sheet.name,\n protected: view.sheet.protected,\n // saved: edits are in the file. consent: only the person can agree to save. readOnly: an artifact.\n file: view.file,\n cells: cells.slice(0, MAX_CELLS),\n ...(cells.length > MAX_CELLS ? { truncated: true } : {}),\n };\n}\n\nfunction record(input: unknown): Record<string, unknown> {\n if (typeof input !== 'object' || input === null || Array.isArray(input))\n throw new Error('INVALID_INPUT: pass an object.');\n return input as Record<string, unknown>;\n}\n\nfunction text(input: Record<string, unknown>, field: string): string {\n const value = input[field];\n if (typeof value !== 'string' || value === '') throw new Error(`INVALID_INPUT: ${field} must be a non-empty string.`);\n return value;\n}\n\nfunction revision(input: Record<string, unknown>): number {\n const value = input.revision;\n if (!Number.isInteger(value)) throw new Error('INVALID_INPUT: pass the revision spreadsheet_read returned.');\n return value as number;\n}\n\nasync function edit(\n host: SpreadsheetToolHost,\n target: AuthorCanvasTypeTarget,\n signal: AbortSignal,\n body: { sheet: string; revision: number; edits: SpreadsheetEdit[] },\n) {\n const result = await host.client(target.sessionId).edit({ body: { path: target.path, ...body }, signal });\n if (!result.ok) throw new Error(result.error || `Spreadsheet edit failed with status ${result.status}.`);\n host.changed(target);\n return summary(result.data);\n}\n\nconst REVISION = { type: 'integer', description: 'The revision spreadsheet_read returned.' } as const;\nconst SHEET = { type: 'string', description: 'Sheet name, as spreadsheet_read lists it.' } as const;\nconst LINES = {\n type: 'object',\n properties: {\n sheet: SHEET,\n revision: REVISION,\n at: { type: 'integer', minimum: 1, description: '1-based first row or column (A is 1).' },\n count: { type: 'integer', minimum: 1, maximum: 1000 },\n },\n required: ['sheet', 'revision', 'at'],\n} as const;\n\nfunction lineTool(\n host: SpreadsheetToolHost,\n name: string,\n kind: 'insertRows' | 'deleteRows' | 'insertColumns' | 'deleteColumns',\n description: string,\n): AuthorCanvasTypeTool {\n return {\n name,\n description,\n inputSchema: LINES,\n async execute(input, signal, target) {\n const value = record(input);\n const at = value.at;\n const count = value.count ?? 1;\n if (!Number.isInteger(at) || !Number.isInteger(count))\n throw new Error('INVALID_INPUT: at and count must be integers.');\n return edit(host, target, signal, {\n sheet: text(value, 'sheet'),\n revision: revision(value),\n edits: [{ kind, at: at as number, count: count as number }],\n });\n },\n };\n}\n\n/** The agent's canvas tools, the same on the web and the phone. */\nexport const createSpreadsheetTools = (host: SpreadsheetToolHost): readonly AuthorCanvasTypeTool[] => [\n {\n name: 'spreadsheet_read',\n label: 'Read sheet',\n description:\n 'Read one sheet of the open workbook: its non-empty cells with displayed text and input (formulas start with =), every sheet name, whether the sheet is protected, and the revision to pass to edits.',\n inputSchema: { type: 'object', properties: { sheet: { ...SHEET, description: 'Defaults to the first sheet.' } } },\n async execute(input, signal, { sessionId, path }) {\n const value = record(input ?? {});\n const sheet = value.sheet === undefined ? '' : text(value, 'sheet');\n const result = await host.client(sessionId).view({ query: { path, sheet }, signal });\n if (!result.ok) throw new Error(result.error || `Spreadsheet read failed with status ${result.status}.`);\n return summary(result.data);\n },\n },\n {\n name: 'spreadsheet_set_cells',\n label: 'Set cells',\n description:\n 'Enter values or formulas into cells of one unprotected sheet, up to 500 at once, in order. Formulas start with = and recalculate. An empty input clears the cell.',\n inputSchema: {\n type: 'object',\n properties: {\n sheet: SHEET,\n revision: REVISION,\n cells: {\n type: 'array',\n minItems: 1,\n maxItems: 500,\n items: {\n type: 'object',\n properties: { cell: { type: 'string', description: 'A1 address such as B5.' }, input: { type: 'string' } },\n required: ['cell', 'input'],\n },\n },\n },\n required: ['sheet', 'revision', 'cells'],\n },\n async execute(input, signal, target) {\n const value = record(input);\n const cells = value.cells;\n if (!Array.isArray(cells) || cells.length === 0 || cells.length > 500)\n throw new Error('INVALID_INPUT: cells must list 1 to 500 cells.');\n const edits = cells.map((entry): SpreadsheetEdit => {\n const cell = record(entry);\n if (typeof cell.input !== 'string') throw new Error('INVALID_INPUT: every cell needs a string input.');\n return { kind: 'setCell', cell: text(cell, 'cell').toUpperCase(), input: cell.input };\n });\n return edit(host, target, signal, { sheet: text(value, 'sheet'), revision: revision(value), edits });\n },\n },\n lineTool(host, 'spreadsheet_insert_rows', 'insertRows', 'Insert empty rows before row `at` of an unprotected sheet.'),\n lineTool(host, 'spreadsheet_delete_rows', 'deleteRows', 'Delete rows starting at row `at` of an unprotected sheet.'),\n lineTool(\n host,\n 'spreadsheet_insert_columns',\n 'insertColumns',\n 'Insert empty columns before column `at` (A is 1) of an unprotected sheet.',\n ),\n lineTool(\n host,\n 'spreadsheet_delete_columns',\n 'deleteColumns',\n 'Delete columns starting at column `at` (A is 1) of an unprotected sheet.',\n ),\n {\n name: 'spreadsheet_set_size',\n label: 'Resize',\n description:\n 'Set the pixel width of columns (up to 1800) or height of rows (up to 546) of an unprotected sheet; 0 hides them.',\n inputSchema: {\n type: 'object',\n properties: {\n ...LINES.properties,\n line: { type: 'string', enum: ['column', 'row'] },\n size: { type: 'number', minimum: 0, maximum: 1800 },\n },\n required: ['sheet', 'revision', 'at', 'line', 'size'],\n },\n async execute(input, signal, target) {\n const value = record(input);\n const { at, size, line } = value;\n const count = value.count ?? 1;\n if (!Number.isInteger(at) || !Number.isInteger(count) || typeof size !== 'number')\n throw new Error('INVALID_INPUT: at and count must be integers and size a number.');\n if (line !== 'column' && line !== 'row') throw new Error('INVALID_INPUT: line must be column or row.');\n return edit(host, target, signal, {\n sheet: text(value, 'sheet'),\n revision: revision(value),\n edits: [\n { kind: line === 'column' ? 'columnWidth' : 'rowHeight', at: at as number, count: count as number, size },\n ],\n });\n },\n },\n {\n name: 'spreadsheet_add_sheet',\n label: 'Add sheet',\n description: 'Add an empty sheet after the last one.',\n inputSchema: {\n type: 'object',\n properties: {\n revision: REVISION,\n name: { type: 'string', description: 'Up to 31 characters, no [ ] : * ? / \\\\.' },\n },\n required: ['revision', 'name'],\n },\n async execute(input, signal, target) {\n const value = record(input);\n const name = text(value, 'name');\n return edit(host, target, signal, {\n sheet: name,\n revision: revision(value),\n edits: [{ kind: 'addSheet', name }],\n });\n },\n },\n {\n name: 'spreadsheet_undo',\n label: 'Undo',\n description: 'Undo the last change to the workbook, whoever made it.',\n inputSchema: { type: 'object', properties: { revision: REVISION, sheet: SHEET }, required: ['revision'] },\n async execute(input, signal, target) {\n const value = record(input);\n const sheet = value.sheet === undefined ? '' : text(value, 'sheet');\n return edit(host, target, signal, { sheet, revision: revision(value), edits: [{ kind: 'undo' }] });\n },\n },\n];\n","import { defineFill } from '@agimon-ai/po-core/native';\nimport { DeviceEventEmitter } from 'react-native';\n\nimport { api } from '../../../../../../generated/client.native';\nimport {\n SPREADSHEET_CANVAS_TYPE,\n SPREADSHEET_CHANGED_EVENT,\n SPREADSHEET_SUFFIX,\n} from '../../../../../constants/spreadsheet';\nimport type { AuthorCanvasTypeContribution } from '../../../../../types/authorCanvas';\nimport { SpreadsheetCanvasPanelNative } from './_components/SpreadsheetCanvasPanel.native';\nimport { createSpreadsheetTools } from './_lib/spreadsheetTools';\n\n/** Fills slot `author.canvas-type` on the phone: the same workbook canvas and agent tools as the web. */\nexport default defineFill({\n data: {\n version: 1,\n type: SPREADSHEET_CANVAS_TYPE,\n match: (path: string) => path.toLowerCase().endsWith(SPREADSHEET_SUFFIX),\n tools: createSpreadsheetTools({\n client: (sessionId) => api.session(sessionId),\n changed: (detail) => DeviceEventEmitter.emit(SPREADSHEET_CHANGED_EVENT, detail),\n }),\n panel: SpreadsheetCanvasPanelNative,\n } satisfies AuthorCanvasTypeContribution,\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 fillSpreadsheet from '../src/extensions/workspaces/sessions/(frontend)/fill/Spreadsheet.author.canvas-type.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: 'spreadsheet',\n packageName: '@agimon-ai/po-spreadsheet',\n session: {\n get fills(): WebPluginContributions['fills'] { return [via({ slot: 'author.canvas-type', id: 'spreadsheet' }, fillSpreadsheet)]; },\n },\n});\n"],"mappings":";;;;;;;;;;ACQA,MAAa,MAAM,gBAAgB;CDHjC,MAAM;EACJ,QAAQ;EACR,MAAM;EACN,OAAO,CAAC,QAAQ,OAAO;EACvB,UAAU,KAAA;CACZ;;CAEA,MAAM;EAAE,QAAQ;EAAQ,MAAM;EAAkB,UAAU,KAAA;CAAuD;;CAEjH,SAAS;EACP,QAAQ;EACR,MAAM;EACN,UAAU,KAAA;CACZ;CACA,UAAU;EACR,QAAQ;EACR,MAAM;EACN,OAAO,CAAC,MAAM;EACd,UAAU,KAAA;CACZ;AChBiC,GAAQ;CACzC,QAAQ,CAHgB,SAGhB;CACR,UAAU;CACV,WAAW;CACX,gBAAgB;AAClB,CAAC;;;;ACZD,MAAa,4BAA4B;;AAGzC,MAAa,0BAA0B;;AAGvC,MAAa,qBAAqB;;;ACClC,MAAa,cAAc,WACxB,SAAS,KAAK,WAAW,KAAK,MAAM,QAAQ,EAAE,IAAI,CAAC,IAAI,MAAM,OAAO,cAAc,KAAM,QAAQ,EAAG;AAEtG,MAAa,YAAY,KAAa,WAA2B,GAAG,WAAW,MAAM,IAAI,MAAM;;;ACwB/F,MAAM6B,aAAa;AACnB,MAAMC,gBAAgB;;AAEtB,MAAMC,UAAU;;;;;;AAOhB,SAAgBC,4BAA4B,EAC1CrB,MACAC,QAAQ,SACRC,SACAG,WACAG,OACAC,OAAO,OACPC,eACAE,UACAE,SACAC,UACAC,YACmC;CACnC,IAAIf,UAAU,aAAaD,SAASsB,KAAAA,GAClC,OACE,oBAAC,MAAD;EAAM,OAAOC,OAAOC;EAClB,UAAA,oBAAC,MAAD;GACE,mBAAmBvB,UAAU,UAAU,UAAUqB,KAAAA;GACjD,OAAO,CAACC,OAAOE,MAAMxB,UAAU,UAAUsB,OAAO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AK;IACxB,OAAO,CAAC;KAAE,MAAM;KAAY;IAAK,CAAC;GACpC,CAAC;EACH;CACF;CACA;EACE,MAAM;EACN,OAAO;EACP,aAAa;EACb,aAAa;GAAE,MAAM;GAAU,YAAY;IAAE,UAAU;IAAU,OAAO;GAAM;GAAG,UAAU,CAAC,UAAU;EAAE;EACxG,MAAM,QAAQ,OAAO,QAAQ,QAAQ;GACnC,MAAM,QAAQ,OAAO,KAAK;GAE1B,OAAO,KAAK,MAAM,QAAQ,QAAQ;IAAE,OADtB,MAAM,UAAU,KAAA,IAAY,KAAK,KAAK,OAAO,OAAO;IACvB,UAAU,SAAS,KAAK;IAAG,OAAO,CAAC,EAAE,MAAM,OAAO,CAAC;GAAE,CAAC;EACnG;CACF;AACF;;;;ACxNA,IAAA,gDAAesB,WAAW,EACxBS,MAAM;CACJC,SAAS;CACTC,MAAMR;CACNS,QAAQC,SAAiBA,KAAKC,YAAY,CAAC,CAACC,SAASV,kBAAkB;CACvEW,OAAOR,uBAAuB;EAC5BS,SAASC,cAAchB,IAAIiB,QAAQD,SAAS;EAC5CE,UAAUC,WAAWpB,mBAAmBqB,KAAKlB,2BAA2BiB,MAAM;CAChF,CAAC;CACDE,OAAOhB;AACT,EACF,CAAC;;;ACpBD,MAAM,OAAU,UAAmC,UAChD,UAAU,KAAA,IAAY,KAAA,IAAY;CAAE,GAAG;CAAU,GAAI;AAAiB;AAEzE,MAAa,eAAe,mBAAmB;CAC7C,IAAI;CACJ,aAAa;CACb,SAAS,EACP,IAAI,QAAyC;EAAE,OAAO,CAAC,IAAI;GAAE,MAAM;GAAsB,IAAI;EAAc,GAAGiB,6CAAe,CAAC;CAAG,EACnI;AACF,CAAC"}
|
|
1
|
+
{"version":3,"file":"native.mjs","names":["useT","Button","fontOf","Input","LockIcon","PoNativeTheme","StyleSheet","SpreadsheetView","cellName","columnName","SpreadsheetPhoneAction","SpreadsheetCanvasViewNativeProps","view","state","message","tone","text","selection","row","column","draft","busy","onSelectSheet","name","onSelect","cell","onDraft","onCommit","onAction","action","ROW_HEADER","COLUMN_HEADER","MIN_ROW","SpreadsheetCanvasViewNative","t","undefined","styles","root","note","red","sheet","editable","protected","active","rows","lineEdits","label","enabled","bar","toolbar","revision","status","file","field","input","banner","flex","ask","parts","lossyParts","join","header","width","height","widths","map","headerText","hi","cells","Math","max","heights","selected","cellText","numeric","bold","tabBar","tabs","sheets","entry","tab","create","theme","backgroundColor","colors","panel","uni__dependencies","flexGrow","flexShrink","borderTopWidth","borderColor","border","gap","spacing","paddingHorizontal","paddingVertical","fontFamily","sans","fontSize","sm","color","dim","flexDirection","alignItems","padding","borderBottomWidth","minWidth","mono","magenta","justifyContent","rail","borderRightWidth","borderWidth","base","textAlign","fontVariant","fontWeight","semibold","useT","useCallback","useEffect","useState","DeviceEventEmitter","api","SPREADSHEET_CHANGED_EVENT","AuthorCanvasPanelProps","SpreadsheetEdit","SpreadsheetView","cellName","SpreadsheetPhoneAction","SpreadsheetCanvasViewNative","Message","tone","text","SpreadsheetCanvasPanelNative","sessionId","source","t","path","view","setView","failed","setFailed","message","setMessage","busy","setBusy","selection","setSelection","row","column","draft","setDraft","sheet","name","load","result","session","query","ok","error","undefined","data","subscription","addListener","detail","remove","change","edits","doing","Promise","edit","body","revision","status","act","action","consent","kind","names","Set","sheets","map","entry","index","length","has","rows","insertRow","deleteRow","insertColumn","deleteColumn","const","at","cell","input","then","saved","defineFill","DeviceEventEmitter","api","SPREADSHEET_CANVAS_TYPE","SPREADSHEET_CHANGED_EVENT","SPREADSHEET_SUFFIX","AuthorCanvasTypeContribution","SpreadsheetCanvasPanelNative","createSpreadsheetTools","data","version","type","match","path","toLowerCase","endsWith","tools","client","sessionId","session","changed","detail","emit","panel","fillSpreadsheet"],"sources":["../../src/types/apiRoutes.ts","../../generated/client.native.ts","../../src/constants/spreadsheet.ts","../../src/extensions/workspaces/sessions/(frontend)/fill/_lib/spreadsheetRange.ts","../../src/extensions/workspaces/sessions/(frontend)/fill/_components/SpreadsheetCanvasView.native.tsx","../../src/extensions/workspaces/sessions/(frontend)/fill/_components/SpreadsheetCanvasPanel.native.tsx","../../src/extensions/workspaces/sessions/(frontend)/fill/_lib/spreadsheetTools.ts","../../src/extensions/workspaces/sessions/(frontend)/fill/Spreadsheet.author.canvas-type.native.tsx","../../generated/native.ts"],"sourcesContent":["import type { ApiResponseOf, ApiRoutes } from '@agimon-ai/po-core/web';\n\nimport type { SpreadsheetDownload, SpreadsheetView } from './spreadsheetApi';\n\nexport const routes = {\n view: {\n method: 'GET',\n path: '/workbook',\n query: ['path', 'sheet'],\n response: undefined as unknown as ApiResponseOf<SpreadsheetView>,\n },\n /** Body: `SpreadsheetEditRequest`. Answers with the edited sheet. */\n edit: { method: 'POST', path: '/workbook/edit', response: undefined as unknown as ApiResponseOf<SpreadsheetView> },\n /** Body: `{ path, sheet }`. The person agreed to save a workbook whose file state is `consent`. */\n consent: {\n method: 'POST',\n path: '/workbook/consent',\n response: undefined as unknown as ApiResponseOf<SpreadsheetView>,\n },\n download: {\n method: 'GET',\n path: '/workbook/download',\n query: ['path'],\n response: undefined as unknown as ApiResponseOf<SpreadsheetDownload>,\n },\n} as const satisfies ApiRoutes;\n","// Generated by @agimon-ai/po-build. Do not edit by hand.\nimport { createApiClient, nativeApiTransport, sessionApiAddress } from '@agimon-ai/po-core/native';\n\nimport { routes } from '../src/types/apiRoutes';\n\n/** Scopes the tree mounts 'spreadsheet' at. */\nexport const apiScopes = ['session'] as const;\n\nexport const api = createApiClient(routes, {\n scopes: apiScopes,\n basePath: 'spreadsheet',\n transport: nativeApiTransport,\n sessionAddress: sessionApiAddress,\n});\n","/** Window event an agent tool fires after it changes a workbook, so an open canvas reloads. Detail: `{ sessionId, path }`. */\nexport const SPREADSHEET_CHANGED_EVENT = 'po-spreadsheet:changed';\n\n/** The canvas type id, shared by the server registration and the browser fill. */\nexport const SPREADSHEET_CANVAS_TYPE = 'spreadsheet';\n\n/** Lowercase path suffix both sides match. CSV stays with Author's built-in view. */\nexport const SPREADSHEET_SUFFIX = '.xlsx';\n","/** A zero-based block of cells. */\nexport interface SpreadsheetRange {\n row: number;\n column: number;\n rows: number;\n columns: number;\n}\n\nexport const columnName = (index: number): string =>\n (index >= 26 ? columnName(Math.floor(index / 26) - 1) : '') + String.fromCodePoint(65 + (index % 26));\n\nexport const cellName = (row: number, column: number): string => `${columnName(column)}${row + 1}`;\n\n/** `B5`, or `B5:D6` for a block. */\nexport function rangeName({ row, column, rows, columns }: SpreadsheetRange): string {\n const start = cellName(row, column);\n return rows === 1 && columns === 1 ? start : `${start}:${cellName(row + rows - 1, column + columns - 1)}`;\n}\n\nfunction parseCell(reference: string): { row: number; column: number } | undefined {\n const match = /^([A-Z]{1,3})([1-9]\\d{0,6})$/.exec(reference);\n if (match === null) return undefined;\n let column = 0;\n for (const letter of match[1]!) column = column * 26 + letter.charCodeAt(0) - 64;\n return { row: Number(match[2]) - 1, column: column - 1 };\n}\n\n/** The block an A1 reference names, in either corner order; undefined when it is not one. */\nexport function parseRange(reference: string): SpreadsheetRange | undefined {\n const [first, second = first] = reference.toUpperCase().split(':');\n const a = parseCell(first ?? '');\n const b = parseCell(second ?? '');\n if (a === undefined || b === undefined) return undefined;\n return {\n row: Math.min(a.row, b.row),\n column: Math.min(a.column, b.column),\n rows: Math.abs(a.row - b.row) + 1,\n columns: Math.abs(a.column - b.column) + 1,\n };\n}\n\n/** The block between two cells a drag started and ended on. */\nexport function spanning(a: { row: number; column: number }, b: { row: number; column: number }): SpreadsheetRange {\n return {\n row: Math.min(a.row, b.row),\n column: Math.min(a.column, b.column),\n rows: Math.abs(a.row - b.row) + 1,\n columns: Math.abs(a.column - b.column) + 1,\n };\n}\n\n/** The corner of `selection` opposite `origin`, the cell a keyboard extension moves. */\nexport function farCorner(origin: { row: number; column: number }, selection: SpreadsheetRange) {\n return {\n row: origin.row === selection.row ? selection.row + selection.rows - 1 : selection.row,\n column: origin.column === selection.column ? selection.column + selection.columns - 1 : selection.column,\n };\n}\n\n/** Tab-separated text of a block, rows on lines, as other spreadsheets copy it. */\nexport function blockText(\n rows: readonly (readonly ({ text: string } | null | undefined)[])[],\n { row, column, rows: height, columns }: SpreadsheetRange,\n): string {\n return rows\n .slice(row, row + height)\n .map((cells) => Array.from({ length: columns }, (_, index) => cells[column + index]?.text ?? '').join('\\t'))\n .join('\\n');\n}\n\n/** Cells that pasting tab-separated `text` at `at` sets, left to right then down. */\nexport function pastedCells(text: string, at: { row: number; column: number }): { cell: string; input: string }[] {\n const lines = text.replace(/\\r\\n?/g, '\\n').split('\\n');\n if (lines.at(-1) === '') lines.pop();\n return lines.flatMap((line, row) =>\n line.split('\\t').map((input, column) => ({ cell: cellName(at.row + row, at.column + column), input })),\n );\n}\n","import { useT } from '@agimon-ai/po-core/native';\nimport { Button, fontOf, Input, LockIcon } from '@agimon-ai/po-native-components';\nimport type { PoNativeTheme } from '@agimon-ai/po-web-components/nativeTheme';\nimport { Pressable, ScrollView, Text, View } from 'react-native';\nimport { StyleSheet } from 'react-native-unistyles';\n\nimport type { SpreadsheetView } from '../../../../../../types/spreadsheetApi';\nimport type {} from '../../../../../../types/unistyles.native';\nimport { cellName, columnName } from '../_lib/spreadsheetRange';\n\nexport type SpreadsheetPhoneAction =\n | 'insertRow'\n | 'deleteRow'\n | 'insertColumn'\n | 'deleteColumn'\n | 'addSheet'\n | 'undo'\n | 'consent';\n\nexport interface SpreadsheetCanvasViewNativeProps {\n view?: SpreadsheetView;\n /** Set while the workbook opens for the first time, or when it could not open. */\n state?: 'ready' | 'loading' | 'error';\n message?: { tone: 'dim' | 'red'; text: string };\n /** The one selected cell; the phone edits a cell at a time. */\n selection?: { row: number; column: number };\n /** The text in the cell field while the selected cell is being edited. */\n draft?: string;\n busy?: boolean;\n onSelectSheet?: (name: string) => void;\n onSelect?: (cell: { row: number; column: number }) => void;\n onDraft?: (text: string | undefined) => void;\n onCommit?: () => void;\n onAction?: (action: SpreadsheetPhoneAction) => void;\n}\n\nconst ROW_HEADER = 44;\nconst COLUMN_HEADER = 28;\n/** Tap targets stay at least this tall even where the workbook's rows are shorter. */\nconst MIN_ROW = 44;\n\n/**\n * The phone's spreadsheet canvas: the web canvas's toolbar, cell field, banners and sheet tabs on one\n * column. Tap a cell to select it and edit it in the cell field. Resizing and Region/Comment marks\n * stay on the web for now.\n */\nexport function SpreadsheetCanvasViewNative({\n view,\n state = 'ready',\n message,\n selection,\n draft,\n busy = false,\n onSelectSheet,\n onSelect,\n onDraft,\n onCommit,\n onAction,\n}: SpreadsheetCanvasViewNativeProps) {\n const t = useT();\n if (state === 'loading' || view === undefined)\n return (\n <View style={styles.root}>\n <Text\n accessibilityRole={state === 'error' ? 'alert' : undefined}\n style={[styles.note, state === 'error' ? styles.red : null]}\n >\n {state === 'error'\n ? (message?.text ?? t('spreadsheet.cannotOpen', 'Po could not open this workbook.'))\n : t('spreadsheet.opening', 'Opening workbook…')}\n </Text>\n </View>\n );\n\n const { sheet } = view;\n const editable = !sheet.protected && !busy;\n const active = selection === undefined ? undefined : sheet.rows[selection.row]?.[selection.column];\n const lineEdits = editable && selection !== undefined;\n const action = (name: SpreadsheetPhoneAction, label: string, enabled: boolean) => (\n <Button key={name} size=\"sm\" variant=\"ghost\" disabled={!enabled} onPress={() => onAction?.(name)}>\n {label}\n </Button>\n );\n\n return (\n <View style={styles.root}>\n <ScrollView\n horizontal\n showsHorizontalScrollIndicator={false}\n style={styles.bar}\n contentContainerStyle={styles.toolbar}\n >\n {action('insertRow', t('spreadsheet.insertRow', 'Insert row'), lineEdits)}\n {action('deleteRow', t('spreadsheet.deleteRow', 'Delete row'), lineEdits)}\n {action('insertColumn', t('spreadsheet.insertColumn', 'Insert column'), lineEdits)}\n {action('deleteColumn', t('spreadsheet.deleteColumn', 'Delete column'), lineEdits)}\n {action('addSheet', t('spreadsheet.addSheet', 'Add sheet'), !busy)}\n {action('undo', t('spreadsheet.undo', 'Undo'), !busy && view.revision > 0)}\n </ScrollView>\n <Text accessibilityRole=\"text\" style={styles.status}>\n {view.file.state === 'saved'\n ? t('spreadsheet.saved', 'Changes save to the file')\n : view.file.state === 'readOnly'\n ? t('spreadsheet.artifactLocal', 'Artifact: changes stay here')\n : t('spreadsheet.unsaved', 'Not saved yet')}\n </Text>\n <View style={styles.field}>\n <Text style={styles.cellName}>{selection === undefined ? '' : cellName(selection.row, selection.column)}</Text>\n <Input\n size=\"sm\"\n style={styles.input}\n accessibilityLabel={t('spreadsheet.cellContents', 'Cell contents')}\n placeholder={selection === undefined ? t('spreadsheet.tapCell', 'Tap a cell') : undefined}\n disabled={!editable || selection === undefined}\n value={draft ?? active?.input ?? ''}\n onFocus={() => {\n if (draft === undefined) onDraft?.(active?.input ?? '');\n }}\n onChangeText={(text) => onDraft?.(text)}\n onSubmitEditing={() => onCommit?.()}\n returnKeyType=\"done\"\n />\n </View>\n {sheet.protected ? (\n <View style={styles.banner}>\n <LockIcon size={16} color=\"dim\" />\n <Text style={[styles.note, styles.flex]}>\n {t('spreadsheet.protectedSheet', '{name} is protected in the workbook, so Po keeps it read-only.', {\n name: sheet.name,\n })}\n </Text>\n </View>\n ) : null}\n {view.file.state === 'consent' ? (\n <View style={styles.banner}>\n <Text style={[styles.note, styles.ask, styles.flex]}>\n {t(\n 'spreadsheet.lossy',\n \"This workbook has parts Po's engine may simplify when it saves ({parts}). Your changes stay here until you choose to save.\",\n { parts: view.file.lossyParts.join(', ') },\n )}\n </Text>\n <Button size=\"sm\" variant=\"outline\" disabled={busy} onPress={() => onAction?.('consent')}>\n {t('spreadsheet.save', 'Save to the file')}\n </Button>\n </View>\n ) : null}\n {message === undefined ? null : (\n <Text\n accessibilityRole={message.tone === 'red' ? 'alert' : undefined}\n accessibilityLiveRegion=\"polite\"\n style={[styles.note, message.tone === 'red' ? styles.red : null]}\n >\n {message.text}\n </Text>\n )}\n <ScrollView horizontal style={styles.flex}>\n <ScrollView>\n <View style={styles.row}>\n <View style={[styles.header, { width: ROW_HEADER, height: COLUMN_HEADER }]} />\n {sheet.widths.map((width, column) => (\n <View key={column} style={[styles.header, { width, height: COLUMN_HEADER }]}>\n <Text style={[styles.headerText, selection?.column === column ? styles.hi : null]}>\n {columnName(column)}\n </Text>\n </View>\n ))}\n </View>\n {sheet.rows.map((cells, row) => {\n const height = Math.max(MIN_ROW, sheet.heights[row] ?? 0);\n return (\n <View key={row} style={styles.row}>\n <View style={[styles.header, { width: ROW_HEADER, height }]}>\n <Text style={[styles.headerText, selection?.row === row ? styles.hi : null]}>{row + 1}</Text>\n </View>\n {sheet.widths.map((width, column) => {\n const cell = cells[column];\n const selected = selection?.row === row && selection.column === column;\n return (\n <Pressable\n key={column}\n accessibilityRole=\"button\"\n accessibilityLabel={`${cellName(row, column)} ${cell?.text ?? t('spreadsheet.empty', 'empty')}`}\n accessibilityState={{ selected }}\n onPress={() => onSelect?.({ row, column })}\n style={[styles.cell, { width, height }, selected ? styles.selected : null]}\n >\n <Text\n numberOfLines={1}\n style={[\n styles.cellText,\n cell?.numeric ? styles.numeric : null,\n cell?.bold ? styles.bold : null,\n ]}\n >\n {cell?.text ?? ''}\n </Text>\n </Pressable>\n );\n })}\n </View>\n );\n })}\n </ScrollView>\n </ScrollView>\n <ScrollView\n horizontal\n showsHorizontalScrollIndicator={false}\n style={[styles.bar, styles.tabBar]}\n contentContainerStyle={styles.tabs}\n >\n {view.sheets.map((entry) => (\n <Button\n key={entry.name}\n size=\"sm\"\n variant={entry.name === sheet.name ? 'secondary' : 'ghost'}\n accessibilityState={{ selected: entry.name === sheet.name }}\n disabled={busy}\n onPress={() => onSelectSheet?.(entry.name)}\n >\n {entry.protected ? (\n <View style={styles.tab}>\n <LockIcon size={14} accessibilityLabel={t('spreadsheet.protected', 'protected')} />\n <Text style={styles.headerText}>{entry.name}</Text>\n </View>\n ) : (\n entry.name\n )}\n </Button>\n ))}\n </ScrollView>\n </View>\n );\n}\n\nconst styles = StyleSheet.create((theme: PoNativeTheme) => ({\n root: { flex: 1, backgroundColor: theme.colors.panel },\n flex: { flex: 1 },\n // A horizontal ScrollView grows to fill a column unless told not to.\n bar: { flexGrow: 0, flexShrink: 0 },\n tabBar: { borderTopWidth: 1, borderColor: theme.colors.border },\n toolbar: {\n gap: theme.spacing(1),\n paddingHorizontal: theme.spacing(2),\n // A 28pt sm button plus this padding keeps its 44pt tap target inside the bar.\n paddingVertical: theme.spacing(2),\n },\n status: {\n paddingHorizontal: theme.spacing(3),\n fontFamily: fontOf(theme.fontFamily.sans),\n fontSize: theme.fontSize.sm,\n color: theme.colors.dim,\n },\n field: {\n flexDirection: 'row',\n alignItems: 'center',\n gap: theme.spacing(2),\n padding: theme.spacing(2),\n borderBottomWidth: 1,\n borderColor: theme.colors.border,\n },\n cellName: {\n minWidth: 48,\n fontFamily: fontOf(theme.fontFamily.mono),\n fontSize: theme.fontSize.sm,\n color: theme.colors.text,\n },\n input: { flex: 1 },\n banner: {\n flexDirection: 'row',\n alignItems: 'center',\n gap: theme.spacing(2),\n paddingHorizontal: theme.spacing(3),\n paddingVertical: theme.spacing(2),\n borderBottomWidth: 1,\n borderColor: theme.colors.border,\n },\n note: {\n padding: theme.spacing(3),\n fontFamily: fontOf(theme.fontFamily.sans),\n fontSize: theme.fontSize.sm,\n color: theme.colors.dim,\n },\n ask: { padding: 0, color: theme.colors.magenta },\n red: { color: theme.colors.red },\n row: { flexDirection: 'row' },\n header: {\n alignItems: 'center',\n justifyContent: 'center',\n backgroundColor: theme.colors.rail,\n borderRightWidth: 1,\n borderBottomWidth: 1,\n borderColor: theme.colors.border,\n },\n headerText: { fontFamily: fontOf(theme.fontFamily.sans), fontSize: theme.fontSize.sm, color: theme.colors.dim },\n hi: { color: theme.colors.hi },\n cell: {\n justifyContent: 'center',\n paddingHorizontal: theme.spacing(2),\n borderRightWidth: 1,\n borderBottomWidth: 1,\n borderColor: theme.colors['border-soft'],\n },\n selected: { borderWidth: 2, borderColor: theme.colors.selected },\n cellText: { fontFamily: fontOf(theme.fontFamily.sans), fontSize: theme.fontSize.base, color: theme.colors.text },\n numeric: { textAlign: 'right', fontVariant: ['tabular-nums'] },\n bold: { fontWeight: theme.fontWeight.semibold, color: theme.colors.hi },\n tab: { flexDirection: 'row', alignItems: 'center', gap: theme.spacing(1) },\n tabs: {\n gap: theme.spacing(1),\n paddingHorizontal: theme.spacing(2),\n paddingVertical: theme.spacing(2),\n },\n}));\n","import { useT } from '@agimon-ai/po-core/native';\nimport { useCallback, useEffect, useState } from 'react';\nimport { DeviceEventEmitter } from 'react-native';\n\nimport { api } from '../../../../../../../generated/client.native';\nimport { SPREADSHEET_CHANGED_EVENT } from '../../../../../../constants/spreadsheet';\nimport type { AuthorCanvasPanelProps } from '../../../../../../types/authorCanvas';\nimport type { SpreadsheetEdit, SpreadsheetView } from '../../../../../../types/spreadsheetApi';\nimport { cellName } from '../_lib/spreadsheetRange';\nimport { type SpreadsheetPhoneAction, SpreadsheetCanvasViewNative } from './SpreadsheetCanvasView.native';\n\ntype Message = { tone: 'dim' | 'red'; text: string };\n\n/** The phone's `.xlsx` canvas: the same session API and save rules as the web canvas, a cell at a time. */\nexport function SpreadsheetCanvasPanelNative({ sessionId, source }: AuthorCanvasPanelProps) {\n const t = useT();\n const { path } = source;\n const [view, setView] = useState<SpreadsheetView>();\n const [failed, setFailed] = useState<string>();\n const [message, setMessage] = useState<Message>();\n const [busy, setBusy] = useState(false);\n const [selection, setSelection] = useState<{ row: number; column: number }>();\n const [draft, setDraft] = useState<string>();\n const sheet = view?.sheet.name ?? '';\n\n const load = useCallback(\n async (name: string) => {\n if (sessionId === null) return;\n const result = await api.session(sessionId).view({ query: { path, sheet: name } });\n if (!result.ok) {\n setFailed(result.error || t('spreadsheet.cannotOpen', 'Po could not open this workbook.'));\n return;\n }\n setFailed(undefined);\n setView(result.data);\n },\n [path, sessionId, t],\n );\n\n useEffect(() => {\n void load('');\n }, [load]);\n\n // An agent tool changed this workbook: show its result.\n useEffect(() => {\n const subscription = DeviceEventEmitter.addListener(\n SPREADSHEET_CHANGED_EVENT,\n (detail: { sessionId?: string; path?: string }) => {\n if (detail.sessionId === sessionId && detail.path === path) void load(sheet);\n },\n );\n return () => subscription.remove();\n }, [load, path, sessionId, sheet]);\n\n async function change(edits: SpreadsheetEdit[], doing: string): Promise<boolean> {\n if (sessionId === null || view === undefined) return false;\n setBusy(true);\n setMessage({ tone: 'dim', text: doing });\n try {\n const result = await api.session(sessionId).edit({ body: { path, sheet, revision: view.revision, edits } });\n if (!result.ok) {\n // Someone else changed the workbook first: show theirs rather than overwrite it.\n if (result.status === 409) await load(sheet);\n setMessage({\n tone: 'red',\n text:\n result.status === 409\n ? t('spreadsheet.conflict', 'The workbook changed while you were editing. Po reloaded it; try again.')\n : result.status === 0\n ? t('spreadsheet.disconnected', 'Po lost the connection to the server. Your change was not made.')\n : result.error || t('spreadsheet.cannotChange', 'Po could not make that change.'),\n });\n return false;\n }\n setView(result.data);\n setMessage(undefined);\n return true;\n } finally {\n setBusy(false);\n }\n }\n\n async function act(action: SpreadsheetPhoneAction) {\n if (view === undefined || sessionId === null) return;\n if (action === 'consent') {\n setBusy(true);\n try {\n const result = await api.session(sessionId).consent({ body: { path, sheet } });\n if (result.ok) {\n setView(result.data);\n setMessage(undefined);\n } else\n setMessage({\n tone: 'red',\n text: result.error || t('spreadsheet.cannotSave', 'Po could not save the workbook.'),\n });\n } finally {\n setBusy(false);\n }\n return;\n }\n if (action === 'undo') {\n await change([{ kind: 'undo' }], t('spreadsheet.undoing', 'Undoing…'));\n return;\n }\n if (action === 'addSheet') {\n const names = new Set(view.sheets.map((entry) => entry.name));\n let index = view.sheets.length + 1;\n while (names.has(`Sheet${index}`)) index += 1;\n await change([{ kind: 'addSheet', name: `Sheet${index}` }], t('spreadsheet.addingSheet', 'Adding a sheet…'));\n return;\n }\n if (selection === undefined) return;\n const rows = action === 'insertRow' || action === 'deleteRow';\n const kind = (\n {\n insertRow: 'insertRows',\n deleteRow: 'deleteRows',\n insertColumn: 'insertColumns',\n deleteColumn: 'deleteColumns',\n } as const\n )[action];\n await change(\n [{ kind, at: (rows ? selection.row : selection.column) + 1 }],\n t('spreadsheet.updating', 'Updating the sheet…'),\n );\n }\n\n return (\n <SpreadsheetCanvasViewNative\n view={view}\n state={failed !== undefined ? 'error' : view === undefined ? 'loading' : 'ready'}\n message={failed !== undefined ? { tone: 'red', text: failed } : message}\n selection={selection}\n draft={draft}\n busy={busy}\n onSelectSheet={(name) => {\n setSelection(undefined);\n setDraft(undefined);\n void load(name);\n }}\n onSelect={(cell) => {\n setDraft(undefined);\n setSelection(cell);\n }}\n onDraft={setDraft}\n onCommit={() => {\n if (selection === undefined || draft === undefined) return;\n const cell = cellName(selection.row, selection.column);\n void change(\n [{ kind: 'setCell', cell, input: draft }],\n t('spreadsheet.savingCell', 'Saving {cell}…', { cell }),\n ).then((saved) => {\n if (saved) setDraft(undefined);\n });\n }}\n onAction={(action) => void act(action)}\n />\n );\n}\n","import type { AuthorCanvasTypeTarget, AuthorCanvasTypeTool } from '../../../../../../types/authorCanvas';\nimport type {\n SpreadsheetEdit,\n SpreadsheetSessionClient,\n SpreadsheetView,\n} from '../../../../../../types/spreadsheetApi';\nimport { cellName } from './spreadsheetRange';\n\n/** What the tools need from the web or phone host: its session client, and a way to tell an open canvas to reload. */\nexport interface SpreadsheetToolHost {\n client(sessionId: string): SpreadsheetSessionClient;\n changed(target: AuthorCanvasTypeTarget): void;\n}\n\nconst MAX_CELLS = 2000;\n\n/** What the agent reads: the sheet's non-empty cells in A1 terms, and the revision to quote back. */\nfunction summary(view: SpreadsheetView) {\n const cells = view.sheet.rows.flatMap((row, r) =>\n row.flatMap((cell, c) => (cell === null ? [] : [{ cell: cellName(r, c), text: cell.text, input: cell.input }])),\n );\n return {\n revision: view.revision,\n sheets: view.sheets,\n sheet: view.sheet.name,\n protected: view.sheet.protected,\n // saved: edits are in the file. consent: only the person can agree to save. readOnly: an artifact.\n file: view.file,\n cells: cells.slice(0, MAX_CELLS),\n ...(cells.length > MAX_CELLS ? { truncated: true } : {}),\n };\n}\n\nfunction record(input: unknown): Record<string, unknown> {\n if (typeof input !== 'object' || input === null || Array.isArray(input))\n throw new Error('INVALID_INPUT: pass an object.');\n return input as Record<string, unknown>;\n}\n\nfunction text(input: Record<string, unknown>, field: string): string {\n const value = input[field];\n if (typeof value !== 'string' || value === '') throw new Error(`INVALID_INPUT: ${field} must be a non-empty string.`);\n return value;\n}\n\nfunction revision(input: Record<string, unknown>): number {\n const value = input.revision;\n if (!Number.isInteger(value)) throw new Error('INVALID_INPUT: pass the revision spreadsheet_read returned.');\n return value as number;\n}\n\nasync function edit(\n host: SpreadsheetToolHost,\n target: AuthorCanvasTypeTarget,\n signal: AbortSignal,\n body: { sheet: string; revision: number; edits: SpreadsheetEdit[] },\n) {\n const result = await host.client(target.sessionId).edit({ body: { path: target.path, ...body }, signal });\n if (!result.ok) throw new Error(result.error || `Spreadsheet edit failed with status ${result.status}.`);\n host.changed(target);\n return summary(result.data);\n}\n\nconst REVISION = { type: 'integer', description: 'The revision spreadsheet_read returned.' } as const;\nconst SHEET = { type: 'string', description: 'Sheet name, as spreadsheet_read lists it.' } as const;\nconst LINES = {\n type: 'object',\n properties: {\n sheet: SHEET,\n revision: REVISION,\n at: { type: 'integer', minimum: 1, description: '1-based first row or column (A is 1).' },\n count: { type: 'integer', minimum: 1, maximum: 1000 },\n },\n required: ['sheet', 'revision', 'at'],\n} as const;\n\nfunction lineTool(\n host: SpreadsheetToolHost,\n name: string,\n kind: 'insertRows' | 'deleteRows' | 'insertColumns' | 'deleteColumns',\n description: string,\n): AuthorCanvasTypeTool {\n return {\n name,\n description,\n inputSchema: LINES,\n async execute(input, signal, target) {\n const value = record(input);\n const at = value.at;\n const count = value.count ?? 1;\n if (!Number.isInteger(at) || !Number.isInteger(count))\n throw new Error('INVALID_INPUT: at and count must be integers.');\n return edit(host, target, signal, {\n sheet: text(value, 'sheet'),\n revision: revision(value),\n edits: [{ kind, at: at as number, count: count as number }],\n });\n },\n };\n}\n\n/** The agent's canvas tools, the same on the web and the phone. */\nexport const createSpreadsheetTools = (host: SpreadsheetToolHost): readonly AuthorCanvasTypeTool[] => [\n {\n name: 'spreadsheet_read',\n label: 'Read sheet',\n description:\n 'Read one sheet of the open workbook: its non-empty cells with displayed text and input (formulas start with =), every sheet name, whether the sheet is protected, and the revision to pass to edits.',\n inputSchema: { type: 'object', properties: { sheet: { ...SHEET, description: 'Defaults to the first sheet.' } } },\n async execute(input, signal, { sessionId, path }) {\n const value = record(input ?? {});\n const sheet = value.sheet === undefined ? '' : text(value, 'sheet');\n const result = await host.client(sessionId).view({ query: { path, sheet }, signal });\n if (!result.ok) throw new Error(result.error || `Spreadsheet read failed with status ${result.status}.`);\n return summary(result.data);\n },\n },\n {\n name: 'spreadsheet_set_cells',\n label: 'Set cells',\n description:\n 'Enter values or formulas into cells of one unprotected sheet, up to 500 at once, in order. Formulas start with = and recalculate. An empty input clears the cell.',\n inputSchema: {\n type: 'object',\n properties: {\n sheet: SHEET,\n revision: REVISION,\n cells: {\n type: 'array',\n minItems: 1,\n maxItems: 500,\n items: {\n type: 'object',\n properties: { cell: { type: 'string', description: 'A1 address such as B5.' }, input: { type: 'string' } },\n required: ['cell', 'input'],\n },\n },\n },\n required: ['sheet', 'revision', 'cells'],\n },\n async execute(input, signal, target) {\n const value = record(input);\n const cells = value.cells;\n if (!Array.isArray(cells) || cells.length === 0 || cells.length > 500)\n throw new Error('INVALID_INPUT: cells must list 1 to 500 cells.');\n const edits = cells.map((entry): SpreadsheetEdit => {\n const cell = record(entry);\n if (typeof cell.input !== 'string') throw new Error('INVALID_INPUT: every cell needs a string input.');\n return { kind: 'setCell', cell: text(cell, 'cell').toUpperCase(), input: cell.input };\n });\n return edit(host, target, signal, { sheet: text(value, 'sheet'), revision: revision(value), edits });\n },\n },\n lineTool(host, 'spreadsheet_insert_rows', 'insertRows', 'Insert empty rows before row `at` of an unprotected sheet.'),\n lineTool(host, 'spreadsheet_delete_rows', 'deleteRows', 'Delete rows starting at row `at` of an unprotected sheet.'),\n lineTool(\n host,\n 'spreadsheet_insert_columns',\n 'insertColumns',\n 'Insert empty columns before column `at` (A is 1) of an unprotected sheet.',\n ),\n lineTool(\n host,\n 'spreadsheet_delete_columns',\n 'deleteColumns',\n 'Delete columns starting at column `at` (A is 1) of an unprotected sheet.',\n ),\n {\n name: 'spreadsheet_set_size',\n label: 'Resize',\n description:\n 'Set the pixel width of columns (up to 1800) or height of rows (up to 546) of an unprotected sheet; 0 hides them.',\n inputSchema: {\n type: 'object',\n properties: {\n ...LINES.properties,\n line: { type: 'string', enum: ['column', 'row'] },\n size: { type: 'number', minimum: 0, maximum: 1800 },\n },\n required: ['sheet', 'revision', 'at', 'line', 'size'],\n },\n async execute(input, signal, target) {\n const value = record(input);\n const { at, size, line } = value;\n const count = value.count ?? 1;\n if (!Number.isInteger(at) || !Number.isInteger(count) || typeof size !== 'number')\n throw new Error('INVALID_INPUT: at and count must be integers and size a number.');\n if (line !== 'column' && line !== 'row') throw new Error('INVALID_INPUT: line must be column or row.');\n return edit(host, target, signal, {\n sheet: text(value, 'sheet'),\n revision: revision(value),\n edits: [\n { kind: line === 'column' ? 'columnWidth' : 'rowHeight', at: at as number, count: count as number, size },\n ],\n });\n },\n },\n {\n name: 'spreadsheet_add_sheet',\n label: 'Add sheet',\n description: 'Add an empty sheet after the last one.',\n inputSchema: {\n type: 'object',\n properties: {\n revision: REVISION,\n name: { type: 'string', description: 'Up to 31 characters, no [ ] : * ? / \\\\.' },\n },\n required: ['revision', 'name'],\n },\n async execute(input, signal, target) {\n const value = record(input);\n const name = text(value, 'name');\n return edit(host, target, signal, {\n sheet: name,\n revision: revision(value),\n edits: [{ kind: 'addSheet', name }],\n });\n },\n },\n {\n name: 'spreadsheet_undo',\n label: 'Undo',\n description: 'Undo the last change to the workbook, whoever made it.',\n inputSchema: { type: 'object', properties: { revision: REVISION, sheet: SHEET }, required: ['revision'] },\n async execute(input, signal, target) {\n const value = record(input);\n const sheet = value.sheet === undefined ? '' : text(value, 'sheet');\n return edit(host, target, signal, { sheet, revision: revision(value), edits: [{ kind: 'undo' }] });\n },\n },\n];\n","import { defineFill } from '@agimon-ai/po-core/native';\nimport { DeviceEventEmitter } from 'react-native';\n\nimport { api } from '../../../../../../generated/client.native';\nimport {\n SPREADSHEET_CANVAS_TYPE,\n SPREADSHEET_CHANGED_EVENT,\n SPREADSHEET_SUFFIX,\n} from '../../../../../constants/spreadsheet';\nimport type { AuthorCanvasTypeContribution } from '../../../../../types/authorCanvas';\nimport { SpreadsheetCanvasPanelNative } from './_components/SpreadsheetCanvasPanel.native';\nimport { createSpreadsheetTools } from './_lib/spreadsheetTools';\n\n/** Fills slot `author.canvas-type` on the phone: the same workbook canvas and agent tools as the web. */\nexport default defineFill({\n data: {\n version: 1,\n type: SPREADSHEET_CANVAS_TYPE,\n match: (path: string) => path.toLowerCase().endsWith(SPREADSHEET_SUFFIX),\n tools: createSpreadsheetTools({\n client: (sessionId) => api.session(sessionId),\n changed: (detail) => DeviceEventEmitter.emit(SPREADSHEET_CHANGED_EVENT, detail),\n }),\n panel: SpreadsheetCanvasPanelNative,\n } satisfies AuthorCanvasTypeContribution,\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 fillSpreadsheet from '../src/extensions/workspaces/sessions/(frontend)/fill/Spreadsheet.author.canvas-type.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: 'spreadsheet',\n packageName: '@agimon-ai/po-spreadsheet',\n session: {\n get fills(): WebPluginContributions['fills'] { return [via({ slot: 'author.canvas-type', id: 'spreadsheet' }, fillSpreadsheet)]; },\n },\n});\n"],"mappings":";;;;;;;;;;ACQA,MAAa,MAAM,gBAAgB;CDHjC,MAAM;EACJ,QAAQ;EACR,MAAM;EACN,OAAO,CAAC,QAAQ,OAAO;EACvB,UAAU,KAAA;CACZ;;CAEA,MAAM;EAAE,QA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