@f5xc-salesdemos/xcsh 18.33.2 → 18.33.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/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "type": "module",
3
3
  "name": "@f5xc-salesdemos/xcsh",
4
- "version": "18.33.2",
4
+ "version": "18.33.3",
5
5
  "description": "Coding agent CLI with read, bash, edit, write tools and session management",
6
6
  "homepage": "https://github.com/f5xc-salesdemos/xcsh",
7
7
  "author": "Can Boluk",
@@ -48,12 +48,12 @@
48
48
  "dependencies": {
49
49
  "@agentclientprotocol/sdk": "0.16.1",
50
50
  "@mozilla/readability": "^0.6",
51
- "@f5xc-salesdemos/xcsh-stats": "18.33.2",
52
- "@f5xc-salesdemos/pi-agent-core": "18.33.2",
53
- "@f5xc-salesdemos/pi-ai": "18.33.2",
54
- "@f5xc-salesdemos/pi-natives": "18.33.2",
55
- "@f5xc-salesdemos/pi-tui": "18.33.2",
56
- "@f5xc-salesdemos/pi-utils": "18.33.2",
51
+ "@f5xc-salesdemos/xcsh-stats": "18.33.3",
52
+ "@f5xc-salesdemos/pi-agent-core": "18.33.3",
53
+ "@f5xc-salesdemos/pi-ai": "18.33.3",
54
+ "@f5xc-salesdemos/pi-natives": "18.33.3",
55
+ "@f5xc-salesdemos/pi-tui": "18.33.3",
56
+ "@f5xc-salesdemos/pi-utils": "18.33.3",
57
57
  "@sinclair/typebox": "^0.34",
58
58
  "@xterm/headless": "^6.0",
59
59
  "ajv": "^8.18",
@@ -42,6 +42,7 @@ export function createApiCatalogResolver(
42
42
  const category = pathname.replace(/^\//, "").replace(/\/$/, "");
43
43
  const search = url.searchParams.get("search");
44
44
  const resourceName = url.searchParams.get("resource");
45
+ const compact = url.searchParams.get("compact") === "true";
45
46
 
46
47
  if (!category) {
47
48
  if (resourceName && specIndex) {
@@ -52,7 +53,7 @@ export function createApiCatalogResolver(
52
53
  if (categorySummaries.some(c => c.name === catName)) {
53
54
  try {
54
55
  const cat = decompress(catName);
55
- return makeResource(url, renderCatalogDetail(cat, index));
56
+ return makeResource(url, renderCatalogDetail(cat, index, { compact }));
56
57
  } catch {
57
58
  break;
58
59
  }
@@ -75,7 +76,7 @@ export function createApiCatalogResolver(
75
76
 
76
77
  try {
77
78
  const cat = decompress(category);
78
- return makeResource(url, renderCatalogDetail(cat, index));
79
+ return makeResource(url, renderCatalogDetail(cat, index, { compact }));
79
80
  } catch (err) {
80
81
  const message = err instanceof Error ? err.message : String(err);
81
82
  return makeResource(url, `# Error loading ${category}\n\n${message}\n`);
@@ -182,8 +183,10 @@ function formatDefault(defaultVal: unknown, serverDefault: boolean | undefined):
182
183
  return serverDefault ? `${val} (server)` : val;
183
184
  }
184
185
 
185
- function renderCatalogDetail(cat: ApiCatalogCategory, index: ApiCatalogIndex): string {
186
+ function renderCatalogDetail(cat: ApiCatalogCategory, index: ApiCatalogIndex, options?: { compact?: boolean }): string {
186
187
  const sections: string[] = [`# ${cat.displayName}`, "", `${cat.operations.length} operations.`];
188
+ let fieldConstraintsRenderedForOp: string | null = null;
189
+ let fieldConstraintsFingerprint: string | null = null;
187
190
 
188
191
  for (const op of cat.operations) {
189
192
  sections.push("", `## ${op.method.toUpperCase()} ${op.path}`, "");
@@ -230,17 +233,25 @@ function renderCatalogDetail(cat: ApiCatalogCategory, index: ApiCatalogIndex): s
230
233
  sections.push("", "```json", JSON.stringify(op.minimumPayload.json, null, 2), "```");
231
234
  }
232
235
 
233
- // Field Constraints (Tier 2)
234
- if (op.fieldMetadata && Object.keys(op.fieldMetadata).length > 0) {
235
- sections.push("", "### Field Constraints", "");
236
- sections.push("| Field | Type | Description | Constraint | Required For | Default |");
237
- sections.push("|-------|------|-------------|-----------|--------------|---------|");
238
- for (const [field, meta] of Object.entries(op.fieldMetadata)) {
239
- const desc = sanitizeTableCell(meta.description ?? "");
240
- const constraint = sanitizeTableCell(formatConstraints(meta.constraints));
241
- const reqFor = formatRequiredFor(meta.required_for);
242
- const def = sanitizeTableCell(formatDefault(meta.default, meta.serverDefault));
243
- sections.push(`| ${field} | ${meta.type} | ${desc} | ${constraint} | ${reqFor} | ${def} |`);
236
+ // Field Constraints (Tier 2) — skipped in compact mode, deduped when identical across operations
237
+ if (op.fieldMetadata && Object.keys(op.fieldMetadata).length > 0 && !options?.compact) {
238
+ const currentFingerprint = JSON.stringify(op.fieldMetadata);
239
+ if (fieldConstraintsRenderedForOp && currentFingerprint === fieldConstraintsFingerprint) {
240
+ sections.push("", "### Field Constraints");
241
+ sections.push(`Same as ${fieldConstraintsRenderedForOp} see above.`, "");
242
+ } else {
243
+ fieldConstraintsRenderedForOp = `${op.method.toUpperCase()} ${op.path}`;
244
+ fieldConstraintsFingerprint = currentFingerprint;
245
+ sections.push("", "### Field Constraints", "");
246
+ sections.push("| Field | Type | Description | Constraint | Required For | Default |");
247
+ sections.push("|-------|------|-------------|-----------|--------------|---------|");
248
+ for (const [field, meta] of Object.entries(op.fieldMetadata)) {
249
+ const desc = sanitizeTableCell(meta.description ?? "");
250
+ const constraint = sanitizeTableCell(formatConstraints(meta.constraints));
251
+ const reqFor = formatRequiredFor(meta.required_for);
252
+ const def = sanitizeTableCell(formatDefault(meta.default, meta.serverDefault));
253
+ sections.push(`| ${field} | ${meta.type} | ${desc} | ${constraint} | ${reqFor} | ${def} |`);
254
+ }
244
255
  }
245
256
  }
246
257
 
@@ -17,17 +17,17 @@ export interface BuildInfo {
17
17
  }
18
18
 
19
19
  export const BUILD_INFO: BuildInfo = {
20
- "version": "18.33.2",
21
- "commit": "200cfabfba89adc2b4f81d5bb06d1de4450454fa",
22
- "shortCommit": "200cfab",
20
+ "version": "18.33.3",
21
+ "commit": "ea081417a014b40c53422b3a51e062a13f035c5e",
22
+ "shortCommit": "ea08141",
23
23
  "branch": "main",
24
- "tag": "v18.33.2",
25
- "commitDate": "2026-05-02T23:44:24Z",
26
- "buildDate": "2026-05-03T00:06:13.623Z",
24
+ "tag": "v18.33.3",
25
+ "commitDate": "2026-05-03T05:25:43Z",
26
+ "buildDate": "2026-05-03T05:47:37.045Z",
27
27
  "dirty": false,
28
28
  "prNumber": "",
29
29
  "repoUrl": "https://github.com/f5xc-salesdemos/xcsh",
30
30
  "repoSlug": "f5xc-salesdemos/xcsh",
31
- "commitUrl": "https://github.com/f5xc-salesdemos/xcsh/commit/200cfabfba89adc2b4f81d5bb06d1de4450454fa",
32
- "releaseUrl": "https://github.com/f5xc-salesdemos/xcsh/releases/tag/v18.33.2"
31
+ "commitUrl": "https://github.com/f5xc-salesdemos/xcsh/commit/ea081417a014b40c53422b3a51e062a13f035c5e",
32
+ "releaseUrl": "https://github.com/f5xc-salesdemos/xcsh/releases/tag/v18.33.3"
33
33
  };
@@ -197,22 +197,26 @@ Most tools resolve custom protocol URLs to internal resources (not web URLs):
197
197
  When the user needs to **make an API call** (create, read, update, delete):
198
198
 
199
199
  1. `xcsh://api-catalog/?search={term}` → find the operation
200
- 2. `xcsh://api-catalog/{category}` → get curl template, minimum payload,
201
- field constraints, OneOf recommendations, and response summary
200
+ 2. `xcsh://api-catalog/{category}?compact=true` → get curl template, minimum payload,
201
+ OneOf recommendations, and response summary
202
202
 
203
203
  For POST/PUT operations, the catalog includes a ready-to-use JSON payload.
204
204
  Customize the payload with user-specified values (name, namespace, etc.),
205
205
  substitute path parameters (`{namespace}`, `{name}`) with actual values,
206
206
  insert the payload as the `-d` body in the curl template, and execute.
207
207
 
208
+ When the user needs **field-level validation rules** (constraints, patterns, enums):
209
+
210
+ 1. `xcsh://api-catalog/{category}` → full catalog with field constraints table
211
+
208
212
  When the user needs to **understand a schema** (field types, nested objects, request body structure):
209
213
 
210
214
  1. `xcsh://api-spec/{domain}?resource={name}` → full OpenAPI specification
211
215
  If the domain is unknown, read `xcsh://api-spec/` first to identify it.
212
216
 
213
217
  **MUST NOT** read proactively.
214
- Never start at `xcsh://api-spec/` for CRUD operations — it returns the full schema (~40K tokens)
215
- when the catalog provides the same endpoint with curl template (~700 tokens).
218
+ Never start at `xcsh://api-spec/` for CRUD operations — the catalog provides
219
+ the same endpoint with curl template at a fraction of the token cost.
216
220
  Never guess API paths or request schemas.
217
221
  Also available: `xcsh://api-spec/workflows/` (step-by-step guides),
218
222
  `xcsh://api-spec/errors/{code}` (error resolution), `xcsh://api-spec/glossary/` (acronym reference).