@agimon-ai/po-edit 0.0.0-alpha.21 → 0.0.0-alpha.23

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.
@@ -0,0 +1,223 @@
1
+ import { defineNativePlugin, defineToolRenderer } from "@agimon-ai/po-core/native";
2
+ import { View } from "react-native-unistyles/components/native/View";
3
+ import { Text } from "react-native-unistyles/components/native/Text";
4
+ import { MessageItem, MessageItemBody, MessageItemHeader, MessageItemStatus, SyntaxLine, ToolPathLink, collapseLines, fontOf, toolTone, useSyntaxLines } from "@agimon-ai/po-native-components";
5
+ import { StyleSheet } from "react-native-unistyles";
6
+ import { Fragment, jsx, jsxs } from "react/jsx-runtime";
7
+ //#region src/extensions/workspaces/sessions/(frontend)/tool/_lib/editToolView.ts
8
+ /** Pi emits `+12 text`, `-12 text`, ` 12 text`, and a blank-numbered ` ... ` elision between hunks. */
9
+ const DIFF_ROW_PATTERN = /^([+\- ])( *\d*) (.*)$/u;
10
+ const CONTEXT_MARKER = " ";
11
+ /** What the edit call heading shows: the path and how many ranges the call touches. */
12
+ function editCallView(args) {
13
+ const count = Array.isArray(args.edits) ? args.edits.length : 0;
14
+ return {
15
+ path: typeof args.path === "string" ? args.path : "",
16
+ ranges: `${count} ${count === 1 ? "range" : "ranges"}`
17
+ };
18
+ }
19
+ function toDiffMarker(value) {
20
+ return value === "+" || value === "-" ? value : CONTEXT_MARKER;
21
+ }
22
+ /** Pi's display diff as rows; a line that is not a diff row reads as unnumbered context. */
23
+ function parseDiffRows(diff) {
24
+ return diff.split("\n").map((line) => {
25
+ const expanded = line.replaceAll(" ", " ");
26
+ const match = DIFF_ROW_PATTERN.exec(expanded);
27
+ if (!match) return {
28
+ marker: CONTEXT_MARKER,
29
+ lineNumber: "",
30
+ content: expanded
31
+ };
32
+ return {
33
+ marker: toDiffMarker(match[1]),
34
+ lineNumber: (match[2] ?? "").trim(),
35
+ content: match[3] ?? ""
36
+ };
37
+ });
38
+ }
39
+ /** The diff a successful edit carries in its details; undefined when the details never arrived. */
40
+ function editResultView(result) {
41
+ const details = result?.details;
42
+ if (typeof details !== "object" || details === null) return void 0;
43
+ const diff = details.diff;
44
+ if (typeof diff !== "string" || diff.length === 0) return void 0;
45
+ const rows = parseDiffRows(diff);
46
+ return {
47
+ rows,
48
+ gutter: rows.reduce((widest, row) => Math.max(widest, row.lineNumber.length), 1)
49
+ };
50
+ }
51
+ /** The result's text lines, for the error case where the diff never happened. */
52
+ function resultTextLines(result, output) {
53
+ const lines = (result === null ? output : result.content.flatMap((block) => {
54
+ const record = typeof block === "object" && block !== null ? block : {};
55
+ return record.type === "text" && typeof record.text === "string" ? [record.text] : [];
56
+ }).join("\n")).replaceAll(" ", " ").replaceAll("\r\n", "\n").split("\n");
57
+ while (lines.at(-1) === "") lines.pop();
58
+ return lines;
59
+ }
60
+ //#endregion
61
+ //#region src/extensions/workspaces/sessions/(frontend)/tool/_components/EditToolMessage.native.tsx
62
+ /** Diff rows shown until the item expands, as the web card. */
63
+ const COLLAPSED_ROWS = 24;
64
+ /**
65
+ * The banded rows and the grammar over them, as the web's DiffRows: parsed as
66
+ * one document, so a replaced line is seen twice and may colour oddly, and the
67
+ * `+`/`-` wash stays underneath so what changed is still legible.
68
+ */
69
+ function DiffRows({ rows, gutter, path }) {
70
+ const spans = useSyntaxLines(rows.map((row) => row.content).join("\n"), { path });
71
+ return /* @__PURE__ */ jsx(View, { children: rows.map((row, index) => /* @__PURE__ */ jsxs(View, {
72
+ style: styles.row(row.marker),
73
+ children: [
74
+ /* @__PURE__ */ jsx(Text, {
75
+ style: [styles.mono, styles.gutter],
76
+ children: row.lineNumber.padStart(gutter)
77
+ }),
78
+ /* @__PURE__ */ jsx(Text, {
79
+ style: [styles.mono, styles.ink(row.marker)],
80
+ children: row.marker
81
+ }),
82
+ /* @__PURE__ */ jsx(SyntaxLine, {
83
+ selectable: true,
84
+ spans: spans?.[index],
85
+ text: row.content,
86
+ style: [
87
+ styles.mono,
88
+ styles.content,
89
+ styles.ink(row.marker)
90
+ ]
91
+ })
92
+ ]
93
+ }, `${String(index)}-${row.lineNumber}`)) });
94
+ }
95
+ /**
96
+ * The edit tool's timeline item on native, as the web's EditToolMessage:
97
+ * `path · N ranges` in the header, the display diff banded by row in the body,
98
+ * and the tool's message in red when the edit failed.
99
+ */
100
+ function EditToolMessage({ args, result, output, running, isError, fileTabFor, openTransientTab }) {
101
+ const call = editCallView(args);
102
+ const view = result === null || isError ? void 0 : editResultView(result);
103
+ const tab = fileTabFor(call.path);
104
+ return /* @__PURE__ */ jsx(MessageItem, {
105
+ tone: toolTone({
106
+ running,
107
+ isError
108
+ }),
109
+ expandable: view !== void 0 && view.rows.length > COLLAPSED_ROWS,
110
+ children: ({ expanded }) => /* @__PURE__ */ jsxs(Fragment, { children: [/* @__PURE__ */ jsx(MessageItemHeader, {
111
+ title: "edit",
112
+ children: /* @__PURE__ */ jsxs(View, {
113
+ testID: "tool-call-edit",
114
+ style: styles.summary,
115
+ children: [/* @__PURE__ */ jsx(ToolPathLink, {
116
+ path: call.path,
117
+ ...tab === void 0 ? {} : { onOpen: () => openTransientTab(tab) }
118
+ }), /* @__PURE__ */ jsxs(Text, {
119
+ numberOfLines: 1,
120
+ style: styles.detail,
121
+ children: ["· ", call.ranges]
122
+ })]
123
+ })
124
+ }), isError ? /* @__PURE__ */ jsxs(MessageItemBody, {
125
+ testID: "tool-result-edit",
126
+ children: [/* @__PURE__ */ jsx(MessageItemStatus, {
127
+ tone: "error",
128
+ children: "failed"
129
+ }), resultTextLines(result, output).map((line, index) => /* @__PURE__ */ jsx(Text, {
130
+ selectable: true,
131
+ style: styles.error,
132
+ children: line
133
+ }, `${String(index)}-${line}`))]
134
+ }) : view === void 0 ? running ? /* @__PURE__ */ jsx(MessageItemBody, {
135
+ testID: "tool-result-edit",
136
+ children: /* @__PURE__ */ jsx(MessageItemStatus, {
137
+ tone: "running",
138
+ children: "running"
139
+ })
140
+ }) : null : (() => {
141
+ const { shown, hidden } = collapseLines(view.rows, COLLAPSED_ROWS, expanded);
142
+ return /* @__PURE__ */ jsxs(MessageItemBody, {
143
+ testID: "tool-result-edit",
144
+ children: [/* @__PURE__ */ jsx(DiffRows, {
145
+ rows: shown,
146
+ gutter: view.gutter,
147
+ path: call.path
148
+ }), hidden > 0 ? /* @__PURE__ */ jsxs(MessageItemStatus, {
149
+ expands: true,
150
+ children: [hidden, " more rows"]
151
+ }) : null]
152
+ });
153
+ })()] })
154
+ });
155
+ }
156
+ const styles = StyleSheet.create((theme) => ({
157
+ summary: {
158
+ flex: 1,
159
+ flexDirection: "row",
160
+ alignItems: "center",
161
+ gap: theme.spacing(2),
162
+ minWidth: 0,
163
+ uni__dependencies: [0]
164
+ },
165
+ detail: {
166
+ flexShrink: 0,
167
+ color: theme.colors.faint,
168
+ fontFamily: fontOf(theme.fontFamily.sans),
169
+ fontSize: theme.fontSize.base,
170
+ lineHeight: theme.lineHeight.base,
171
+ uni__dependencies: [0]
172
+ },
173
+ error: {
174
+ color: theme.colors.red,
175
+ fontFamily: fontOf(theme.fontFamily.sans),
176
+ fontSize: theme.fontSize.base,
177
+ lineHeight: theme.lineHeight.base,
178
+ uni__dependencies: [0]
179
+ },
180
+ row: (marker) => ({
181
+ flexDirection: "row",
182
+ gap: theme.spacing(2),
183
+ backgroundColor: marker === "+" ? theme.colors["tint-green"] : marker === "-" ? theme.colors["tint-red"] : void 0,
184
+ uni__dependencies: [0]
185
+ }),
186
+ mono: {
187
+ fontFamily: fontOf(theme.fontFamily.mono),
188
+ fontSize: theme.fontSize.sm,
189
+ lineHeight: theme.lineHeightRelaxed.sm,
190
+ uni__dependencies: [0]
191
+ },
192
+ gutter: {
193
+ color: theme.colors.faint,
194
+ uni__dependencies: [0]
195
+ },
196
+ ink: (marker) => ({
197
+ color: marker === "+" ? theme.colors.green : marker === "-" ? theme.colors.red : theme.colors.dim,
198
+ uni__dependencies: [0]
199
+ }),
200
+ content: {
201
+ flex: 1,
202
+ minWidth: 0
203
+ }
204
+ }));
205
+ //#endregion
206
+ //#region src/extensions/workspaces/sessions/(frontend)/tool/edit.native.tsx
207
+ var edit_native_default = defineToolRenderer({ message: EditToolMessage });
208
+ //#endregion
209
+ //#region generated/native.ts
210
+ const via = (identity, value) => value === void 0 ? void 0 : {
211
+ ...identity,
212
+ ...value
213
+ };
214
+ const nativePlugin = defineNativePlugin({
215
+ id: "edit",
216
+ session: { get toolRenderers() {
217
+ return [via({ tools: ["edit"] }, edit_native_default)];
218
+ } }
219
+ });
220
+ //#endregion
221
+ export { nativePlugin };
222
+
223
+ //# sourceMappingURL=native.mjs.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"native.mjs","names":["ToolMessageRenderProps","collapseLines","fontOf","MessageItem","MessageItemBody","MessageItemHeader","MessageItemStatus","SyntaxLine","ToolPathLink","toolTone","useSyntaxLines","PoNativeTheme","StyleSheet","DiffMarker","DiffRow","editCallView","editResultView","resultTextLines","COLLAPSED_ROWS","DiffRows","rows","gutter","path","spans","map","row","content","join","index","String","lineNumber","styles","marker","mono","padStart","ink","EditToolMessage","args","result","output","running","isError","fileTabFor","openTransientTab","call","view","undefined","tab","length","expanded","summary","onOpen","detail","ranges","line","error","shown","hidden","create","theme","flex","flexDirection","alignItems","gap","spacing","minWidth","uni__dependencies","flexShrink","color","colors","faint","fontFamily","sans","fontSize","base","lineHeight","red","backgroundColor","sm","lineHeightRelaxed","green","dim","toolEdit"],"sources":["../../src/extensions/workspaces/sessions/(frontend)/tool/_lib/editToolView.ts","../../src/extensions/workspaces/sessions/(frontend)/tool/_components/EditToolMessage.native.tsx","../../src/extensions/workspaces/sessions/(frontend)/tool/edit.native.tsx","../../generated/native.ts"],"sourcesContent":["import type { ToolResultView } from '@agimon-ai/po-core/web';\n\n/** Pi emits `+12 text`, `-12 text`, ` 12 text`, and a blank-numbered ` ... ` elision between hunks. */\nconst DIFF_ROW_PATTERN = /^([+\\- ])( *\\d*) (.*)$/u;\nconst CONTEXT_MARKER = ' ';\n\nexport type DiffMarker = '+' | '-' | typeof CONTEXT_MARKER;\n\nexport interface DiffRow {\n readonly marker: DiffMarker;\n readonly lineNumber: string;\n readonly content: string;\n}\n\nexport interface EditCallView {\n readonly path: string;\n /** `N range` or `N ranges`, the count the TUI's call heading shows. */\n readonly ranges: string;\n}\n\nexport interface EditResultView {\n readonly rows: readonly DiffRow[];\n /** Widest line number among the rows, in characters, sizing the gutter. */\n readonly gutter: number;\n}\n\n/** What the edit call heading shows: the path and how many ranges the call touches. */\nexport function editCallView(args: Readonly<Record<string, unknown>>): EditCallView {\n const count = Array.isArray(args.edits) ? args.edits.length : 0;\n return {\n path: typeof args.path === 'string' ? args.path : '',\n ranges: `${count} ${count === 1 ? 'range' : 'ranges'}`,\n };\n}\n\nfunction toDiffMarker(value: string | undefined): DiffMarker {\n return value === '+' || value === '-' ? value : CONTEXT_MARKER;\n}\n\n/** Pi's display diff as rows; a line that is not a diff row reads as unnumbered context. */\nexport function parseDiffRows(diff: string): DiffRow[] {\n return diff.split('\\n').map((line) => {\n const expanded = line.replaceAll('\\t', ' ');\n const match = DIFF_ROW_PATTERN.exec(expanded);\n if (!match) return { marker: CONTEXT_MARKER, lineNumber: '', content: expanded };\n return { marker: toDiffMarker(match[1]), lineNumber: (match[2] ?? '').trim(), content: match[3] ?? '' };\n });\n}\n\n/** The diff a successful edit carries in its details; undefined when the details never arrived. */\nexport function editResultView(result: ToolResultView | null): EditResultView | undefined {\n const details = result?.details;\n if (typeof details !== 'object' || details === null) return undefined;\n const diff = (details as { diff?: unknown }).diff;\n if (typeof diff !== 'string' || diff.length === 0) return undefined;\n const rows = parseDiffRows(diff);\n return { rows, gutter: rows.reduce((widest, row) => Math.max(widest, row.lineNumber.length), 1) };\n}\n\n/** The result's text lines, for the error case where the diff never happened. */\nexport function resultTextLines(result: ToolResultView | null, output: string): string[] {\n const text =\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 const lines = text.replaceAll('\\t', ' ').replaceAll('\\r\\n', '\\n').split('\\n');\n while (lines.at(-1) === '') lines.pop();\n return lines;\n}\n","import type { ToolMessageRenderProps } from '@agimon-ai/po-core/native';\nimport {\n collapseLines,\n fontOf,\n MessageItem,\n MessageItemBody,\n MessageItemHeader,\n MessageItemStatus,\n SyntaxLine,\n ToolPathLink,\n toolTone,\n useSyntaxLines,\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 { type DiffMarker, type DiffRow, editCallView, editResultView, resultTextLines } from '../_lib/editToolView';\n\n/** Diff rows shown until the item expands, as the web card. */\nconst COLLAPSED_ROWS = 24;\n\n/**\n * The banded rows and the grammar over them, as the web's DiffRows: parsed as\n * one document, so a replaced line is seen twice and may colour oddly, and the\n * `+`/`-` wash stays underneath so what changed is still legible.\n */\nfunction DiffRows({ rows, gutter, path }: { rows: readonly DiffRow[]; gutter: number; path: string }) {\n const spans = useSyntaxLines(rows.map((row) => row.content).join('\\n'), { path });\n return (\n <View>\n {rows.map((row, index) => (\n <View key={`${String(index)}-${row.lineNumber}`} style={styles.row(row.marker)}>\n <Text style={[styles.mono, styles.gutter]}>{row.lineNumber.padStart(gutter)}</Text>\n <Text style={[styles.mono, styles.ink(row.marker)]}>{row.marker}</Text>\n <SyntaxLine\n selectable\n spans={spans?.[index]}\n text={row.content}\n style={[styles.mono, styles.content, styles.ink(row.marker)]}\n />\n </View>\n ))}\n </View>\n );\n}\n\n/**\n * The edit tool's timeline item on native, as the web's EditToolMessage:\n * `path · N ranges` in the header, the display diff banded by row in the body,\n * and the tool's message in red when the edit failed.\n */\nexport function EditToolMessage({\n args,\n result,\n output,\n running,\n isError,\n fileTabFor,\n openTransientTab,\n}: ToolMessageRenderProps) {\n const call = editCallView(args);\n const view = result === null || isError ? undefined : editResultView(result);\n const tab = fileTabFor(call.path);\n return (\n <MessageItem\n tone={toolTone({ running, isError })}\n expandable={view !== undefined && view.rows.length > COLLAPSED_ROWS}\n >\n {({ expanded }) => (\n <>\n <MessageItemHeader title=\"edit\">\n <View testID=\"tool-call-edit\" style={styles.summary}>\n <ToolPathLink path={call.path} {...(tab === undefined ? {} : { onOpen: () => openTransientTab(tab) })} />\n <Text numberOfLines={1} style={styles.detail}>\n · {call.ranges}\n </Text>\n </View>\n </MessageItemHeader>\n {isError ? (\n <MessageItemBody testID=\"tool-result-edit\">\n <MessageItemStatus tone=\"error\">failed</MessageItemStatus>\n {resultTextLines(result, output).map((line, index) => (\n <Text key={`${String(index)}-${line}`} selectable style={styles.error}>\n {line}\n </Text>\n ))}\n </MessageItemBody>\n ) : view === undefined ? (\n running ? (\n <MessageItemBody testID=\"tool-result-edit\">\n <MessageItemStatus tone=\"running\">running</MessageItemStatus>\n </MessageItemBody>\n ) : null\n ) : (\n (() => {\n const { shown, hidden } = collapseLines(view.rows, COLLAPSED_ROWS, expanded);\n return (\n <MessageItemBody testID=\"tool-result-edit\">\n <DiffRows rows={shown} gutter={view.gutter} path={call.path} />\n {hidden > 0 ? <MessageItemStatus expands>{hidden} more rows</MessageItemStatus> : null}\n </MessageItemBody>\n );\n })()\n )}\n </>\n )}\n </MessageItem>\n );\n}\n\n// Po carries a diff on the background the way Magit does: a green wash on\n// added rows, a red wash on removed ones, and the foreground left to the text.\nconst styles = StyleSheet.create((theme: PoNativeTheme) => ({\n summary: { flex: 1, flexDirection: 'row', alignItems: 'center', gap: theme.spacing(2), minWidth: 0 },\n detail: {\n flexShrink: 0,\n color: theme.colors.faint,\n fontFamily: fontOf(theme.fontFamily.sans),\n fontSize: theme.fontSize.base,\n lineHeight: theme.lineHeight.base,\n },\n error: {\n color: theme.colors.red,\n fontFamily: fontOf(theme.fontFamily.sans),\n fontSize: theme.fontSize.base,\n lineHeight: theme.lineHeight.base,\n },\n row: (marker: DiffMarker) => ({\n flexDirection: 'row',\n gap: theme.spacing(2),\n backgroundColor:\n marker === '+' ? theme.colors['tint-green'] : marker === '-' ? theme.colors['tint-red'] : undefined,\n }),\n mono: {\n fontFamily: fontOf(theme.fontFamily.mono),\n fontSize: theme.fontSize.sm,\n lineHeight: theme.lineHeightRelaxed.sm,\n },\n gutter: { color: theme.colors.faint },\n ink: (marker: DiffMarker) => ({\n color: marker === '+' ? theme.colors.green : marker === '-' ? theme.colors.red : theme.colors.dim,\n }),\n content: { flex: 1, minWidth: 0 },\n}));\n","import { defineToolRenderer } from '@agimon-ai/po-core/native';\n\nimport { EditToolMessage } from './_components/EditToolMessage.native';\n\nexport default defineToolRenderer({ message: EditToolMessage });\n","// Generated by @agimon-ai/po-build. Do not edit by hand.\nimport { defineNativePlugin, type WebPluginContributions } from '@agimon-ai/po-core/native';\n\nimport toolEdit from '../src/extensions/workspaces/sessions/(frontend)/tool/edit.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: 'edit',\n session: {\n get toolRenderers(): WebPluginContributions['toolRenderers'] { return [via({ tools: ['edit'] }, toolEdit)]; },\n },\n});\n"],"mappings":";;;;;;;;AAGA,MAAM,mBAAmB;AACzB,MAAM,iBAAiB;;AAuBvB,SAAgB,aAAa,MAAuD;CAClF,MAAM,QAAQ,MAAM,QAAQ,KAAK,KAAK,IAAI,KAAK,MAAM,SAAS;CAC9D,OAAO;EACL,MAAM,OAAO,KAAK,SAAS,WAAW,KAAK,OAAO;EAClD,QAAQ,GAAG,MAAM,GAAG,UAAU,IAAI,UAAU;CAC9C;AACF;AAEA,SAAS,aAAa,OAAuC;CAC3D,OAAO,UAAU,OAAO,UAAU,MAAM,QAAQ;AAClD;;AAGA,SAAgB,cAAc,MAAyB;CACrD,OAAO,KAAK,MAAM,IAAI,CAAC,CAAC,KAAK,SAAS;EACpC,MAAM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;EAAE,OAAO,CAAC,IAAI,EAAE,OAAO,CAAC,MAAM,EAAE,GAAGiB,mBAAQ,CAAC;CAAG,EAC9G;AACF,CAAC"}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@agimon-ai/po-edit",
3
- "version": "0.0.0-alpha.21",
3
+ "version": "0.0.0-alpha.23",
4
4
  "description": "Snapshot-bound hashline edit tool for Pi and Po.",
5
5
  "keywords": [
6
6
  "ai",
@@ -42,6 +42,9 @@
42
42
  "import": "./dist/apiContracts.mjs",
43
43
  "require": "./dist/apiContracts.cjs"
44
44
  },
45
+ "./extensions/native": {
46
+ "import": "./dist/extensions/native.mjs"
47
+ },
45
48
  "./extensions/server": {
46
49
  "types": "./dist/extensions/server.d.mts",
47
50
  "import": "./dist/extensions/server.mjs",
@@ -56,15 +59,16 @@
56
59
  "access": "public"
57
60
  },
58
61
  "dependencies": {
59
- "@agimon-ai/po-core": "0.0.0-alpha.21",
60
- "@agimon-ai/po-hashline": "0.0.0-alpha.21",
61
- "@agimon-ai/po-ui": "0.0.0-alpha.21",
62
- "@agimon-ai/po-web-components": "0.0.0-alpha.21",
62
+ "@agimon-ai/po-core": "0.0.0-alpha.23",
63
+ "@agimon-ai/po-hashline": "0.0.0-alpha.23",
64
+ "@agimon-ai/po-ui": "0.0.0-alpha.23",
65
+ "@agimon-ai/po-web-components": "0.0.0-alpha.23",
63
66
  "@deepseek-ai/cordis": "4.0.5",
64
67
  "typebox": "1.3.37"
65
68
  },
66
69
  "devDependencies": {
67
- "@agimon-ai/po-build": "0.0.0-alpha.21",
70
+ "@agimon-ai/po-build": "0.0.0-alpha.23",
71
+ "@agimon-ai/po-native-components": "0.0.0-alpha.23",
68
72
  "@earendil-works/pi-coding-agent": "1.3.0",
69
73
  "@tanstack/react-store": "0.11.2",
70
74
  "@tanstack/store": "0.11.2",
@@ -73,16 +77,30 @@
73
77
  "@vitest/coverage-v8": "5.0.4",
74
78
  "react": "19.3.0",
75
79
  "react-dom": "19.3.0",
80
+ "react-native": "0.86.3",
81
+ "react-native-unistyles": "3.5.3",
76
82
  "tsdown": "0.23.1",
77
83
  "typescript": "7.0.2",
78
84
  "vitest": "5.0.4"
79
85
  },
80
86
  "peerDependencies": {
81
- "@earendil-works/pi-coding-agent": "1.3.0"
87
+ "@agimon-ai/po-native-components": "0.0.0-alpha.23",
88
+ "@earendil-works/pi-coding-agent": "1.3.0",
89
+ "react-native": "0.86.3",
90
+ "react-native-unistyles": "^3.5.3"
82
91
  },
83
92
  "peerDependenciesMeta": {
84
93
  "@earendil-works/pi-coding-agent": {
85
94
  "optional": true
95
+ },
96
+ "@agimon-ai/po-native-components": {
97
+ "optional": true
98
+ },
99
+ "react-native": {
100
+ "optional": true
101
+ },
102
+ "react-native-unistyles": {
103
+ "optional": true
86
104
  }
87
105
  },
88
106
  "engines": {
@@ -102,6 +120,14 @@
102
120
  ]
103
121
  }
104
122
  },
123
+ "poNative": {
124
+ "pluginId": "edit",
125
+ "channels": [],
126
+ "client": "./dist/extensions/native.mjs",
127
+ "scopes": [
128
+ "session"
129
+ ]
130
+ },
105
131
  "poServer": {
106
132
  "entry": "./generated/server.ts",
107
133
  "dist": "./dist/extensions/server.mjs",
@@ -125,7 +151,7 @@
125
151
  "build": "tsdown && tsdown --config tsdown.mcp.config.ts",
126
152
  "build:mcp": "tsdown --config tsdown.mcp.config.ts",
127
153
  "test": "vitest --run",
128
- "typecheck": "tsc --noEmit && tsc --noEmit -p tsconfig.web.json && tsc --noEmit -p tsconfig.mcp.json",
154
+ "typecheck": "tsc --noEmit && tsc --noEmit -p tsconfig.web.json && tsc --noEmit -p tsconfig.native.json && tsc --noEmit -p tsconfig.mcp.json",
129
155
  "lint": "oxlint . && oxfmt . --check",
130
156
  "fixcode": "oxlint . --fix && oxfmt ."
131
157
  }