@f5xc-salesdemos/xcsh 18.50.0 → 18.51.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": "@f5xc-salesdemos/xcsh",
4
- "version": "18.50.0",
4
+ "version": "18.51.0",
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.50.0",
52
- "@f5xc-salesdemos/pi-agent-core": "18.50.0",
53
- "@f5xc-salesdemos/pi-ai": "18.50.0",
54
- "@f5xc-salesdemos/pi-natives": "18.50.0",
55
- "@f5xc-salesdemos/pi-tui": "18.50.0",
56
- "@f5xc-salesdemos/pi-utils": "18.50.0",
51
+ "@f5xc-salesdemos/xcsh-stats": "18.51.0",
52
+ "@f5xc-salesdemos/pi-agent-core": "18.51.0",
53
+ "@f5xc-salesdemos/pi-ai": "18.51.0",
54
+ "@f5xc-salesdemos/pi-natives": "18.51.0",
55
+ "@f5xc-salesdemos/pi-tui": "18.51.0",
56
+ "@f5xc-salesdemos/pi-utils": "18.51.0",
57
57
  "@sinclair/typebox": "^0.34",
58
58
  "@xterm/headless": "^6.0",
59
59
  "ajv": "^8.18",
@@ -17,17 +17,17 @@ export interface BuildInfo {
17
17
  }
18
18
 
19
19
  export const BUILD_INFO: BuildInfo = {
20
- "version": "18.50.0",
21
- "commit": "026774fcc6c6e909bc5a3dffa6f1e019f7bb95d3",
22
- "shortCommit": "026774f",
20
+ "version": "18.51.0",
21
+ "commit": "26d7bec7de8e9a3619ed4f3219959ff1bc2c206f",
22
+ "shortCommit": "26d7bec",
23
23
  "branch": "main",
24
- "tag": "v18.50.0",
25
- "commitDate": "2026-05-08T23:09:25Z",
26
- "buildDate": "2026-05-08T23:30:02.931Z",
27
- "dirty": true,
24
+ "tag": "v18.51.0",
25
+ "commitDate": "2026-05-08T23:52:42Z",
26
+ "buildDate": "2026-05-09T00:19:09.023Z",
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/026774fcc6c6e909bc5a3dffa6f1e019f7bb95d3",
32
- "releaseUrl": "https://github.com/f5xc-salesdemos/xcsh/releases/tag/v18.50.0"
31
+ "commitUrl": "https://github.com/f5xc-salesdemos/xcsh/commit/26d7bec7de8e9a3619ed4f3219959ff1bc2c206f",
32
+ "releaseUrl": "https://github.com/f5xc-salesdemos/xcsh/releases/tag/v18.51.0"
33
33
  };
@@ -125,6 +125,10 @@ export interface SalesforceHint {
125
125
  partnerName?: string;
126
126
  /** Partner role label, e.g. 'AE', 'SE', 'CSM' */
127
127
  partnerRole?: string;
128
+ /** Org alias for SOQL queries, e.g. 'SFDC' */
129
+ orgAlias?: string;
130
+ /** Partner Salesforce UserId for AE-owned deal queries */
131
+ partnerId?: string;
128
132
  }
129
133
 
130
134
  // ---------------------------------------------------------------------------
@@ -483,6 +487,25 @@ export async function seedSalesforceContext(): Promise<SalesforceContext | null>
483
487
  }
484
488
 
485
489
  // ---------------------------------------------------------------------------
490
+ /** Format territory list with a character budget. If joined string exceeds budget, truncate with +N more. */
491
+ function formatTerritoryDisplay(territories: string[] | undefined, budget: number): string | undefined {
492
+ if (!territories?.length) return undefined;
493
+ const joined = territories.join(", ");
494
+ if (joined.length <= budget) return joined;
495
+ // Include as many territories as fit, leaving room for the "+N more" suffix
496
+ let result = territories[0];
497
+ let included = 1;
498
+ for (let i = 1; i < territories.length; i++) {
499
+ const candidate = `${result}, ${territories[i]}`;
500
+ // Reserve ~10 chars for ", +N more" suffix
501
+ if (candidate.length > budget - 10) break;
502
+ result = candidate;
503
+ included++;
504
+ }
505
+ const remaining = territories.length - included;
506
+ if (remaining > 0) result += `, +${remaining} more`;
507
+ return result;
508
+ }
486
509
  // Hint builder
487
510
  // ---------------------------------------------------------------------------
488
511
 
@@ -506,7 +529,9 @@ export function buildSalesforceHint(
506
529
  : ctx.confirmedTerritories?.length
507
530
  ? ctx.confirmedTerritories
508
531
  : ctx.territories?.slice(0, 3);
509
- const topTerritories = territorySource?.join(", ");
532
+ // Display budget: if joined string exceeds 60 chars, truncate with +N more
533
+ const TERRITORY_CHAR_BUDGET = 60;
534
+ const topTerritories = formatTerritoryDisplay(territorySource, TERRITORY_CHAR_BUDGET);
510
535
 
511
536
  // Forecast breakdown
512
537
  const byForecast = ctx.pipelineSummary.byForecast;
@@ -535,6 +560,8 @@ export function buildSalesforceHint(
535
560
  forecastBreakdown,
536
561
  partnerName,
537
562
  partnerRole,
563
+ orgAlias: ctx.orgAlias,
564
+ partnerId: partner?.id,
538
565
  };
539
566
  }
540
567
 
@@ -8,12 +8,12 @@ export interface SkuClassification {
8
8
 
9
9
  /** Default classification — discoverable from actual pipeline data. */
10
10
  export const DEFAULT_SKU_CLASSIFICATION: SkuClassification = {
11
- platform: ["F5-V-O", "F5-XC", "F5-FAS-WAF", "F5-FAS-API", "F5-UTIL", "F5-CST"],
11
+ platform: ["F5-V-O", "F5-XC", "F5-FAS-WAF", "F5-FAS-API", "F5-UTIL", "F5-CST", "F5-ELA"],
12
12
  shape: ["F5-SHP", "F5-FAS-BOT", "F5-FAS-DOS"],
13
13
  };
14
14
 
15
15
  /** All SKU prefixes that define the XC/Shape overlay product scope. */
16
- export const DEFAULT_SKU_PREFIXES = ["F5-V-O", "F5-XC", "F5-FAS", "F5-SHP", "F5-UTIL", "F5-CST"];
16
+ export const DEFAULT_SKU_PREFIXES = ["F5-V-O", "F5-XC", "F5-FAS", "F5-SHP", "F5-UTIL", "F5-CST", "F5-ELA"];
17
17
 
18
18
  export interface LineItemRecord {
19
19
  opportunityId: string;
@@ -160,7 +160,9 @@ Available F5 XC documentation topics: {{knowledgeTopics}}.
160
160
  {{/if}}
161
161
 
162
162
  {{#if salesforceHint}}
163
- `xcsh://salesforce`. {{salesforceHint.pipelineTotal}}{{#if salesforceHint.territories}} ({{salesforceHint.territories}}){{/if}}.{{#if salesforceHint.partnerName}} {{salesforceHint.partnerRole}}: {{salesforceHint.partnerName}}.{{/if}}{{#if salesforceHint.forecastBreakdown}} {{salesforceHint.forecastBreakdown}}.{{/if}}
163
+ `xcsh://salesforce`{{#if salesforceHint.orgAlias}} ({{salesforceHint.orgAlias}}){{/if}}. {{salesforceHint.pipelineTotal}}{{#if salesforceHint.territories}} ({{salesforceHint.territories}}){{/if}}.{{#if salesforceHint.partnerName}} {{salesforceHint.partnerRole}}: {{salesforceHint.partnerName}}.{{/if}}{{#if salesforceHint.forecastBreakdown}} {{salesforceHint.forecastBreakdown}}.{{/if}}
164
+
165
+ Pipeline queries: current fiscal quarter, team-member scoped, Commit/BestCase first. Do NOT dump all-time open pipeline.{{#if salesforceHint.orgAlias}} Always use target_org: {{salesforceHint.orgAlias}}.{{/if}}{{#if salesforceHint.partnerId}} AE UserId: {{salesforceHint.partnerId}}.{{/if}}
164
166
  {{/if}}
165
167
 
166
168
  {{#if contextFiles.length}}
@@ -5,11 +5,38 @@ Use for pipeline reporting, case management, account intelligence, and ad-hoc da
5
5
 
6
6
  Common query templates (substitute {userId} from user profile — read `xcsh://user` to get identifiers.salesforceId):
7
7
 
8
- Pipeline summary:
9
- SELECT StageName, COUNT(Id) TotalDeals, SUM(Amount) TotalAmount FROM Opportunity WHERE IsClosed = false GROUP BY StageName ORDER BY SUM(Amount) DESC LIMIT 50
8
+ In-quarter pipeline (current fiscal quarter, team-scoped):
9
+ SELECT Account.Name, Name, Amount, StageName, ForecastCategoryName, CloseDate, Owner.Name, LastActivityDate FROM Opportunity WHERE Id IN (SELECT OpportunityId FROM OpportunityTeamMember WHERE UserId = '{userId}') AND IsClosed = false AND CloseDate = THIS_FISCAL_QUARTER AND ForecastCategoryName <> 'Omitted' ORDER BY Amount DESC NULLS LAST LIMIT 50
10
10
 
11
- My open deals:
12
- SELECT Name, StageName, Amount, CloseDate, Account.Name FROM Opportunity WHERE OwnerId = '{userId}' AND IsClosed = false ORDER BY CloseDate LIMIT 50
11
+ Forecast breakdown (current quarter):
12
+ SELECT ForecastCategoryName, SUM(Amount) TotalAmount, COUNT(Id) TotalDeals FROM Opportunity WHERE Id IN (SELECT OpportunityId FROM OpportunityTeamMember WHERE UserId = '{userId}') AND IsClosed = false AND CloseDate = THIS_FISCAL_QUARTER AND ForecastCategoryName <> 'Omitted' GROUP BY ForecastCategoryName ORDER BY SUM(Amount) DESC
13
+
14
+ Closing within 30 days:
15
+ SELECT Account.Name, Name, Amount, StageName, ForecastCategoryName, CloseDate FROM Opportunity WHERE Id IN (SELECT OpportunityId FROM OpportunityTeamMember WHERE UserId = '{userId}') AND IsClosed = false AND CloseDate = NEXT_N_DAYS:30 ORDER BY CloseDate ASC LIMIT 20
16
+
17
+ Booked this quarter (closed-won):
18
+ SELECT Account.Name, Name, Amount, CloseDate FROM Opportunity WHERE Id IN (SELECT OpportunityId FROM OpportunityTeamMember WHERE UserId = '{userId}') AND IsWon = true AND CloseDate = THIS_FISCAL_QUARTER ORDER BY Amount DESC LIMIT 30
19
+
20
+ Slipped deals (close date in the past but recent — last 6 months):
21
+ SELECT Account.Name, Name, Amount, StageName, CloseDate FROM Opportunity WHERE Id IN (SELECT OpportunityId FROM OpportunityTeamMember WHERE UserId = '{userId}') AND IsClosed = false AND CloseDate < TODAY AND CloseDate = LAST_N_DAYS:180 ORDER BY Amount DESC NULLS LAST LIMIT 20
22
+
23
+ Commit deals only ("what's my commit"):
24
+ SELECT Account.Name, Name, Amount, StageName, CloseDate FROM Opportunity WHERE Id IN (SELECT OpportunityId FROM OpportunityTeamMember WHERE UserId = '{userId}') AND IsClosed = false AND CloseDate = THIS_FISCAL_QUARTER AND ForecastCategoryName = 'Commit' ORDER BY Amount DESC NULLS LAST LIMIT 20
25
+
26
+ Account pipeline ("show me [account]"):
27
+ SELECT Name, Amount, StageName, ForecastCategoryName, CloseDate FROM Opportunity WHERE Id IN (SELECT OpportunityId FROM OpportunityTeamMember WHERE UserId = '{userId}') AND IsClosed = false AND Account.Name LIKE '%{account}%' ORDER BY Amount DESC NULLS LAST LIMIT 20
28
+
29
+ Pipeline by account ("which accounts have the most pipeline"):
30
+ SELECT Account.Name, COUNT(Id) DealCount, SUM(Amount) TotalAmount FROM Opportunity WHERE Id IN (SELECT OpportunityId FROM OpportunityTeamMember WHERE UserId = '{userId}') AND IsClosed = false AND ForecastCategoryName <> 'Omitted' GROUP BY Account.Name ORDER BY SUM(Amount) DESC NULLS LAST LIMIT 15
31
+
32
+ Recently changed in-quarter deals ("what changed this week"):
33
+ SELECT Account.Name, Name, Amount, StageName, ForecastCategoryName, CloseDate, LastModifiedDate FROM Opportunity WHERE Id IN (SELECT OpportunityId FROM OpportunityTeamMember WHERE UserId = '{userId}') AND IsClosed = false AND CloseDate = THIS_FISCAL_QUARTER AND LastModifiedDate = LAST_N_DAYS:7 ORDER BY LastModifiedDate DESC LIMIT 20
34
+
35
+ Lost/abandoned deals this year:
36
+ SELECT Account.Name, Name, Amount, StageName, CloseDate FROM Opportunity WHERE Id IN (SELECT OpportunityId FROM OpportunityTeamMember WHERE UserId = '{userId}') AND IsClosed = true AND IsWon = false AND CloseDate = THIS_FISCAL_YEAR ORDER BY CloseDate DESC NULLS LAST LIMIT 20
37
+
38
+ Last quarter booked (closed-won):
39
+ SELECT Account.Name, Name, Amount, CloseDate FROM Opportunity WHERE Id IN (SELECT OpportunityId FROM OpportunityTeamMember WHERE UserId = '{userId}') AND IsWon = true AND CloseDate = LAST_FISCAL_QUARTER ORDER BY Amount DESC LIMIT 20
13
40
 
14
41
  Open cases:
15
42
  SELECT CaseNumber, Subject, Status, Priority, Account.Name, CreatedDate FROM Case WHERE IsClosed = false ORDER BY Priority, CreatedDate DESC LIMIT 50
@@ -17,6 +44,27 @@ Open cases:
17
44
  Account overview:
18
45
  SELECT Name, Industry, AnnualRevenue, Type, Owner.Name FROM Account WHERE Type = 'Customer' ORDER BY AnnualRevenue DESC LIMIT 50
19
46
 
47
+ Pipeline report structure — when user asks for "pipeline report", "forecast", or "what's my pipeline":
48
+ 1. Run forecast breakdown query first to get the shape of the quarter
49
+ 2. Executive summary: in-quarter total, Commit/Best Case/Pipeline split, booked-to-date
50
+ 3. Top deals by account within each forecast category (Commit first, then Best Case)
51
+ 4. At-risk: slipped deals (CloseDate < TODAY) and early-stage deals closing soon
52
+ 5. Booked this quarter — what has already closed
53
+ 6. Recommended actions — for each risk, suggest a concrete next step (exec sponsor call, POC timeline, close plan review)
54
+ Focus on in-quarter pipeline. Do NOT include deals closing in future quarters unless user asks.
55
+ Flag deals with close dates in the past — these are slipped and need attention.
56
+ Keep to 5-7 key metrics. A pipeline report is for action, not data inventory.
57
+
58
+ Audience-aware formatting — adjust output based on who will read it:
59
+ - **Self / AE partner:** Deal-level detail, close dates, stages, next technical actions.
60
+ - **Manager ("report for my manager"):** Lead with commit total + deal-level evidence. Then risks: what slipped, what's stalled, mitigation plan. No technical detail — managers need forecast confidence, not architecture.
61
+ - **Director/VP ("executive summary"):** Territory-level totals only. Commit/Best Case/Pipeline split. Coverage ratio if quota is known. One line per risk. No deal names unless asked.
62
+
63
+ Scoping: User may be an overlay SE. Use OpportunityTeamMember scoping (not OwnerId) as the primary filter.
64
+ AE-owned deals: SFDC does not allow OR with semi-join subselects. Run a SEPARATE query with OwnerId = '{aeId}' and merge results. Do not combine into one WHERE clause.
65
+
66
+ Stage-based filtering: Add WHERE StageName clauses to any template when the user asks about deals needing technical engagement, demos, POCs, or specific stages. Early stages: 'Awareness', 'Research and Internal Education', 'Pending Initial Meeting'. Active stages: 'Budget and Timing Determination', 'Solution - Front Runner'. Late stages: 'Negotiation', 'Close - Booked'. Deals in early stages with close dates within 60 days are at-risk (insufficient time to progress).
67
+
20
68
  Results with relationship fields (e.g., Account.Name) are automatically flattened into dot-notation columns.
21
69
  If the query returns more than 10,000 records, suggest using sf data export bulk instead.
22
70
  Set use_tooling_api to true when querying metadata objects (ApexTrigger, ApexClass, CustomField).
@@ -490,6 +490,10 @@ export interface BuildSystemPromptOptions {
490
490
  partnerName?: string;
491
491
  /** Partner role abbreviation: 'AE', 'SE', 'other' */
492
492
  partnerRole?: string;
493
+ /** Org alias for SOQL queries, e.g. 'SFDC' */
494
+ orgAlias?: string;
495
+ /** Partner Salesforce UserId for AE-owned deal queries */
496
+ partnerId?: string;
493
497
  };
494
498
  knowledgeTopics?: string;
495
499
  contextSkillDirs?: string[];