salai 0.1.4 → 0.1.5

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/README.md CHANGED
@@ -8,10 +8,10 @@ npx salai retailers
8
8
  npx salai cart add 7290019489443
9
9
  ```
10
10
 
11
- ## What's New in v0.1.4
11
+ ## What's New in v0.1.5
12
12
 
13
- - `salai fulfill` — one-call shopping list quotes (MCP `fulfill_shopping_list`)
14
- - Richer `--help` (including `salai fulfill --help`) and README guidance for AI agents
13
+ - `salai shopping-list` — alias for `salai fulfill`; same MCP tool `fulfill_shopping_list` (shopping list quote)
14
+ - README aligned with the SalAi monorepo package; agent integration section cleanup
15
15
 
16
16
  ## Agent Integration
17
17
 
@@ -29,10 +29,10 @@ See:
29
29
 
30
30
  ## Using with AI agents
31
31
 
32
- Same idea as [dev-browser’s agent workflow](https://github.com/SawyerHood/dev-browser?tab=readme-ov-file#using-with-ai-agents): **have the agent read `--help`** so it sees every flag and the extra notes we embed for automation.
32
+ **Have the agent read `--help`** so it sees every flag and the extra notes we embed for automation.
33
33
 
34
34
  1. **`salai --help`** — command list plus a short reminder to use `--json` and subcommand help.
35
- 2. **`salai <command> --help`** — all options for that command. Shopping lists: **`salai fulfill --help`** (includes CLI vs full MCP tool, examples, billing errors).
35
+ 2. **`salai <command> --help`** — all options for that command. Shopping lists: **`salai shopping-list --help`** (includes CLI vs full MCP tool, examples, billing errors).
36
36
  3. **`salai tools --json`** — tool names and schemas as returned by the live server.
37
37
 
38
38
  For MCP fields that are not CLI flags (structured `items`, `scope.stores` with `mode: explicit`, `resolution.policy`, `alternatives.maxPerItem`, `llmRawListExtraction`, `includeDiagnostics`, etc.), use:
@@ -55,6 +55,30 @@ To reduce permission prompts, pre-approve the CLI in `.claude/settings.json` (pr
55
55
 
56
56
  ## Install
57
57
 
58
+ ### Option 1: Agent skill (recommended)
59
+
60
+ Skill source: [github.com/Salai-app/salai-cli](https://github.com/Salai-app/salai-cli) (`skills/salai-cli`).
61
+
62
+ ```bash
63
+ npx skills add Salai-app/salai-cli
64
+ ```
65
+
66
+ Uses [`npx skills`](https://github.com/vercel-labs/skills) (Vercel Labs). It detects your installed coding agents (OpenCode, Claude Code, Codex, Cursor, and [40+ more](https://github.com/vercel-labs/skills#supported-agents)) and installs the skill to the right location.
67
+
68
+ Install globally (available across all projects):
69
+
70
+ ```bash
71
+ npx skills add Salai-app/salai-cli -g
72
+ ```
73
+
74
+ Target a specific agent:
75
+
76
+ ```bash
77
+ npx skills add Salai-app/salai-cli -a claude-code -g
78
+ ```
79
+
80
+ ### Option 2: CLI only
81
+
58
82
  ```bash
59
83
  # Use directly with npx (no install needed)
60
84
  npx salai <command>
@@ -102,12 +126,12 @@ salai ac <query> # Alias
102
126
  --method <text|semantic> # Search method (default text)
103
127
  ```
104
128
 
105
- ### Fulfill (shopping list quote)
129
+ ### Shopping list (shopping-list / fulfill)
106
130
 
107
- Resolves a list, compares baskets across stores, returns ranked stores (MCP `fulfill_shopping_list`). **Does not require a selected store.** Prefer **`salai fulfill --help`** for the full agent-oriented help text.
131
+ Resolves a list, compares baskets across stores, returns ranked stores (MCP `fulfill_shopping_list`). **Does not require a selected store.** Prefer **`salai shopping-list --help`** for the full agent-oriented help text.
108
132
 
109
133
  ```bash
110
- salai fulfill [items...] # Inline list (comma-separated) or use --file
134
+ salai shopping-list [items...] # Inline list (comma-separated) or use --file (alias: salai fulfill)
111
135
  --scope <mode> # online_only (default) | all_active
112
136
  --max-stores <n> # Cap stores compared (default 10)
113
137
  --file <path> # Newline-separated list file
@@ -118,6 +142,8 @@ salai fulfill [items...] # Inline list (comma-separated) or use --file
118
142
  salai call fulfill_shopping_list --args '{"items":[...],"scope":{"mode":"explicit","stores":[...]}}' --json
119
143
  ```
120
144
 
145
+ Same command as `salai fulfill …` (legacy name).
146
+
121
147
  ### Pricing
122
148
 
123
149
  ```bash
@@ -5,7 +5,8 @@ import { outputResult, outputRaw } from '../formatters/index.js';
5
5
  export function registerFulfillCommands(program, getClient, isJson) {
6
6
  program
7
7
  .command('fulfill [items...]')
8
- .description('Find the best store for a shopping list. ' +
8
+ .alias('shopping-list')
9
+ .description('Shopping list quote: find the best store for a list. ' +
9
10
  'Pass items inline (comma/space separated) or via --file.')
10
11
  .addOption(new Option('--scope <mode>', 'Store universe: online_only (default) or all_active. For explicit store IDs use salai call.')
11
12
  .choices(['online_only', 'all_active'])
@@ -48,15 +49,17 @@ export function registerFulfillCommands(program, getClient, isJson) {
48
49
  await client.close();
49
50
  })
50
51
  .addHelpText('after', `
51
- Global options (same as root salai --help; often placed after the subcommand, e.g. salai fulfill "…" --json)
52
+ Global options (same as root salai --help; often placed after the subcommand, e.g. salai shopping-list "…" --json)
52
53
  -k, --api-key <key> Salai API key (or SALAI_API_KEY env)
53
54
  --url <url> MCP endpoint URL (or SALAI_MCP_URL env)
54
55
  --json Raw JSON output instead of formatted tables
55
56
 
57
+ Command names: salai shopping-list and salai fulfill are the same (zero breaking; fulfill is the canonical name in help).
58
+
56
59
  Agent / automation
57
60
  Use --json on every invoke so output matches MCP structured payloads.
58
61
 
59
- fulfill does not use the selected store (quote mode is fully request-scoped).
62
+ This command does not use the selected store (quote mode is fully request-scoped).
60
63
  Higher token cost than search; errors may include TOKEN_LIMIT_REACHED or RATE_LIMIT_EXCEEDED.
61
64
 
62
65
  CLI vs full MCP tool
@@ -68,9 +71,10 @@ CLI vs full MCP tool
68
71
  llmRawListExtraction (default true on server for rawList), includeDiagnostics, mode (quote).
69
72
 
70
73
  Examples
71
- salai fulfill "חלב, לחם, ביצים" --json
72
- salai fulfill --file ./list.txt --scope all_active --max-stores 5 --json
73
- salai fulfill "חלב" --brand-strict --no-alternatives --json
74
+ salai shopping-list "חלב, לחם, ביצים" --json
75
+ salai shopping-list --file ./list.txt --scope all_active --max-stores 5 --json
76
+ salai shopping-list "חלב" --brand-strict --no-alternatives --json
77
+ salai fulfill "חלב, לחם" --json
74
78
  salai call fulfill_shopping_list --args '{"items":[{"query":"חלב","quantity":2}],"scope":{"mode":"online_only","maxStores":3}}' --json
75
79
  `);
76
80
  }
@@ -1 +1 @@
1
- {"version":3,"file":"fulfill.js","sourceRoot":"","sources":["../../src/commands/fulfill.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,YAAY,EAAE,MAAM,IAAI,CAAC;AAClC,OAAO,EAAW,MAAM,EAAE,MAAM,WAAW,CAAC;AAE5C,OAAO,EAAE,QAAQ,EAAE,MAAM,iBAAiB,CAAC;AAC3C,OAAO,EAAE,YAAY,EAAE,SAAS,EAAE,MAAM,wBAAwB,CAAC;AAEjE,MAAM,UAAU,uBAAuB,CACrC,OAAgB,EAChB,SAAgC,EAChC,MAAqB;IAErB,OAAO;SACJ,OAAO,CAAC,oBAAoB,CAAC;SAC7B,WAAW,CACV,2CAA2C;QACzC,0DAA0D,CAC7D;SACA,SAAS,CACR,IAAI,MAAM,CACR,gBAAgB,EAChB,6FAA6F,CAC9F;SACE,OAAO,CAAC,CAAC,aAAa,EAAE,YAAY,CAAC,CAAC;SACtC,OAAO,CAAC,aAAa,CAAC,CAC1B;SACA,MAAM,CAAC,kBAAkB,EAAE,kEAAkE,EAAE,IAAI,CAAC;SACpG,MAAM,CAAC,eAAe,EAAE,kDAAkD,CAAC;SAC3E,MAAM,CAAC,gBAAgB,EAAE,+DAA+D,CAAC;SACzF,MAAM,CAAC,mBAAmB,EAAE,6DAA6D,CAAC;SAC1F,MAAM,CAAC,KAAK,EAAE,WAAqB,EAAE,IAAI,EAAE,EAAE;QAC5C,MAAM,MAAM,GAAG,MAAM,SAAS,EAAE,CAAC;QAEjC,IAAI,OAA2B,CAAC;QAChC,IAAI,IAAI,CAAC,IAAI,EAAE,CAAC;YACd,OAAO,GAAG,YAAY,CAAC,IAAI,CAAC,IAAI,EAAE,OAAO,CAAC,CAAC;QAC7C,CAAC;aAAM,IAAI,WAAW,CAAC,MAAM,GAAG,CAAC,EAAE,CAAC;YAClC,OAAO,GAAG,WAAW,CAAC,IAAI,CAAC,IAAI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AAK;gBAChB,SAAS,EAAE,QAAQ,CAAC,IAAI,CAAC,SAAS,EAAE,EAAE,CAAC,IAAI,EAAE;aAC9C;YACD,YAAY,EAAE;gBACZ,OAAO,EAAE,IAAI,CAAC,YAAY,KAAK,KAAK;aACrC;YACD,IAAI,EAAE,OAAO;SACd,CAAC;QAEF,IAAI,IAAI,CAAC,WAAW,EAAE,CAAC;YACpB,IAAI,CAAC,YAAwC,CAAC,MAAM,GAAG,YAAY,CAAC;QACvE,CAAC;QAED,MAAM,MAAM,GAAG,MAAM,QAAQ,CAAC,MAAM,EAAE,uBAAuB,EAAE,IAAI,CAAC,CAAC;QACrE,MAAM,EAAE,CAAC,CAAC,CAAC,SAAS,CAAC,MAAM,CAAC,CAAC,CAAC,CAAC,YAAY,CAAC,MAAM,EAAE,uBAAuB,CAAC,CAAC;QAC7E,MAAM,MAAM,CAAC,KAAK,EAAE,CAAC;IACvB,CAAC,CAAC;SACD,WAAW,CACV,OAAO,EACP;;;;;;;;;;;;;;;;;;;;;;;;;;;;CA4BL,CACI,CAAC;AACN,CAAC"}
@@ -4,7 +4,7 @@
4
4
  */
5
5
  import { Client } from '@modelcontextprotocol/sdk/client/index.js';
6
6
  export declare const DEFAULT_MCP_URL = "https://mcp.salai.co.il/mcp";
7
- export declare const PACKAGE_VERSION = "0.1.4";
7
+ export declare const PACKAGE_VERSION = "0.1.5";
8
8
  export interface McpClientOptions {
9
9
  apiKey: string | null;
10
10
  url: string;
package/dist/mcpClient.js CHANGED
@@ -5,7 +5,7 @@
5
5
  import { Client } from '@modelcontextprotocol/sdk/client/index.js';
6
6
  import { StreamableHTTPClientTransport } from '@modelcontextprotocol/sdk/client/streamableHttp.js';
7
7
  export const DEFAULT_MCP_URL = 'https://mcp.salai.co.il/mcp';
8
- export const PACKAGE_VERSION = '0.1.4';
8
+ export const PACKAGE_VERSION = '0.1.5';
9
9
  export function resolveConfig(overrides) {
10
10
  return {
11
11
  apiKey: overrides?.apiKey ||
package/dist/salai.js CHANGED
@@ -60,7 +60,7 @@ registerCallCommands(program, getClient, isJson);
60
60
  registerFulfillCommands(program, getClient, isJson);
61
61
  program.addHelpText('after', `
62
62
  AI agents: use --json on every command. Run salai <command> --help for that command's flags
63
- (e.g. salai fulfill --help). Full MCP args: salai call <toolName> --args '{"…"}' --json
63
+ (e.g. salai shopping-list --help or salai fulfill --help). Full MCP args: salai call <toolName> --args '{"…"}' --json
64
64
  or salai tools --json to list tools from the server.
65
65
  `);
66
66
  program.exitOverride();
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "salai",
3
- "version": "0.1.4",
3
+ "version": "0.1.5",
4
4
  "description": "Salai grocery CLI for Israeli product search, price comparison, and cart workflows",
5
5
  "keywords": [
6
6
  "salai",