@agimon-ai/po-plan 0.0.0-alpha.1 → 0.0.0-alpha.3

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/config.cjs CHANGED
@@ -1,12 +1,42 @@
1
1
  Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
2
2
  const require_config = require("./config-D0iTexGm.cjs");
3
3
  let _agimon_ai_po_config = require("@agimon-ai/po-config");
4
- exports.getHarnessState = _agimon_ai_po_config.getHarnessState;
5
- exports.globalDoomConfigPath = _agimon_ai_po_config.globalDoomConfigPath;
4
+ Object.defineProperty(exports, "getHarnessState", {
5
+ enumerable: true,
6
+ get: function() {
7
+ return _agimon_ai_po_config.getHarnessState;
8
+ }
9
+ });
10
+ Object.defineProperty(exports, "globalDoomConfigPath", {
11
+ enumerable: true,
12
+ get: function() {
13
+ return _agimon_ai_po_config.globalDoomConfigPath;
14
+ }
15
+ });
6
16
  exports.loadDoomConfig = require_config.loadDoomConfig;
7
- exports.loadHarnessState = _agimon_ai_po_config.loadHarnessState;
17
+ Object.defineProperty(exports, "loadHarnessState", {
18
+ enumerable: true,
19
+ get: function() {
20
+ return _agimon_ai_po_config.loadHarnessState;
21
+ }
22
+ });
8
23
  exports.mergeDoomConfigs = require_config.mergeDoomConfigs;
9
24
  exports.parseDoomConfig = require_config.parseDoomConfig;
10
- exports.parsePlanningModeConfig = _agimon_ai_po_config.parsePlanningModeConfig;
11
- exports.repositoryDoomConfigPath = _agimon_ai_po_config.repositoryDoomConfigPath;
12
- exports.resolvePlanningPlansDirectory = _agimon_ai_po_config.resolvePlanningPlansDirectory;
25
+ Object.defineProperty(exports, "parsePlanningModeConfig", {
26
+ enumerable: true,
27
+ get: function() {
28
+ return _agimon_ai_po_config.parsePlanningModeConfig;
29
+ }
30
+ });
31
+ Object.defineProperty(exports, "repositoryDoomConfigPath", {
32
+ enumerable: true,
33
+ get: function() {
34
+ return _agimon_ai_po_config.repositoryDoomConfigPath;
35
+ }
36
+ });
37
+ Object.defineProperty(exports, "resolvePlanningPlansDirectory", {
38
+ enumerable: true,
39
+ get: function() {
40
+ return _agimon_ai_po_config.resolvePlanningPlansDirectory;
41
+ }
42
+ });
package/dist/config.mjs CHANGED
@@ -1,2 +1 @@
1
- import { a as mergeDoomConfigs, c as repositoryDoomConfigPath, i as loadHarnessState, l as resolvePlanningPlansDirectory, n as globalDoomConfigPath, o as parseDoomConfig, r as loadDoomConfig, s as parsePlanningModeConfig, t as getHarnessState } from "./config-BC-Tou05.mjs";
2
- export { getHarnessState, globalDoomConfigPath, loadDoomConfig, loadHarnessState, mergeDoomConfigs, parseDoomConfig, parsePlanningModeConfig, repositoryDoomConfigPath, resolvePlanningPlansDirectory };
1
+ export { t as getHarnessState, n as globalDoomConfigPath, r as loadDoomConfig, i as loadHarnessState, a as mergeDoomConfigs, o as parseDoomConfig, s as parsePlanningModeConfig, c as repositoryDoomConfigPath, l as resolvePlanningPlansDirectory } from "./config-BC-Tou05.mjs";
@@ -0,0 +1,386 @@
1
+ import { createApiClient, defineActivityGroup, defineFill, defineNativePlugin, nativeApiTransport, sessionApiAddress } from "@agimon-ai/po-core/native";
2
+ import { View } from "react-native-unistyles/components/native/View";
3
+ import { Text } from "react-native-unistyles/components/native/Text";
4
+ import { Button, ListRow, Markdown, SegmentedControl, Textarea, fontOf } from "@agimon-ai/po-native-components";
5
+ import { StyleSheet } from "react-native-unistyles";
6
+ import { ScrollView } from "react-native-unistyles/components/native/ScrollView";
7
+ import { useEffect, useState } from "react";
8
+ import { Fragment, jsx, jsxs } from "react/jsx-runtime";
9
+ //#region src/types/planApi.ts
10
+ /**
11
+ * Footer status key the session publishes once a plan exists, which is what
12
+ * makes the cockpit's activity group appear at all. It outlives plan mode: the
13
+ * plan is most worth reading while the agent implements it.
14
+ */
15
+ const PLAN_STATUS_KEY = "doom-plan-document";
16
+ [{
17
+ label: "Exit plan mode and start implementation",
18
+ value: "exit"
19
+ }, {
20
+ label: "Continue planning",
21
+ value: "continue"
22
+ }].map((choice) => choice.label);
23
+ /** Between the plan's title and the stamp that marks a rewrite. */
24
+ const STATUS_SEPARATOR = " · ";
25
+ /** Strips the colour a session may have themed a status with. */
26
+ const ANSI = /\[[0-9;]*m/gu;
27
+ /**
28
+ * Reading the status line back. Statuses reach a plugin raw, so the colour a
29
+ * session may have added comes off here. A title can itself contain the
30
+ * separator, so the stamp is taken from the last one rather than the first.
31
+ */
32
+ function parsePlanStatus(raw) {
33
+ if (raw === void 0) return void 0;
34
+ const text = raw.replace(ANSI, "").trim();
35
+ if (text === "") return void 0;
36
+ const cut = text.lastIndexOf(STATUS_SEPARATOR);
37
+ if (cut === -1) return {
38
+ title: text,
39
+ stamp: ""
40
+ };
41
+ return {
42
+ title: text.slice(0, cut).trim(),
43
+ stamp: text.slice(cut + 3).trim()
44
+ };
45
+ }
46
+ //#endregion
47
+ //#region src/extensions/workspaces/sessions/(frontend)/activity-group/plan.native.ts
48
+ var plan_native_default = defineActivityGroup({
49
+ name: "plan",
50
+ keys: "p e",
51
+ statusKey: PLAN_STATUS_KEY,
52
+ marksBackgroundWork: false,
53
+ order: 25
54
+ });
55
+ const api = createApiClient({
56
+ current: {
57
+ method: "GET",
58
+ path: "/current",
59
+ response: void 0
60
+ },
61
+ save: {
62
+ method: "PUT",
63
+ path: "/content",
64
+ response: void 0
65
+ }
66
+ }, {
67
+ scopes: ["session"],
68
+ basePath: "plans",
69
+ transport: nativeApiTransport,
70
+ sessionAddress: sessionApiAddress
71
+ });
72
+ //#endregion
73
+ //#region src/extensions/workspaces/sessions/(frontend)/fill/_lib/planApi.native.ts
74
+ /**
75
+ * The page's half of this package's session API: the current plan, and the
76
+ * manual save.
77
+ *
78
+ * These are adapters now, not a transport. The generated client owns the URL
79
+ * and the sealed transport with it, so nothing here spells a route or reaches
80
+ * for `fetch`. What stays is this package's own vocabulary: which refusals the
81
+ * reader is shown, and the stale-save contract the editor depends on.
82
+ */
83
+ const UNREACHABLE = "The session is unreachable.";
84
+ const NO_PLAN = "This session has not written a plan yet.";
85
+ function isRecord(value) {
86
+ return typeof value === "object" && value !== null && !Array.isArray(value);
87
+ }
88
+ /** The message a reader is shown: the route's own words, or why there were none. */
89
+ function messageOf(result) {
90
+ if (result.status === 0) return UNREACHABLE;
91
+ return result.error === "" ? `The session answered ${String(result.status)}.` : result.error;
92
+ }
93
+ async function fetchPlan(sessionId) {
94
+ const result = await api.session(sessionId).current();
95
+ if (result.status === 404) return {
96
+ ok: false,
97
+ error: result.ok || result.error === "" ? NO_PLAN : result.error
98
+ };
99
+ if (!result.ok) return {
100
+ ok: false,
101
+ error: messageOf(result)
102
+ };
103
+ if (!isRecord(result.data)) return {
104
+ ok: false,
105
+ error: "The session answered with no plan."
106
+ };
107
+ return {
108
+ ok: true,
109
+ detail: result.data
110
+ };
111
+ }
112
+ async function savePlan(sessionId, expectedHash, content) {
113
+ const result = await api.session(sessionId).save({ body: {
114
+ expectedHash,
115
+ content
116
+ } });
117
+ if (result.status === 409) {
118
+ const data = result.ok ? void 0 : result.data;
119
+ const hash = isRecord(data) && typeof data.hash === "string" ? data.hash : void 0;
120
+ return {
121
+ ok: false,
122
+ stale: true,
123
+ error: result.ok ? "The plan changed since it was opened." : messageOf(result),
124
+ ...hash === void 0 ? {} : { hash }
125
+ };
126
+ }
127
+ if (!result.ok) return {
128
+ ok: false,
129
+ stale: false,
130
+ error: messageOf(result)
131
+ };
132
+ return {
133
+ ok: true,
134
+ hash: isRecord(result.data) && typeof result.data.hash === "string" ? result.data.hash : ""
135
+ };
136
+ }
137
+ //#endregion
138
+ //#region src/extensions/workspaces/sessions/(frontend)/fill/_components/PlanPanel.native.tsx
139
+ const PLAN_TAB_ID = "plan-document";
140
+ /** The saved plan, with edits guarded by its on-disk hash, never a caller-supplied path. */
141
+ function PlanPanel({ sessionId, statuses, closeTransientTab, fileTabFor, openTransientTab }) {
142
+ const [detail, setDetail] = useState();
143
+ const [error, setError] = useState();
144
+ const [loading, setLoading] = useState(true);
145
+ const [view, setView] = useState("preview");
146
+ const [draft, setDraft] = useState();
147
+ const [saving, setSaving] = useState(false);
148
+ const [note, setNote] = useState();
149
+ const revision = statuses[PLAN_STATUS_KEY];
150
+ useEffect(() => {
151
+ if (sessionId === null) return;
152
+ let cancelled = false;
153
+ fetchPlan(sessionId).then((result) => {
154
+ if (cancelled) return;
155
+ setLoading(false);
156
+ if (result.ok) {
157
+ setDetail(result.detail);
158
+ setError(void 0);
159
+ setDraft(void 0);
160
+ setNote(void 0);
161
+ } else {
162
+ setDetail(void 0);
163
+ setError(result.error);
164
+ }
165
+ }).catch((failure) => {
166
+ if (!cancelled) {
167
+ setLoading(false);
168
+ setError(failure instanceof Error ? failure.message : String(failure));
169
+ }
170
+ });
171
+ return () => {
172
+ cancelled = true;
173
+ };
174
+ }, [sessionId, revision]);
175
+ const save = async () => {
176
+ if (sessionId === null || !detail || draft === void 0 || detail.unavailable || saving) return;
177
+ setSaving(true);
178
+ try {
179
+ const result = await savePlan(sessionId, detail.hash, draft);
180
+ if (!result.ok) {
181
+ setNote(result.error);
182
+ return;
183
+ }
184
+ setNote("saved");
185
+ const refreshed = await fetchPlan(sessionId);
186
+ if (refreshed.ok) {
187
+ setDetail(refreshed.detail);
188
+ setDraft(void 0);
189
+ } else setError(refreshed.error);
190
+ } catch (failure) {
191
+ setNote(failure instanceof Error ? failure.message : String(failure));
192
+ } finally {
193
+ setSaving(false);
194
+ }
195
+ };
196
+ return /* @__PURE__ */ jsxs(ScrollView, {
197
+ contentContainerStyle: styles$1.panel,
198
+ testID: "plan-panel",
199
+ children: [
200
+ /* @__PURE__ */ jsx(Text, {
201
+ style: styles$1.title,
202
+ children: detail?.title ?? "plan"
203
+ }),
204
+ /* @__PURE__ */ jsx(SegmentedControl, {
205
+ accessibilityLabel: "plan view",
206
+ options: [{
207
+ value: "preview",
208
+ label: "preview"
209
+ }, {
210
+ value: "source",
211
+ label: "source"
212
+ }],
213
+ value: view,
214
+ onValueChange: setView
215
+ }),
216
+ sessionId === null ? /* @__PURE__ */ jsx(Text, {
217
+ style: styles$1.meta,
218
+ children: "Select a session."
219
+ }) : loading && !detail ? /* @__PURE__ */ jsx(Text, {
220
+ style: styles$1.meta,
221
+ children: "reading this session's plan…"
222
+ }) : null,
223
+ error ? /* @__PURE__ */ jsx(Text, {
224
+ accessibilityRole: "alert",
225
+ style: styles$1.error,
226
+ children: error
227
+ }) : null,
228
+ detail ? detail.unavailable ? /* @__PURE__ */ jsx(Text, {
229
+ style: styles$1.meta,
230
+ children: detail.reason ?? "this plan cannot be shown"
231
+ }) : view === "preview" ? /* @__PURE__ */ jsx(Markdown, {
232
+ text: draft ?? detail.content,
233
+ onFileLink: (path) => {
234
+ const tab = fileTabFor(path);
235
+ return tab ? () => openTransientTab(tab) : void 0;
236
+ }
237
+ }) : /* @__PURE__ */ jsxs(Fragment, { children: [
238
+ /* @__PURE__ */ jsx(Textarea, {
239
+ accessibilityLabel: "plan source",
240
+ value: draft ?? detail.content,
241
+ onChangeText: setDraft,
242
+ numberOfLines: 12
243
+ }),
244
+ /* @__PURE__ */ jsxs(View, {
245
+ style: styles$1.actions,
246
+ children: [/* @__PURE__ */ jsx(Button, {
247
+ variant: "primary",
248
+ disabled: draft === void 0 || saving,
249
+ onPress: () => void save(),
250
+ children: "save to disk"
251
+ }), draft !== void 0 ? /* @__PURE__ */ jsx(Button, {
252
+ variant: "ghost",
253
+ onPress: () => setDraft(void 0),
254
+ children: "discard edits"
255
+ }) : null]
256
+ }),
257
+ note ? /* @__PURE__ */ jsx(Text, {
258
+ style: note === "saved" ? styles$1.success : styles$1.error,
259
+ children: note
260
+ }) : null
261
+ ] }) : null,
262
+ detail ? /* @__PURE__ */ jsx(Text, {
263
+ selectable: true,
264
+ style: styles$1.path,
265
+ children: detail.path
266
+ }) : null,
267
+ /* @__PURE__ */ jsx(Button, {
268
+ variant: "ghost",
269
+ onPress: () => closeTransientTab(PLAN_TAB_ID),
270
+ children: "close"
271
+ })
272
+ ]
273
+ });
274
+ }
275
+ function planTab() {
276
+ return {
277
+ id: PLAN_TAB_ID,
278
+ label: "plan",
279
+ panel: PlanPanel
280
+ };
281
+ }
282
+ const styles$1 = StyleSheet.create((theme) => ({
283
+ panel: {
284
+ padding: theme.spacing(4),
285
+ gap: theme.spacing(3),
286
+ uni__dependencies: [0]
287
+ },
288
+ title: {
289
+ fontFamily: fontOf(theme.fontFamily.sans),
290
+ fontSize: theme.fontSize.lg,
291
+ lineHeight: theme.lineHeight.lg,
292
+ fontWeight: "600",
293
+ color: theme.colors.hi,
294
+ uni__dependencies: [0]
295
+ },
296
+ meta: {
297
+ fontSize: theme.fontSize.sm,
298
+ lineHeight: theme.lineHeight.sm,
299
+ color: theme.colors.dim,
300
+ uni__dependencies: [0]
301
+ },
302
+ path: {
303
+ fontFamily: fontOf(theme.fontFamily.mono),
304
+ fontSize: theme.fontSize.sm,
305
+ color: theme.colors.dim,
306
+ uni__dependencies: [0]
307
+ },
308
+ error: {
309
+ fontSize: theme.fontSize.sm,
310
+ color: theme.colors.red,
311
+ uni__dependencies: [0]
312
+ },
313
+ success: {
314
+ fontSize: theme.fontSize.sm,
315
+ color: theme.colors.green,
316
+ uni__dependencies: [0]
317
+ },
318
+ actions: {
319
+ flexDirection: "row",
320
+ flexWrap: "wrap",
321
+ gap: theme.spacing(2),
322
+ uni__dependencies: [0]
323
+ }
324
+ }));
325
+ //#endregion
326
+ //#region src/extensions/workspaces/sessions/(frontend)/fill/_components/PlanActivitySection.native.tsx
327
+ /** The document row, not its group header, is the way into a saved plan. */
328
+ function PlanActivitySection({ sessionId, statuses, openTransientTab }) {
329
+ const view = parsePlanStatus(statuses[PLAN_STATUS_KEY]);
330
+ if (!view) return /* @__PURE__ */ jsx(Text, {
331
+ style: styles.meta,
332
+ children: "no plan written yet"
333
+ });
334
+ return /* @__PURE__ */ jsxs(View, {
335
+ testID: "activity-plan",
336
+ children: [/* @__PURE__ */ jsx(ListRow, {
337
+ title: view.title,
338
+ description: view.stamp || void 0,
339
+ disabled: sessionId === null,
340
+ onPress: () => {
341
+ if (sessionId !== null) openTransientTab(planTab());
342
+ }
343
+ }), /* @__PURE__ */ jsx(Text, {
344
+ style: styles.meta,
345
+ children: "open to read or edit; the agent reads what you save."
346
+ })]
347
+ });
348
+ }
349
+ const styles = StyleSheet.create((theme) => ({ meta: {
350
+ fontFamily: fontOf(theme.fontFamily.sans),
351
+ fontSize: theme.fontSize.sm,
352
+ lineHeight: theme.lineHeight.sm,
353
+ color: theme.colors.dim,
354
+ uni__dependencies: [0]
355
+ } }));
356
+ //#endregion
357
+ //#region src/extensions/workspaces/sessions/(frontend)/fill/Plan.activity.plan.native.tsx
358
+ var Plan_activity_plan_native_default = defineFill({
359
+ slot: "activity.plan",
360
+ id: "plan",
361
+ component: PlanActivitySection
362
+ });
363
+ //#endregion
364
+ //#region generated/native.ts
365
+ const via = (identity, value) => value === void 0 ? void 0 : {
366
+ ...identity,
367
+ ...value
368
+ };
369
+ const nativePlugin = defineNativePlugin({
370
+ id: "plan",
371
+ session: {
372
+ get activityGroups() {
373
+ return [via({ name: "plan" }, plan_native_default)];
374
+ },
375
+ get fills() {
376
+ return [via({
377
+ slot: "activity.plan",
378
+ id: "plan"
379
+ }, Plan_activity_plan_native_default)];
380
+ }
381
+ }
382
+ });
383
+ //#endregion
384
+ export { nativePlugin };
385
+
386
+ //# sourceMappingURL=native.mjs.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"native.mjs","names":["WebPluginSlotProps","Button","Markdown","SegmentedControl","Textarea","fontOf","PoNativeTheme","useEffect","useState","StyleSheet","PLAN_STATUS_KEY","PlanDetailView","fetchPlan","savePlan","PLAN_TAB_ID","PlanPanel","sessionId","statuses","closeTransientTab","fileTabFor","openTransientTab","detail","setDetail","error","setError","loading","setLoading","view","setView","draft","setDraft","saving","setSaving","note","setNote","revision","cancelled","then","result","ok","undefined","catch","failure","Error","message","String","save","unavailable","hash","refreshed","styles","panel","title","value","label","meta","reason","content","path","tab","actions","success","planTab","Parameters","id","create","theme","padding","spacing","gap","uni__dependencies","fontFamily","sans","fontSize","lg","lineHeight","fontWeight","color","colors","hi","sm","dim","mono","red","green","flexDirection","flexWrap","styles","WebPluginSlotProps","ListRow","fontOf","PoNativeTheme","StyleSheet","parsePlanStatus","PLAN_STATUS_KEY","planTab","PlanActivitySection","sessionId","statuses","openTransientTab","view","styles","meta","title","stamp","undefined","create","theme","fontFamily","sans","fontSize","sm","lineHeight","color","colors","dim","uni__dependencies","activityGroupPlan","fillPlan"],"sources":["../../src/types/planApi.ts","../../src/extensions/workspaces/sessions/(frontend)/activity-group/plan.native.ts","../../src/types/apiRoutes.ts","../../generated/client.native.ts","../../src/extensions/workspaces/sessions/(frontend)/fill/_lib/planApi.native.ts","../../src/extensions/workspaces/sessions/(frontend)/fill/_components/PlanPanel.native.tsx","../../src/extensions/workspaces/sessions/(frontend)/fill/_components/PlanActivitySection.native.tsx","../../src/extensions/workspaces/sessions/(frontend)/fill/Plan.activity.plan.native.tsx","../../generated/native.ts"],"sourcesContent":["/**\n * The wire vocabulary this package's API shares with whatever calls it.\n *\n * It lives under src/types because that is the one server root a browser\n * bundle may read: the routes answer with these shapes and the cockpit plugin\n * reads them, so neither half can drift from the other. The paths themselves\n * are not here; they are declared once in `./apiRoutes`, which the Hono app\n * and the generated client both read.\n *\n * Two routes, and neither takes a path. A session has one current plan, so\n * `current` answers it and `content` takes the manual save back; the file they\n * act on is the one write_plan recorded, never one the page named. That is\n * also why there is nothing to escape here: a reader cannot address a second\n * file through these URLs.\n */\n\n/** Where a host mounts this package's API; the segment after /api/plugins/. */\nexport const API_BASE_PATH = 'plans';\n\n/**\n * Footer status key the session publishes once a plan exists, which is what\n * makes the cockpit's activity group appear at all. It outlives plan mode: the\n * plan is most worth reading while the agent implements it.\n */\nexport const PLAN_STATUS_KEY = 'doom-plan-document';\n\n/** The selector contract shared by complete_plan and its cockpit composer prompt. */\nexport const PLAN_REVIEW_TITLE = 'Plan complete. What would you like to do?';\nexport const EXIT_PLAN_MODE_CHOICE = 'Exit plan mode and start implementation';\nexport const CONTINUE_PLANNING_CHOICE = 'Continue planning';\nexport const EXIT_PLAN_DECISION = 'exit';\nexport const CONTINUE_PLAN_DECISION = 'continue';\n\n/**\n * The label the reader sees paired with the decision the tool acts on. A headless\n * client answers with `value`, so a facet never has to recognise the wording; Pi's\n * own `ui.select` carries labels only, so its half maps the label back itself.\n */\nexport const PLAN_REVIEW_CHOICES = [\n { label: EXIT_PLAN_MODE_CHOICE, value: EXIT_PLAN_DECISION },\n { label: CONTINUE_PLANNING_CHOICE, value: CONTINUE_PLAN_DECISION },\n] as const;\n\n/** The same options as bare labels, which is all Pi's select and the composer prompt need. */\nexport const PLAN_REVIEW_OPTIONS = PLAN_REVIEW_CHOICES.map((choice) => choice.label);\n\n/** Between the plan's title and the stamp that marks a rewrite. */\nconst STATUS_SEPARATOR = ' · ';\n\n/** Strips the colour a session may have themed a status with. */\nconst ANSI = /\u001b\\[[0-9;]*m/gu;\n\n/** The status line the session publishes; the stamp changes on every write. */\nexport function formatPlanStatus(title: string, stamp: string): string {\n return `${title}${STATUS_SEPARATOR}${stamp}`;\n}\n\n/** What a reader gets out of the status line. */\nexport interface PlanStatusView {\n title: string;\n /** When the plan was last written, as the session worded it; empty when it said nothing. */\n stamp: string;\n}\n\n/**\n * Reading the status line back. Statuses reach a plugin raw, so the colour a\n * session may have added comes off here. A title can itself contain the\n * separator, so the stamp is taken from the last one rather than the first.\n */\nexport function parsePlanStatus(raw: string | undefined): PlanStatusView | undefined {\n if (raw === undefined) return undefined;\n const text = raw.replace(ANSI, '').trim();\n if (text === '') return undefined;\n const cut = text.lastIndexOf(STATUS_SEPARATOR);\n if (cut === -1) return { title: text, stamp: '' };\n return { title: text.slice(0, cut).trim(), stamp: text.slice(cut + STATUS_SEPARATOR.length).trim() };\n}\n\n/**\n * What write_plan recorded about this session's plan.\n *\n * The absolute path is the point of it: the extension resolves the plans\n * directory against the harness root, which no other process knows, so it\n * writes down where the plan landed rather than leaving the API to derive a\n * location it would sometimes get wrong.\n */\nexport interface PlanPointerRecord {\n path: string;\n title: string;\n writtenAt: string;\n planId?: string;\n}\n\n/** The plan as it stands on disk right now, which is what the source view edits. */\nexport interface PlanDetailView {\n path: string;\n title: string;\n writtenAt: string;\n planId?: string;\n content: string;\n /** sha256 of the content; the token a save hands back to prove it is not stale. */\n hash: string;\n /** True when the plan is missing or past the size cap, so `content` is empty. */\n unavailable: boolean;\n reason?: string;\n}\n\n/** What the save route takes. */\nexport interface PlanSaveRequest {\n /** The hash the reader loaded; a mismatch means the plan moved underneath them. */\n expectedHash: string;\n content: string;\n}\n\n/** What the save route answers with. */\nexport interface PlanSaveView {\n hash: string;\n}\n\n/** What a route reports when it refuses; the page shows `error` verbatim. */\nexport interface PlanErrorView {\n error: string;\n /** On a stale save, the hash the plan actually has now. */\n hash?: string;\n}\n","import { defineActivityGroup } from '@agimon-ai/po-core/native';\n\nimport { PLAN_STATUS_KEY } from '../../../../../types/planApi';\n\n// Keyed off the saved plan rather than the mode because the plan remains useful\n// while it is being implemented after the read-only mode exits.\nexport default defineActivityGroup({\n name: 'plan',\n keys: 'p e',\n statusKey: PLAN_STATUS_KEY,\n marksBackgroundWork: false,\n order: 25,\n});\n","import type { ApiResponseOf, ApiRoutes } from '@agimon-ai/po-core/web';\n\nimport type { PlanDetailView, PlanSaveView } from './planApi';\n\n/**\n * This package's routes, as data.\n *\n * No scope and no base path. The build reads both off\n * `src/extensions/workspaces/sessions/(backend)/api/plans/`, so the mount is\n * stated once, by the folder that creates it. The paths used to be written\n * here as helpers, again in the contract, and again inside every URL the page\n * built, and the copies were free to disagree.\n *\n * This is the one file the routes, the Hono app and the browser all read, so a\n * path cannot move on one side alone.\n *\n * Neither route takes a query or a path parameter: a session has one current\n * plan, so `current` answers it and `save` takes the manual write back.\n */\nconst routes = {\n current: {\n method: 'GET',\n path: '/current',\n response: undefined as unknown as ApiResponseOf<PlanDetailView>,\n },\n save: {\n method: 'PUT',\n path: '/content',\n response: undefined as unknown as ApiResponseOf<PlanSaveView>,\n },\n} as const satisfies ApiRoutes;\n\nexport default routes;\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 'plans' at. */\nexport const apiScopes = ['session'] as const;\n\nexport const api = createApiClient(routes, {\n scopes: apiScopes,\n basePath: 'plans',\n transport: nativeApiTransport,\n sessionAddress: sessionApiAddress,\n});\n","import { api } from '../../../../../../../generated/client.native';\nimport type { PlanDetailView } from '../../../../../../types/planApi';\n\n/**\n * The page's half of this package's session API: the current plan, and the\n * manual save.\n *\n * These are adapters now, not a transport. The generated client owns the URL\n * and the sealed transport with it, so nothing here spells a route or reaches\n * for `fetch`. What stays is this package's own vocabulary: which refusals the\n * reader is shown, and the stale-save contract the editor depends on.\n */\n\nconst UNREACHABLE = 'The session is unreachable.';\nconst NO_PLAN = 'This session has not written a plan yet.';\n\nfunction isRecord(value: unknown): value is Record<string, unknown> {\n return typeof value === 'object' && value !== null && !Array.isArray(value);\n}\n\n/** The message a reader is shown: the route's own words, or why there were none. */\nfunction messageOf(result: { status: number; error: string }): string {\n if (result.status === 0) return UNREACHABLE;\n return result.error === '' ? `The session answered ${String(result.status)}.` : result.error;\n}\n\nexport type FetchPlanResult = { ok: true; detail: PlanDetailView } | { ok: false; error: string };\n\nexport async function fetchPlan(sessionId: string): Promise<FetchPlanResult> {\n const result = await api.session(sessionId).current();\n // A session that has written nothing answers 404, which is not a failure the\n // reader should be shown as one.\n if (result.status === 404) return { ok: false, error: result.ok || result.error === '' ? NO_PLAN : result.error };\n if (!result.ok) return { ok: false, error: messageOf(result) };\n if (!isRecord(result.data)) return { ok: false, error: 'The session answered with no plan.' };\n return { ok: true, detail: result.data };\n}\n\nexport type SavePlanResult =\n | { ok: true; hash: string }\n /** The plan moved under the editor; `hash` is what it holds now. */\n | { ok: false; stale: true; error: string; hash?: string }\n | { ok: false; stale: false; error: string };\n\nexport async function savePlan(sessionId: string, expectedHash: string, content: string): Promise<SavePlanResult> {\n const result = await api.session(sessionId).save({ body: { expectedHash, content } });\n // The agent can rewrite the plan while a reader is still editing it. A moved\n // hash is the one refusal the editor recovers from, so it is read before the\n // generic failure.\n if (result.status === 409) {\n const data = result.ok ? undefined : result.data;\n const hash = isRecord(data) && typeof data.hash === 'string' ? data.hash : undefined;\n return {\n ok: false,\n stale: true,\n error: result.ok ? 'The plan changed since it was opened.' : messageOf(result),\n ...(hash === undefined ? {} : { hash }),\n };\n }\n if (!result.ok) return { ok: false, stale: false, error: messageOf(result) };\n return { ok: true, hash: isRecord(result.data) && typeof result.data.hash === 'string' ? result.data.hash : '' };\n}\n","import type { WebPluginSlotProps } from '@agimon-ai/po-core/native';\nimport { Button, Markdown, SegmentedControl, Textarea, fontOf } from '@agimon-ai/po-native-components';\nimport type { PoNativeTheme } from '@agimon-ai/po-web-components/nativeTheme';\nimport { useEffect, useState } from 'react';\nimport { ScrollView, Text, View } from 'react-native';\nimport { StyleSheet } from 'react-native-unistyles';\n\nimport { PLAN_STATUS_KEY, type PlanDetailView } from '../../../../../../types/planApi';\nimport { fetchPlan, savePlan } from '../_lib/planApi.native';\n\nexport const PLAN_TAB_ID = 'plan-document';\n\n/** The saved plan, with edits guarded by its on-disk hash, never a caller-supplied path. */\nexport function PlanPanel({\n sessionId,\n statuses,\n closeTransientTab,\n fileTabFor,\n openTransientTab,\n}: WebPluginSlotProps) {\n const [detail, setDetail] = useState<PlanDetailView>();\n const [error, setError] = useState<string>();\n const [loading, setLoading] = useState(true);\n const [view, setView] = useState('preview');\n const [draft, setDraft] = useState<string>();\n const [saving, setSaving] = useState(false);\n const [note, setNote] = useState<string>();\n const revision = statuses[PLAN_STATUS_KEY];\n useEffect(() => {\n if (sessionId === null) return;\n let cancelled = false;\n void fetchPlan(sessionId)\n .then((result) => {\n if (cancelled) return;\n setLoading(false);\n if (result.ok) {\n setDetail(result.detail);\n setError(undefined);\n setDraft(undefined);\n setNote(undefined);\n } else {\n setDetail(undefined);\n setError(result.error);\n }\n })\n .catch((failure: unknown) => {\n if (!cancelled) {\n setLoading(false);\n setError(failure instanceof Error ? failure.message : String(failure));\n }\n });\n return () => {\n cancelled = true;\n };\n }, [sessionId, revision]);\n\n const save = async () => {\n if (sessionId === null || !detail || draft === undefined || detail.unavailable || saving) return;\n setSaving(true);\n try {\n const result = await savePlan(sessionId, detail.hash, draft);\n if (!result.ok) {\n setNote(result.error);\n return;\n }\n setNote('saved');\n const refreshed = await fetchPlan(sessionId);\n if (refreshed.ok) {\n setDetail(refreshed.detail);\n setDraft(undefined);\n } else setError(refreshed.error);\n } catch (failure) {\n setNote(failure instanceof Error ? failure.message : String(failure));\n } finally {\n setSaving(false);\n }\n };\n\n return (\n <ScrollView contentContainerStyle={styles.panel} testID=\"plan-panel\">\n <Text style={styles.title}>{detail?.title ?? 'plan'}</Text>\n <SegmentedControl\n accessibilityLabel=\"plan view\"\n options={[\n { value: 'preview', label: 'preview' },\n { value: 'source', label: 'source' },\n ]}\n value={view}\n onValueChange={setView}\n />\n {sessionId === null ? (\n <Text style={styles.meta}>Select a session.</Text>\n ) : loading && !detail ? (\n <Text style={styles.meta}>reading this session's plan…</Text>\n ) : null}\n {error ? (\n <Text accessibilityRole=\"alert\" style={styles.error}>\n {error}\n </Text>\n ) : null}\n {detail ? (\n detail.unavailable ? (\n <Text style={styles.meta}>{detail.reason ?? 'this plan cannot be shown'}</Text>\n ) : view === 'preview' ? (\n <Markdown\n text={draft ?? detail.content}\n onFileLink={(path) => {\n const tab = fileTabFor(path);\n return tab ? () => openTransientTab(tab) : undefined;\n }}\n />\n ) : (\n <>\n <Textarea\n accessibilityLabel=\"plan source\"\n value={draft ?? detail.content}\n onChangeText={setDraft}\n numberOfLines={12}\n />\n <View style={styles.actions}>\n <Button variant=\"primary\" disabled={draft === undefined || saving} onPress={() => void save()}>\n save to disk\n </Button>\n {draft !== undefined ? (\n <Button variant=\"ghost\" onPress={() => setDraft(undefined)}>\n discard edits\n </Button>\n ) : null}\n </View>\n {note ? <Text style={note === 'saved' ? styles.success : styles.error}>{note}</Text> : null}\n </>\n )\n ) : null}\n {detail ? (\n <Text selectable style={styles.path}>\n {detail.path}\n </Text>\n ) : null}\n <Button variant=\"ghost\" onPress={() => closeTransientTab(PLAN_TAB_ID)}>\n close\n </Button>\n </ScrollView>\n );\n}\n\nexport function planTab(): Parameters<WebPluginSlotProps['openTransientTab']>[0] {\n return { id: PLAN_TAB_ID, label: 'plan', panel: PlanPanel };\n}\n\nconst styles = StyleSheet.create((theme: PoNativeTheme) => ({\n panel: { padding: theme.spacing(4), gap: theme.spacing(3) },\n title: {\n fontFamily: fontOf(theme.fontFamily.sans),\n fontSize: theme.fontSize.lg,\n lineHeight: theme.lineHeight.lg,\n fontWeight: '600',\n color: theme.colors.hi,\n },\n meta: { fontSize: theme.fontSize.sm, lineHeight: theme.lineHeight.sm, color: theme.colors.dim },\n path: { fontFamily: fontOf(theme.fontFamily.mono), fontSize: theme.fontSize.sm, color: theme.colors.dim },\n error: { fontSize: theme.fontSize.sm, color: theme.colors.red },\n success: { fontSize: theme.fontSize.sm, color: theme.colors.green },\n actions: { flexDirection: 'row', flexWrap: 'wrap', gap: theme.spacing(2) },\n}));\n","import type { WebPluginSlotProps } from '@agimon-ai/po-core/native';\nimport { ListRow, fontOf } 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 { parsePlanStatus, PLAN_STATUS_KEY } from '../../../../../../types/planApi';\nimport { planTab } from './PlanPanel.native';\n\n/** The document row, not its group header, is the way into a saved plan. */\nexport function PlanActivitySection({ sessionId, statuses, openTransientTab }: WebPluginSlotProps) {\n const view = parsePlanStatus(statuses[PLAN_STATUS_KEY]);\n if (!view) return <Text style={styles.meta}>no plan written yet</Text>;\n return (\n <View testID=\"activity-plan\">\n <ListRow\n title={view.title}\n description={view.stamp || undefined}\n disabled={sessionId === null}\n onPress={() => {\n if (sessionId !== null) openTransientTab(planTab());\n }}\n />\n <Text style={styles.meta}>open to read or edit; the agent reads what you save.</Text>\n </View>\n );\n}\n\nconst styles = StyleSheet.create((theme: PoNativeTheme) => ({\n meta: {\n fontFamily: fontOf(theme.fontFamily.sans),\n fontSize: theme.fontSize.sm,\n lineHeight: theme.lineHeight.sm,\n color: theme.colors.dim,\n },\n}));\n","import { defineFill } from '@agimon-ai/po-core/native';\n\nimport { PlanActivitySection } from './_components/PlanActivitySection.native';\n\nexport default defineFill({ slot: 'activity.plan', id: 'plan', component: PlanActivitySection });\n","// Generated by @agimon-ai/po-build. Do not edit by hand.\nimport { defineNativePlugin, type WebPluginContributions } from '@agimon-ai/po-core/native';\n\nimport activityGroupPlan from '../src/extensions/workspaces/sessions/(frontend)/activity-group/plan.native';\nimport fillPlan from '../src/extensions/workspaces/sessions/(frontend)/fill/Plan.activity.plan.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: 'plan',\n session: {\n get activityGroups(): WebPluginContributions['activityGroups'] { return [via({ name: 'plan' }, activityGroupPlan)]; },\n get fills(): WebPluginContributions['fills'] { return [via({ slot: 'activity.plan', id: 'plan' }, fillPlan)]; },\n },\n});\n"],"mappings":";;;;;;;;;;;;;;AAwBA,MAAa,kBAAkB;AAoBI,CALjC;CAAE,OAAO;CAAuB,OAAO;AAAmB,GAC1D;CAAE,OAAO;CAA0B,OAAO;AAAuB,CAIhC,CAAA,CAAoB,KAAK,WAAW,OAAO,KAAK;;AAGnF,MAAM,mBAAmB;;AAGzB,MAAM,OAAO;;;;;;AAmBb,SAAgB,gBAAgB,KAAqD;CACnF,IAAI,QAAQ,KAAA,GAAW,OAAO,KAAA;CAC9B,MAAM,OAAO,IAAI,QAAQ,MAAM,EAAE,C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AI;GAAO,GAAGC,iCAAQ,CAAC;EAAG;CAChH;AACF,CAAC"}
@@ -41,7 +41,6 @@ node_os = __toESM(node_os, 1);
41
41
  let node_path = require("node:path");
42
42
  node_path = __toESM(node_path, 1);
43
43
  let _agimon_ai_po_core_piSettings = require("@agimon-ai/po-core/piSettings");
44
- let _agimon_ai_po_core_web = require("@agimon-ai/po-core/web");
45
44
  let _agimon_ai_po_core_voiceTools = require("@agimon-ai/po-core/voiceTools");
46
45
  let _agimon_ai_po_minor_mode = require("@agimon-ai/po-minor-mode");
47
46
  let _agimon_ai_po_config = require("@agimon-ai/po-config");
@@ -153,18 +152,18 @@ var PlanPointerService = class {
153
152
  * Neither route takes a query or a path parameter: a session has one current
154
153
  * plan, so `current` answers it and `save` takes the manual write back.
155
154
  */
156
- var apiRoutes_default = (0, _agimon_ai_po_core_web.defineApiRoutes)({
155
+ const routes = {
157
156
  current: {
158
157
  method: "GET",
159
158
  path: "/current",
160
- response: (0, _agimon_ai_po_core_web.apiResponse)()
159
+ response: void 0
161
160
  },
162
161
  save: {
163
162
  method: "PUT",
164
163
  path: "/content",
165
- response: (0, _agimon_ai_po_core_web.apiResponse)()
164
+ response: void 0
166
165
  }
167
- });
166
+ };
168
167
  //#endregion
169
168
  //#region src/types/planApi.ts
170
169
  /**
@@ -273,7 +272,7 @@ function createPlanApi(options = {}) {
273
272
  const app = new hono.Hono();
274
273
  const pointers = options.pointers ?? new PlanPointerService({ env: process.env });
275
274
  const pointerFor = () => options.sessionId === void 0 ? void 0 : pointers.read(options.sessionId);
276
- app.get(apiRoutes_default.current.path, async (context) => {
275
+ app.get(routes.current.path, async (context) => {
277
276
  const pointer = pointerFor();
278
277
  if (pointer === void 0) return context.json({ error: NO_PLAN }, 404);
279
278
  const view = {
@@ -285,7 +284,7 @@ function createPlanApi(options = {}) {
285
284
  };
286
285
  return context.json(view);
287
286
  });
288
- app.put(apiRoutes_default.save.path, async (context) => {
287
+ app.put(routes.save.path, async (context) => {
289
288
  let request;
290
289
  try {
291
290
  request = await context.req.json();