@actionway/cli-dev 0.0.0-dev.38532746006.a574f5d68a15 → 0.0.0-dev.39573884835.24133c7753db

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.
@@ -99,6 +99,7 @@ Right after a successful `actionway init`, run `actionway account wallet` once a
99
99
  - Route from the references first. Once the user picks a variant (or exactly one fits, or they already named a tool, model, or price tier), run `actionway tools inspect <tool_ref>` on that one choice before calling. Inspect is the authority for the current input Schema, variants, effects, guidance, and Actionway USD price; if it disagrees with the reference, follow Inspect and tell the user the updated price before proceeding.
100
100
  - When you had to fall back to `actionway tools search "<natural-language intent>"`, use its filters only when the task supplies real constraints, and inspect at most three of the supported candidates — include the cheapest and the highest-quality — then present those options neutrally and let the user choose before any call — never recommend one for them.
101
101
  - `actionway search` is the Web Search business capability. Capability discovery is always `actionway tools search`.
102
+ - For Web Search through Actionway, use `actionway search "search terms" --k 5`. Omit `--provider` for the existing automatic routing; pin a provider only for an explicit provider-specific requirement. Legacy `--query="search terms"` still works; never combine it with positional search terms. Enum flags accept plain values such as `--freshness pw` and `--resource-type image`; extra JSON quoting is unnecessary (old JSON-quoted values still work). This syntax does not change the host-search, pricing, or confirmation rules above.
102
103
  - Use a high-frequency typed command only when `actionway --help` exposes an exact fit. Read `actionway <command> --help` and, when available, `--print-schema`; typed commands are parameter/file conveniences over the same Tool Call, confirmation, billing, and Job path.
103
104
  - When the signed-in user asks to generate, show, copy, or share their invitation, run `actionway account invitation --locale <zh-cn|zh-tw|en|ja>` using the conversation language. Return the server-provided `code`, `url`, and `message`; do not invent reward amounts or rewrite promotion terms. The first request creates one permanent code and later requests return that same code.
104
105
  - For other account questions, use only the requested read command: `actionway account usage`, `actionway account wallet`, or `actionway account transactions`.
@@ -22,6 +22,8 @@ Use only the `actionway-dev` executable. Never substitute the stable `actionway`
22
22
 
23
23
  Use typed commands only when `actionway-dev --help` exposes an exact fit. Read command help and `--print-schema`, then run `--dry-run` before a real typed call.
24
24
 
25
+ For Web Search, use `actionway-dev search "search terms" --k 5`; omit `--provider` for automatic routing unless testing a specific provider. Legacy `--query="search terms"` is still accepted, but do not combine it with positional search terms. Enum flags accept plain values such as `--freshness pw`; old JSON-quoted enum values remain supported. Capability discovery is `actionway-dev tools search`, not `actionway-dev search`.
26
+
25
27
  ## Boundaries
26
28
 
27
29
  - Treat the development Gateway as the authority for Schema, price, confirmation, and results.
package/dist/index.js CHANGED
@@ -9236,6 +9236,7 @@ function isStringOrStringArray(prop) {
9236
9236
  return hasString && hasStringArray;
9237
9237
  }
9238
9238
  function usesJsonEncoding(prop) {
9239
+ if (extractEnumValues(prop)) return false;
9239
9240
  if (isStringOrStringArray(prop)) return false;
9240
9241
  if (prop.type === void 0 || prop.type === "object") return true;
9241
9242
  if (prop.type !== "array") return false;
@@ -9917,6 +9918,18 @@ function emitOutcome(outcome) {
9917
9918
  function registerOption(cmd, f) {
9918
9919
  const flagName = `--${f.flag}`;
9919
9920
  const summary = describeFlag(f);
9921
+ const choices = f.enum;
9922
+ if (choices) {
9923
+ cmd.option(`${flagName} <value>`, summary, (raw) => {
9924
+ if (choices.includes(raw)) return raw;
9925
+ if (raw.trimStart().startsWith('"')) {
9926
+ const value = parseJsonFlag(flagName, raw);
9927
+ if (typeof value === "string" && choices.includes(value)) return value;
9928
+ }
9929
+ throw new Error(`${flagName} must be one of: ${choices.join(", ")}`);
9930
+ });
9931
+ return;
9932
+ }
9920
9933
  if (f.scalarOrArray === true) {
9921
9934
  cmd.option(`${flagName} <value>`, `${summary}; repeatable`, (v, prev) => {
9922
9935
  if (prev === void 0) return v;
@@ -9962,12 +9975,17 @@ function describeFlag(f) {
9962
9975
  function registerActionCommand(program2, spec, deps) {
9963
9976
  const flags = [...deriveFlags(spec.schema), ...spec.extraFlags ?? []];
9964
9977
  const cmd = program2.command(spec.name).description(spec.summary);
9978
+ if (spec.positionalFlag) {
9979
+ cmd.argument(`[${spec.positionalFlag}]`, `alternative to --${spec.positionalFlag}; use only one form`);
9980
+ cmd.allowExcessArguments(false).exitOverride();
9981
+ }
9965
9982
  for (const f of flags) registerOption(cmd, f);
9966
9983
  cmd.option("--print-schema", "emit JSON schema for this verb's single-call shape and exit");
9967
9984
  cmd.option("--dry-run", "validate input and show the request projection without submitting work");
9968
9985
  if (spec.helpText) cmd.addHelpText("after", `
9969
9986
  ${spec.helpText}`);
9970
- cmd.action(async (rawOpts) => {
9987
+ cmd.action(async () => {
9988
+ const rawOpts = cmd.opts();
9971
9989
  if (rawOpts.printSchema === true) {
9972
9990
  process.stdout.write(
9973
9991
  `${JSON.stringify(renderPrintSchema({ verb: spec.name, summary: spec.summary, flags }), null, 2)}
@@ -9976,6 +9994,13 @@ ${spec.helpText}`);
9976
9994
  process.exit(0);
9977
9995
  }
9978
9996
  const params = collectParams(flags, rawOpts);
9997
+ if (spec.positionalFlag && cmd.args[0] !== void 0) {
9998
+ const flag = flags.find((candidate) => candidate.flag === spec.positionalFlag);
9999
+ if (params[flag.jsonName] !== void 0) {
10000
+ throw new Error(`Use either positional ${spec.positionalFlag} or --${spec.positionalFlag}, not both`);
10001
+ }
10002
+ params[flag.jsonName] = cmd.args[0];
10003
+ }
9979
10004
  const outcome = await executeAction(spec, params, { dryRun: rawOpts.dryRun === true }, deps);
9980
10005
  emitOutcome(outcome);
9981
10006
  });
@@ -10903,7 +10928,7 @@ async function readImage(path, extras) {
10903
10928
  async function prepareSearch(params) {
10904
10929
  const provider = String(params.provider ?? "auto");
10905
10930
  const query = typeof params.query === "string" ? params.query : "";
10906
- if (provider !== "baidu-image" && !query.trim()) throw new CliError("E_SCHEMA", "--query is required");
10931
+ if (provider !== "baidu-image" && !query.trim()) throw new CliError("E_SCHEMA", 'A query is required: search "search terms" or search --query="search terms"');
10907
10932
  const k = typeof params.k === "number" ? params.k : 10;
10908
10933
  const extras = await parseExtras(params);
10909
10934
  const freshness = typeof params.freshness === "string" ? params.freshness : void 0;
@@ -11038,16 +11063,26 @@ function normalizeSearch(result, params) {
11038
11063
  }
11039
11064
  var search_default = defineActionCommand({
11040
11065
  name: "search",
11066
+ positionalFlag: "query",
11041
11067
  summary: "Web search with automatic Parallel/Serper routing or an explicit provider.",
11042
11068
  helpText: [
11069
+ 'Usage: actionway search "search terms" [options]',
11070
+ 'Legacy --query="search terms" is still supported; do not combine the two query forms.',
11071
+ "Enums use plain values, e.g. --freshness pw; legacy JSON-quoted values are still accepted.",
11072
+ "",
11043
11073
  "`--provider` is optional; omitted or auto uses Parallel Fast with Serper fallback on retryable failures.",
11044
11074
  "Explicit baidu, baidu-image, parallel, serper, tavily, and brave keep their provider-specific behavior.",
11045
11075
  "For Baidu image/video discovery, use `--provider=baidu --resource-type=image|video`.",
11046
11076
  "For Baidu similar-image search, use `--provider=baidu-image --image-file=<jpg|png>`.",
11047
11077
  "For URL fetch (not a query), use `actionway fetch` instead.",
11048
11078
  "",
11049
- "Example (stdin):",
11050
- ' cat <<EOF | actionway search --query="cats" --provider=tavily --params-file=-',
11079
+ "Examples:",
11080
+ ' actionway search "latest AI news" --k 5',
11081
+ ' actionway search "latest AI news" --freshness pw',
11082
+ ' actionway search --query="latest AI news" --k 5',
11083
+ "",
11084
+ "Advanced provider-specific extras (stdin):",
11085
+ ' cat <<EOF | actionway search "cats" --provider=serper --params-file=-',
11051
11086
  ' {"safe":"strict"}',
11052
11087
  " EOF"
11053
11088
  ].join("\n"),
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@actionway/cli-dev",
3
- "version": "0.0.0-dev.38532746006.a574f5d68a15",
3
+ "version": "0.0.0-dev.39573884835.24133c7753db",
4
4
  "description": "Actionway development CLI for dev.actionway.ai",
5
5
  "type": "module",
6
6
  "bin": {
@@ -36,9 +36,9 @@
36
36
  },
37
37
  "actionway": {
38
38
  "channel": "development",
39
- "source_sha": "a574f5d68a157d54106f5c3fefe4b6545b8c107b",
40
- "run_id": 38532746006,
41
- "run_url": "https://github.com/PawLogic/actionway/actions/runs/38532746006",
39
+ "source_sha": "24133c7753db10d5341fa052c5d34ad542b281d5",
40
+ "run_id": 39573884835,
41
+ "run_url": "https://github.com/PawLogic/actionway/actions/runs/39573884835",
42
42
  "gateway_url": "https://dev.actionway.ai"
43
43
  }
44
44
  }