@fieldwork-ai/cli 0.26.1 → 0.27.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/README.md CHANGED
@@ -45,7 +45,7 @@ Mutations prompt for confirmation on a TTY; pass `--yes` to skip (required in no
45
45
 
46
46
  The connector development loop end to end: `connectors pull acme_erp` → edit the adapter → `connectors publish acme_erp --message "…" --base-revision N` (a new key creates the definition from the tree's `connector.json`) → `connectors connect acme_erp --spec spec.json` → `connectors secrets set <id>` → `automations run-now <sync> --follow` to watch the logs.
47
47
 
48
- Publishing initializes a new connector from `connector.json`, but subsequent action revisions leave `connector_definitions` metadata unchanged. To edit its display name, description, branding, or REST secret-name hints, use `fieldwork connectors metadata <definition-id>`, then `fieldwork connectors update-metadata <definition-id> --changes changes.json --expected-updated-at '<exact updated_at from the read>'`. The update requires connector edit access and rejects stale reads; credential values are managed separately through `secrets`.
48
+ Publishing initializes a new connector from `connector.json`, but subsequent package revisions leave the `connectors` row's metadata unchanged. To edit its display name, description, branding, or REST secret-name hints, use `fieldwork connectors metadata <definition-id>`, then `fieldwork connectors update-metadata <definition-id> --changes changes.json --expected-updated-at '<exact updated_at from the read>'`. The update requires connector edit access and rejects stale reads; credential values are managed separately through `secrets`.
49
49
 
50
50
  ## Auth and configuration
51
51
 
@@ -169,17 +169,14 @@ export function registerConnectorCommands(program) {
169
169
  .description("Download an org-authored connector definition's adapter source")
170
170
  .option("--out <dir>", "target directory (defaults to ./<key>)")
171
171
  .option("--revision <n>", "a historical revision instead of head")
172
- .option("--action-name <name>", "the named action under this connector")
172
+ .option("--package-name <name>", "the named package on this connector")
173
173
  .action(async (key, opts) => {
174
174
  const { json } = getContext();
175
- const definition = await resolveDefinition(key);
176
- const query = new URLSearchParams();
177
- if (opts.revision)
178
- query.set("revision", opts.revision);
179
- if (opts.actionName)
180
- query.set("action_name", opts.actionName);
181
- const suffix = query.size ? `?${query}` : "";
182
- const body = await apiJson(`/api/organizations/${requireOrgId()}/connectors/${definition.connector_id}/source${suffix}`);
175
+ const suffix = opts.revision ? `?${new URLSearchParams({ revision: opts.revision })}` : "";
176
+ const path = opts.packageName
177
+ ? `/api/organizations/${requireOrgId()}/packages/${encodeURIComponent(opts.packageName)}/source${suffix}`
178
+ : `/api/organizations/${requireOrgId()}/connectors/${(await resolveDefinition(key)).connector_id}/source${suffix}`;
179
+ const body = await apiJson(path);
183
180
  const dir = opts.out ?? key;
184
181
  const pulled = writeBundle(dir, body.files);
185
182
  if (json) {
@@ -193,7 +190,7 @@ export function registerConnectorCommands(program) {
193
190
  .description("Publish an adapter directory as a new revision (creates the definition on first publish)")
194
191
  .requiredOption("--message <message>", "what changed and why")
195
192
  .option("--base-revision <n>", "head revision your changes are based on (required once code is published)")
196
- .option("--action-name <name>", "create or update this named action under the connector")
193
+ .option("--package-name <name>", "create or update this named package on the connector")
197
194
  .action(async (dir, opts) => {
198
195
  const { json, yes } = getContext();
199
196
  const files = readBundle(dir);
@@ -211,13 +208,13 @@ export function registerConnectorCommands(program) {
211
208
  if (key === "?") {
212
209
  fail('the tree\'s connector.json must carry a "key" field — for a package with no system, use `packages publish`', EXIT.usage);
213
210
  }
214
- await confirm(`Publish ${Object.keys(files).length} files to connector "${key}"${opts.actionName ? `, action "${opts.actionName}"` : ""}?`, yes);
211
+ await confirm(`Publish ${Object.keys(files).length} files to connector "${key}"${opts.packageName ? `, package "${opts.packageName}"` : ""}?`, yes);
215
212
  const body = await apiJson(`/api/organizations/${requireOrgId()}/connectors/publish`, {
216
213
  method: "POST",
217
214
  body: JSON.stringify({
218
215
  message: opts.message,
219
216
  base_revision: opts.baseRevision ? Number(opts.baseRevision) : undefined,
220
- action_name: opts.actionName,
217
+ name: opts.packageName,
221
218
  files,
222
219
  }),
223
220
  });
@@ -229,7 +226,7 @@ export function registerConnectorCommands(program) {
229
226
  printData(await apiJson(`/api/organizations/${requireOrgId()}/connectors/${id}/metadata`), getContext().json);
230
227
  });
231
228
  connectors.command("update-metadata <definition-id>")
232
- .description("Edit connector metadata separately from action code")
229
+ .description("Edit connector metadata separately from package code")
233
230
  .requiredOption("--changes <json-file>", "metadata fields to change")
234
231
  .requiredOption("--expected-updated-at <timestamp>", "exact updated_at from metadata read")
235
232
  .action(async (id, opts) => {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@fieldwork-ai/cli",
3
- "version": "0.26.1",
3
+ "version": "0.27.0",
4
4
  "description": "Fieldwork asset-management CLI",
5
5
  "license": "UNLICENSED",
6
6
  "type": "module",