@pixelml/agenticflow-cli 1.5.0 → 1.5.1

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.
@@ -2,6 +2,18 @@
2
2
  /**
3
3
  * AgenticFlow CLI entry point.
4
4
  */
5
+ // SECURITY: Some parent environments (notably certain Claude Code launch
6
+ // aliases) set NODE_TLS_REJECT_UNAUTHORIZED=0 for their own reasons. When the
7
+ // CLI inherits that env, Node prints a noisy and alarming warning on EVERY
8
+ // invocation AND the CLI's HTTPS calls to api.agenticflow.ai skip cert
9
+ // verification. We talk to a public HTTPS endpoint with a valid cert — we
10
+ // should never opt out of TLS verification. Unset the env var before anything
11
+ // else imports it, unless the user explicitly opts in via AF_INSECURE_TLS=1
12
+ // (e.g. for a local dev backend with a self-signed cert).
13
+ if (process.env["NODE_TLS_REJECT_UNAUTHORIZED"] === "0" &&
14
+ process.env["AF_INSECURE_TLS"] !== "1") {
15
+ delete process.env["NODE_TLS_REJECT_UNAUTHORIZED"];
16
+ }
5
17
  import { runCli } from "../cli/main.js";
6
18
  runCli().catch((err) => {
7
19
  const message = err instanceof Error ? err.message : String(err);
@@ -1 +1 @@
1
- {"version":3,"file":"agenticflow.js","sourceRoot":"","sources":["../../src/bin/agenticflow.ts"],"names":[],"mappings":";AAEA;;GAEG;AAEH,OAAO,EAAE,MAAM,EAAE,MAAM,gBAAgB,CAAC;AAExC,MAAM,EAAE,CAAC,KAAK,CAAC,CAAC,GAAG,EAAE,EAAE;IACrB,MAAM,OAAO,GAAG,GAAG,YAAY,KAAK,CAAC,CAAC,CAAC,GAAG,CAAC,OAAO,CAAC,CAAC,CAAC,MAAM,CAAC,GAAG,CAAC,CAAC;IACjE,IAAI,OAAO,CAAC,IAAI,CAAC,QAAQ,CAAC,QAAQ,CAAC,EAAE,CAAC;QACpC,OAAO,CAAC,GAAG,CAAC,IAAI,CAAC,SAAS,CAAC;YACzB,MAAM,EAAE,sBAAsB;YAC9B,IAAI,EAA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AC;AAClB,CAAC,CAAC,CAAC"}
@@ -1 +1 @@
1
- {"version":3,"file":"changelog.d.ts","sourceRoot":"","sources":["../../src/cli/changelog.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AAEH,MAAM,WAAW,cAAc;IAC7B,OAAO,EAAE,MAAM,CAAC;IAChB,IAAI,EAAE,MAAM,CAAC;IACb,UAAU,EAAE,MAAM,EAAE,CAAC;IACrB,MAAM,EAAE,MAAM,EAAE,CAAC;CAClB;AAED,eAAO,MAAM,SAAS,EAAE,cAAc,EAiGrC,CAAC;AAEF,wBAAgB,kBAAkB,IAAI,cAAc,CAEnD;AAED,wBAAgB,iBAAiB,CAAC,OAAO,EAAE,MAAM,GAAG,cAAc,EAAE,CAInE"}
1
+ {"version":3,"file":"changelog.d.ts","sourceRoot":"","sources":["../../src/cli/changelog.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AAEH,MAAM,WAAW,cAAc;IAC7B,OAAO,EAAE,MAAM,CAAC;IAChB,IAAI,EAAE,MAAM,CAAC;IACb,UAAU,EAAE,MAAM,EAAE,CAAC;IACrB,MAAM,EAAE,MAAM,EAAE,CAAC;CAClB;AAED,eAAO,MAAM,SAAS,EAAE,cAAc,EAmHrC,CAAC;AAEF,wBAAgB,kBAAkB,IAAI,cAAc,CAEnD;AAED,wBAAgB,iBAAiB,CAAC,OAAO,EAAE,MAAM,GAAG,cAAc,EAAE,CAInE"}
@@ -5,6 +5,24 @@
5
5
  * and displayed after upgrade.
6
6
  */
7
7
  export const CHANGELOG = [
8
+ {
9
+ version: "1.5.1",
10
+ date: "2026-04-14",
11
+ highlights: [
12
+ "CLI unsets inherited NODE_TLS_REJECT_UNAUTHORIZED=0 at startup — fixes the noisy TLS warning that leaked to every invocation AND restores certificate verification for the CLI's HTTPS calls. Opt back in with AF_INSECURE_TLS=1 if you're running a local dev backend with a self-signed cert",
13
+ "`af agent list --name-contains <substr>` — client-side case-insensitive name filter. Stop grep-piping in busy workspaces",
14
+ "`af schema <resource> --field <name>` — drill into a single field's documented shape (useful for nested fields like mcp_clients, response_format, task_management_config)",
15
+ "`af schema agent` now documents the 12 previously-undocumented optional fields (mcp_clients, code_execution_tool_config, response_format, knowledge, skills_config, etc.) with shape hints, plus the `update` block + null_rejected_fields list (matches what `af agent update --patch` auto-strips)",
16
+ "`af schema workforce` — new schema entry explaining workforce create + bulk PUT /schema shape. Covers node types, edge connection_type enum (next_step | condition | ai_condition), and the agent_id requirement on type='agent' nodes",
17
+ "`af bootstrap --json` commands cheat-sheet now surfaces delete_agent, delete_workforce, list_agents_filtered, and get_schema_field — closes the 'how do I clean up' discoverability gap",
18
+ ],
19
+ for_ai: [
20
+ "Expected journey for a fresh agent operator: (1) af whoami → (2) af bootstrap --json → (3) af playbook first-touch (or migrate-from-paperclip if coming from Paperclip) → (4) af schema <resource> --field <name> for any unclear payload shape → (5) build with --dry-run, then live → (6) cleanup with af <resource> delete",
21
+ "Use `af agent list --name-contains <substr> --fields id,name --json` to find your own test agents in a populated workspace before bulk delete",
22
+ "`af schema agent --field mcp_clients --json` returns the documented attach-shape with run_behavior + per-tool allow map — no more guessing",
23
+ "If you hit TLS cert errors against a self-signed backend, set AF_INSECURE_TLS=1 (do NOT set NODE_TLS_REJECT_UNAUTHORIZED directly — CLI now unsets it at startup)",
24
+ ],
25
+ },
8
26
  {
9
27
  version: "1.5.0",
10
28
  date: "2026-04-14",
@@ -1 +1 @@
1
- {"version":3,"file":"changelog.js","sourceRoot":"","sources":["../../src/cli/changelog.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AASH,MAAM,CAAC,MAAM,SAAS,GAAqB;IACzC;QACE,OAAO,EAAE,OAAO;QAChB,IAAI,EAAE,YAAY;QAClB,UAAU,EAAE;YACV,iKAAiK;YACjK,mIAAmI;YACnI,4JAA4J;YAC5J,qJAAqJ;YACrJ,8GAA8G;YAC9G,yGAAyG;SAC1G;QACD,MAAM,EAAE;YACN,mMAAmM;YACnM,wLAAwL;YACxL,wGAAwG;YACxG,g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"main.d.ts","sourceRoot":"","sources":["../../src/cli/main.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AAEH,OAAO,EAAE,OAAO,EAAE,MAAM,WAAW,CAAC;AAy4BpC,wBAAgB,aAAa,IAAI,OAAO,CA2pKvC;AAED,wBAAsB,MAAM,CAAC,IAAI,CAAC,EAAE,MAAM,EAAE,GAAG,OAAO,CAAC,IAAI,CAAC,CAwB3D"}
1
+ {"version":3,"file":"main.d.ts","sourceRoot":"","sources":["../../src/cli/main.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AAEH,OAAO,EAAE,OAAO,EAAE,MAAM,WAAW,CAAC;AAy4BpC,wBAAgB,aAAa,IAAI,OAAO,CAwvKvC;AAED,wBAAsB,MAAM,CAAC,IAAI,CAAC,EAAE,MAAM,EAAE,GAAG,OAAO,CAAC,IAAI,CAAC,CAwB3D"}
package/dist/cli/main.js CHANGED
@@ -767,16 +767,63 @@ export function createProgram() {
767
767
  system_prompt: "string",
768
768
  recursion_limit: "number (10-500, default: 25)",
769
769
  agent_type: "standard | autonomous (default: standard)",
770
+ model_user_config: "object { temperature?, max_tokens?, max_input_tokens?, reasoning_effort? }",
771
+ mcp_clients: "array of { mcp_client_id, run_behavior: 'auto_run' | 'confirm', description?, timeout?, tools?: {tool_name: {allowed: bool}} } — attach MCP tool providers",
772
+ code_execution_tool_config: "object { enable: bool, enable_file_operations?: bool } — enable Python/JS code exec",
773
+ file_system_tool_config: "object | null — enable file system tool",
774
+ attachment_config: "object | null — file attachment config",
775
+ response_format: "object | null — structured output schema for the agent's final response (JSON mode)",
776
+ knowledge: "object | null — knowledge base / RAG configuration",
777
+ skills_config: "object | null — skill pack configuration",
778
+ task_management_config: "object | null — task queue / scheduling configuration",
779
+ suggest_replies: "bool (default: true) — generate suggested follow-up replies",
780
+ auto_generate_title: "bool (default: true) — auto-title new threads",
781
+ welcome_message: "string — greeting on new thread",
782
+ suggested_messages: "array of strings — pre-populated example prompts shown to users",
783
+ sub_agents: "array — sub-agent configurations for agent teams",
784
+ plugins: "array — plugin configurations",
770
785
  },
771
786
  example: { name: "My Agent", tools: [], project_id: "YOUR_PROJECT_ID" },
772
787
  },
788
+ update: {
789
+ note: "PUT /v1/agents/{id} — supply any subset of create fields. Prefer `af agent update --patch` to avoid round-tripping the full body.",
790
+ null_rejected_fields: [
791
+ "suggest_replies_model", "suggest_replies_model_user_config", "suggest_replies_prompt_template",
792
+ "knowledge", "task_management_config", "recursion_limit",
793
+ "file_system_tool_config", "attachment_config", "response_format", "skills_config",
794
+ ],
795
+ null_rejected_note: "These fields must be OMITTED (not sent as null) on update — server rejects null. The CLI auto-strips when you use `af agent update` (with or without --patch).",
796
+ },
773
797
  stream: {
774
798
  required: ["messages"],
775
799
  optional: { id: "string (thread UUID for conversation continuity)" },
776
800
  messages_item: { required: ["content"], optional: { role: "user (default)" } },
777
801
  example: { messages: [{ content: "Hello", role: "user" }] },
778
802
  },
779
- fields: ["id", "name", "description", "model", "visibility", "system_prompt", "tools", "mcp_clients", "plugins", "sub_agents", "agent_type", "recursion_limit", "created_at", "updated_at"],
803
+ fields: ["id", "name", "description", "model", "visibility", "system_prompt", "tools", "mcp_clients", "plugins", "sub_agents", "agent_type", "recursion_limit", "model_user_config", "code_execution_tool_config", "file_system_tool_config", "attachment_config", "response_format", "knowledge", "skills_config", "task_management_config", "suggest_replies", "auto_generate_title", "welcome_message", "suggested_messages", "created_at", "updated_at"],
804
+ },
805
+ workforce: {
806
+ resource: "workforce",
807
+ note: "AgenticFlow-native multi-agent DAG (nodes + edges). Create metadata first, then PUT /schema with the full graph.",
808
+ create: {
809
+ required: ["name"],
810
+ optional: {
811
+ description: "string",
812
+ recursion_limit: "number (default: 25)",
813
+ error_handling_policy: "object { on_error: 'stop' | 'continue' | 'route', ... }",
814
+ is_public: "bool (default: false)",
815
+ },
816
+ example: { name: "My Team Workforce", description: "What this team does" },
817
+ server_injects: "workspace_id and project_id are auto-injected from client config if absent",
818
+ },
819
+ schema: {
820
+ note: "PUT /v1/workspaces/{ws}/workforce/{id}/schema — atomic bulk graph replace. Server diffs current vs desired and applies create/update/delete.",
821
+ required: ["nodes", "edges"],
822
+ node_shape: { name: "string", type: "trigger | agent | output | router | condition | loop | tool | plugin | agent_team | agent_team_member | state_modifier", position: "{ x, y }", input: "object (per node_type)", meta: "object (optional)" },
823
+ edge_shape: { source_node_name: "string", target_node_name: "string", connection_type: "next_step | condition | ai_condition" },
824
+ agent_node_input: "type='agent' nodes REQUIRE a real agent_id in input. Create agents first, then reference.",
825
+ },
826
+ fields: ["id", "workspace_id", "project_id", "name", "description", "error_handling_policy", "is_public", "public_key", "current_version_id", "recursion_limit", "created_at", "updated_at"],
780
827
  },
781
828
  workflow: {
782
829
  resource: "workflow",
@@ -888,14 +935,18 @@ export function createProgram() {
888
935
  run_agent: "af agent run --agent-id <id> --message <msg> --json",
889
936
  create_agent: "af agent create --body <json> --dry-run --json",
890
937
  list_agents: "af agent list --fields id,name,model --json",
938
+ list_agents_filtered: "af agent list --name-contains <substr> --fields id,name --json",
891
939
  update_agent_patch: "af agent update --agent-id <id> --patch --body '{\"field\":\"value\"}' --json",
940
+ delete_agent: "af agent delete --agent-id <id> --json",
892
941
  init_workforce: "af workforce init --blueprint <id> --json",
893
942
  run_workforce: "af workforce run --workforce-id <id> --trigger-data '{}'",
894
943
  publish_workforce: "af workforce publish --workforce-id <id> --json",
944
+ delete_workforce: "af workforce delete --workforce-id <id> --json",
895
945
  inspect_mcp_client: "af mcp-clients inspect --id <id> --json",
896
946
  deploy_to_paperclip: "af paperclip init --blueprint <id> --json # DEPRECATED, use `af workforce init`",
897
947
  send_webhook: "curl -X POST http://localhost:4100/webhook/webhook -H 'Content-Type: application/json' -d '{\"agent_id\":\"<id>\",\"message\":\"<msg>\"}'",
898
948
  get_schema: "af schema <resource> --json",
949
+ get_schema_field: "af schema <resource> --field <field_name> --json",
899
950
  get_playbook: "af playbook <topic>",
900
951
  get_changelog: "af changelog --json",
901
952
  },
@@ -1019,14 +1070,15 @@ export function createProgram() {
1019
1070
  program
1020
1071
  .command("schema [resource]")
1021
1072
  .description("Show resource schema for payload construction. AI agents: use this to discover fields before building payloads.")
1022
- .action((resource) => {
1073
+ .option("--field <name>", "Drill into a single field — returns its documented shape from create.optional (or create.required). Useful for nested fields like `mcp_clients`, `response_format`, `task_management_config`.")
1074
+ .action((resource, opts) => {
1023
1075
  if (!resource) {
1024
1076
  if (isJsonFlagEnabled()) {
1025
1077
  printResult({
1026
1078
  schema: "agenticflow.schema.index.v1",
1027
1079
  available: Object.keys(SCHEMAS),
1028
1080
  usage: "af schema <resource> --json",
1029
- hint: "Use 'af schema agent' to see agent create/stream payload schemas.",
1081
+ hint: "Use 'af schema agent' to see agent create/stream payload schemas. Use 'af schema agent --field mcp_clients' to drill into a single field.",
1030
1082
  });
1031
1083
  }
1032
1084
  else {
@@ -1042,6 +1094,44 @@ export function createProgram() {
1042
1094
  if (!schema) {
1043
1095
  fail("schema_not_found", `Unknown resource: ${resource}`, `Available: ${Object.keys(SCHEMAS).join(", ")}`);
1044
1096
  }
1097
+ // Field drilldown: return just the docs for one field
1098
+ if (opts?.field) {
1099
+ const fieldName = opts.field;
1100
+ const s = schema;
1101
+ const create = s.create ?? {};
1102
+ const required = create.required ?? [];
1103
+ const optional = create.optional ?? {};
1104
+ let doc = null;
1105
+ let isRequired = false;
1106
+ if (required.includes(fieldName)) {
1107
+ doc = "required";
1108
+ isRequired = true;
1109
+ }
1110
+ if (fieldName in optional)
1111
+ doc = optional[fieldName] ?? null;
1112
+ const result = {
1113
+ schema: "agenticflow.schema.field.v1",
1114
+ resource: s.resource,
1115
+ field: fieldName,
1116
+ required: isRequired,
1117
+ doc,
1118
+ found: doc !== null,
1119
+ hint: doc === null
1120
+ ? `Field '${fieldName}' has no documented shape in the static schema. For live introspection, fetch an existing instance via 'af ${s.resource} get --${s.resource}-id <id> --json' and inspect the returned value for that field.`
1121
+ : undefined,
1122
+ };
1123
+ if (isJsonFlagEnabled()) {
1124
+ printResult(result);
1125
+ }
1126
+ else {
1127
+ console.log(`${s.resource}.${fieldName}${isRequired ? " (required)" : " (optional)"}`);
1128
+ if (doc)
1129
+ console.log(` ${doc}`);
1130
+ if (result.hint)
1131
+ console.log(` ${result.hint}`);
1132
+ }
1133
+ return;
1134
+ }
1045
1135
  if (isJsonFlagEnabled()) {
1046
1136
  printResult(schema);
1047
1137
  }
@@ -3328,7 +3418,8 @@ export function createProgram() {
3328
3418
  .command("list")
3329
3419
  .description("List agents.")
3330
3420
  .option("--project-id <id>", "Project ID")
3331
- .option("--search <query>", "Search query")
3421
+ .option("--search <query>", "Backend search query (server-side)")
3422
+ .option("--name-contains <substr>", "Client-side case-insensitive substring filter on agent `name`. Use for quick filtering in busy workspaces.")
3332
3423
  .option("--limit <n>", "Limit results")
3333
3424
  .option("--offset <n>", "Offset")
3334
3425
  .option("--fields <fields>", "Comma-separated fields to return (e.g. id,name,model)")
@@ -3340,7 +3431,16 @@ export function createProgram() {
3340
3431
  limit: parseOptionalInteger(opts.limit, "--limit", 1),
3341
3432
  offset: parseOptionalInteger(opts.offset, "--offset", 0),
3342
3433
  });
3343
- printResult(applyFieldsFilter(data, opts.fields));
3434
+ let filtered = data;
3435
+ const nameContains = opts.nameContains;
3436
+ if (nameContains && Array.isArray(data)) {
3437
+ const needle = nameContains.toLowerCase();
3438
+ filtered = data.filter((row) => {
3439
+ const n = row["name"];
3440
+ return typeof n === "string" && n.toLowerCase().includes(needle);
3441
+ });
3442
+ }
3443
+ printResult(applyFieldsFilter(filtered, opts.fields));
3344
3444
  });
3345
3445
  agentCmd
3346
3446
  .command("get")