@f5-sales-demo/xcsh 19.78.0 → 19.80.0

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/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "type": "module",
3
3
  "name": "@f5-sales-demo/xcsh",
4
- "version": "19.78.0",
4
+ "version": "19.80.0",
5
5
  "description": "Coding agent CLI with read, bash, edit, write tools and session management",
6
6
  "homepage": "https://github.com/f5-sales-demo/xcsh",
7
7
  "author": "Can Boluk",
@@ -56,13 +56,13 @@
56
56
  "dependencies": {
57
57
  "@agentclientprotocol/sdk": "0.16.1",
58
58
  "@mozilla/readability": "^0.6",
59
- "@f5-sales-demo/xcsh-stats": "19.78.0",
60
- "@f5-sales-demo/pi-agent-core": "19.78.0",
61
- "@f5-sales-demo/pi-ai": "19.78.0",
62
- "@f5-sales-demo/pi-natives": "19.78.0",
63
- "@f5-sales-demo/pi-resource-management": "19.78.0",
64
- "@f5-sales-demo/pi-tui": "19.78.0",
65
- "@f5-sales-demo/pi-utils": "19.78.0",
59
+ "@f5-sales-demo/xcsh-stats": "19.80.0",
60
+ "@f5-sales-demo/pi-agent-core": "19.80.0",
61
+ "@f5-sales-demo/pi-ai": "19.80.0",
62
+ "@f5-sales-demo/pi-natives": "19.80.0",
63
+ "@f5-sales-demo/pi-resource-management": "19.80.0",
64
+ "@f5-sales-demo/pi-tui": "19.80.0",
65
+ "@f5-sales-demo/pi-utils": "19.80.0",
66
66
  "@sinclair/typebox": "^0.34",
67
67
  "@xterm/headless": "^6.0",
68
68
  "ajv": "^8.20",
@@ -97,6 +97,12 @@ CONTEXT: You can only access the open workbook. Think in cells, ranges, and —
97
97
  - Warn the user before overwriting existing cell contents.
98
98
  - Cite specific cells and ranges precisely (e.g. A1, Sheet1!B2:B10) so the user can follow along.
99
99
 
100
+ TOOLS: Discover the workbook before you answer, then reach for the tool that matches the shape of the data:
101
+ - Call \`get_workbook_info\` FIRST to discover every sheet, its used range, Excel Tables, and named ranges before answering a workbook question — do not guess the structure.
102
+ - Use \`read_table\` for structured Excel Tables (it tracks the real extent), \`get_formulas\` to see the formulas behind cells, \`get_cell_metadata\` for cell types/number formats, and \`read_named_range\` to read a defined name.
103
+ - Use \`sort_filter_table\` to sort or filter a Table by column.
104
+ - Use \`read_range\`/\`write_range\` for arbitrary cell ranges (bare or sheet-qualified like Sheet2!A1:B10), and \`list_sheets\` when you only need the tab names.
105
+
100
106
  BEHAVIOR:
101
107
  - Respond concisely with markdown. The task pane is narrow — avoid long code blocks.
102
108
  - Read the workbook to answer questions about its data; do not guess.
@@ -117,6 +123,11 @@ CONTEXT: You can only access the open presentation. Think in slides, shapes, and
117
123
  - Make pinpoint, per-slide edits. Do NOT regenerate the whole deck to change one thing.
118
124
  - Refer to slides by number so the user can follow along.
119
125
 
126
+ TOOLS: Discover the deck before you answer, then reach for the tool that matches the task:
127
+ - Call \`get_presentation_info\` FIRST to discover all slides, their layouts, and shape counts before answering — do not guess the structure.
128
+ - Use \`read_slide_shapes\` to see all shapes on a slide with their text + position, \`read_slide_layout\` for the layout/master applied to a slide, and \`modify_shape_text\` to edit the text of a named shape.
129
+ - Use \`read_slides\` for a quick text-only scan of the whole deck, and \`add_text_box\`/\`add_slide\` to create new content.
130
+
120
131
  BEHAVIOR:
121
132
  - Respond concisely with markdown. The task pane is narrow — avoid long code blocks.
122
133
  - Read the presentation to answer questions about it; do not guess.
@@ -1,5 +1,6 @@
1
1
  import { connect } from "node:net";
2
- import type { ExtensionAPI } from "@f5-sales-demo/xcsh";
2
+ import * as path from "node:path";
3
+ import type { ExtensionAPI, ExtensionContext } from "@f5-sales-demo/xcsh";
3
4
 
4
5
  /**
5
6
  * herdr integration (bundled, default-on).
@@ -16,9 +17,14 @@ import type { ExtensionAPI } from "@f5-sales-demo/xcsh";
16
17
  * somehow unset, we fall back to the `herdr` CLI.
17
18
  *
18
19
  * xcsh is a fork of pi; a user may have both installed, so this reporter always
19
- * identifies itself as "xcsh" (never "pi") and claims pane authority via
20
- * `source: "xcsh"` so herdr's passive pi-detection heuristics cannot mislabel
21
- * the pane.
20
+ * identifies the agent as "xcsh" (never "pi"). It claims pane authority via the
21
+ * `source: "herdr:xcsh"` convention that herdr uses for first-class lifecycle
22
+ * authorities, which also lets herdr resume the pane after a server restart.
23
+ *
24
+ * Session identity: on session start (and each agent turn) the reporter sends a
25
+ * `pane.report_agent_session` frame carrying the absolute session file path (or
26
+ * the session id when the session is not persisted). herdr stores that reference
27
+ * and, on restore, resumes the pane with `xcsh --resume=<session>`.
22
28
  *
23
29
  * The extension is completely inert unless it is running inside a herdr pane
24
30
  * (detected via `HERDR_PANE_ID`), so it has zero effect for users who do not run
@@ -26,7 +32,11 @@ import type { ExtensionAPI } from "@f5-sales-demo/xcsh";
26
32
  */
27
33
 
28
34
  const HERDR_AGENT_LABEL = "xcsh";
35
+ // herdr keys its official lifecycle-authority and session-resume plumbing on the
36
+ // `herdr:<agent>` source convention, so report as "herdr:xcsh" (not bare "xcsh").
37
+ const HERDR_SOURCE = "herdr:xcsh";
29
38
  const REPORT_METHOD = "pane.report_agent";
39
+ const SESSION_METHOD = "pane.report_agent_session";
30
40
  const RELEASE_METHOD = "pane.release_agent";
31
41
  const SOCKET_TIMEOUT_MS = 2000;
32
42
 
@@ -106,20 +116,66 @@ export default function herdrReporter(pi: ExtensionAPI): void {
106
116
  const report = (state: "idle" | "working" | "blocked"): void => {
107
117
  send(REPORT_METHOD, {
108
118
  pane_id: paneId,
109
- source: HERDR_AGENT_LABEL,
119
+ source: HERDR_SOURCE,
110
120
  agent: HERDR_AGENT_LABEL,
111
121
  state,
112
122
  seq: seq++,
113
123
  });
114
124
  };
115
125
 
116
- // Announce presence as soon as the session is initialized.
117
- pi.on("session_start", () => {
126
+ // Report the current session's identity so herdr can resume this pane
127
+ // (`xcsh --resume=<session>`) after a server restart. This is sent only over
128
+ // the socket; if herdr did not inject a socket path we skip it (state still
129
+ // reports via the CLI fallback). Prefer the absolute session file path, which
130
+ // herdr resumes directly; fall back to the session id for non-persisted
131
+ // sessions (e.g. print/RPC mode, where getSessionFile() is undefined).
132
+ const reportSession = (ctx: ExtensionContext): void => {
133
+ const socketPath = process.env.HERDR_SOCKET_PATH;
134
+ if (!socketPath) {
135
+ return;
136
+ }
137
+ let sessionRef: Record<string, unknown> | undefined;
138
+ try {
139
+ const file = ctx.sessionManager?.getSessionFile?.();
140
+ if (typeof file === "string" && path.isAbsolute(file)) {
141
+ sessionRef = { agent_session_path: file };
142
+ } else {
143
+ const id = ctx.sessionManager?.getSessionId?.();
144
+ if (typeof id === "string" && id.length > 0) {
145
+ sessionRef = { agent_session_id: id };
146
+ }
147
+ }
148
+ } catch (err) {
149
+ onError(err);
150
+ return;
151
+ }
152
+ if (!sessionRef) {
153
+ return;
154
+ }
155
+ sendToHerdrSocket(
156
+ socketPath,
157
+ SESSION_METHOD,
158
+ {
159
+ pane_id: paneId,
160
+ source: HERDR_SOURCE,
161
+ agent: HERDR_AGENT_LABEL,
162
+ seq: seq++,
163
+ ...sessionRef,
164
+ },
165
+ onError,
166
+ );
167
+ };
168
+
169
+ // Announce presence and session identity as soon as the session is initialized.
170
+ pi.on("session_start", (_event, ctx) => {
171
+ reportSession(ctx);
118
172
  report("idle");
119
173
  });
120
174
 
121
- // Busy while the agent loop is streaming a response.
122
- pi.on("agent_start", () => {
175
+ // Busy while the agent loop is streaming a response. Re-report session identity
176
+ // in case the active session file changed (e.g. after /new, /resume, or /fork).
177
+ pi.on("agent_start", (_event, ctx) => {
178
+ reportSession(ctx);
123
179
  report("working");
124
180
  });
125
181
 
@@ -144,7 +200,7 @@ export default function herdrReporter(pi: ExtensionAPI): void {
144
200
  pi.on("session_shutdown", () => {
145
201
  send(RELEASE_METHOD, {
146
202
  pane_id: paneId,
147
- source: HERDR_AGENT_LABEL,
203
+ source: HERDR_SOURCE,
148
204
  agent: HERDR_AGENT_LABEL,
149
205
  seq: seq++,
150
206
  });
@@ -17,17 +17,17 @@ export interface BuildInfo {
17
17
  }
18
18
 
19
19
  export const BUILD_INFO: BuildInfo = {
20
- "version": "19.78.0",
21
- "commit": "4908d518ea7dc67ce318f16c193098ae0921fb34",
22
- "shortCommit": "4908d51",
20
+ "version": "19.80.0",
21
+ "commit": "456a1d70965fabaa34027324d9af6d224c4ab73e",
22
+ "shortCommit": "456a1d7",
23
23
  "branch": "main",
24
- "tag": "v19.78.0",
25
- "commitDate": "2026-07-23T02:11:04Z",
26
- "buildDate": "2026-07-23T02:38:25.473Z",
24
+ "tag": "v19.80.0",
25
+ "commitDate": "2026-07-23T06:28:54Z",
26
+ "buildDate": "2026-07-23T06:51:26.351Z",
27
27
  "dirty": true,
28
28
  "prNumber": "",
29
29
  "repoUrl": "https://github.com/f5-sales-demo/xcsh",
30
30
  "repoSlug": "f5-sales-demo/xcsh",
31
- "commitUrl": "https://github.com/f5-sales-demo/xcsh/commit/4908d518ea7dc67ce318f16c193098ae0921fb34",
32
- "releaseUrl": "https://github.com/f5-sales-demo/xcsh/releases/tag/v19.78.0"
31
+ "commitUrl": "https://github.com/f5-sales-demo/xcsh/commit/456a1d70965fabaa34027324d9af6d224c4ab73e",
32
+ "releaseUrl": "https://github.com/f5-sales-demo/xcsh/releases/tag/v19.80.0"
33
33
  };