@eide/foir-cli 0.25.0 → 0.25.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.
package/dist/cli.js CHANGED
@@ -2756,7 +2756,8 @@ function createOperationsMethods(client) {
2756
2756
  precondition: params.precondition,
2757
2757
  configId: params.configId,
2758
2758
  supportsAsync: params.supportsAsync,
2759
- callbackTtlSeconds: params.callbackTtlSeconds
2759
+ callbackTtlSeconds: params.callbackTtlSeconds,
2760
+ capabilities: params.capabilities ?? []
2760
2761
  })
2761
2762
  );
2762
2763
  return resp.operation ?? null;
@@ -2777,7 +2778,8 @@ function createOperationsMethods(client) {
2777
2778
  precondition: params.precondition,
2778
2779
  isActive: params.isActive,
2779
2780
  supportsAsync: params.supportsAsync,
2780
- callbackTtlSeconds: params.callbackTtlSeconds
2781
+ callbackTtlSeconds: params.callbackTtlSeconds,
2782
+ capabilities: params.capabilities
2781
2783
  })
2782
2784
  );
2783
2785
  return resp.operation ?? null;
@@ -5237,6 +5239,7 @@ async function reconcileOperations(client, configId, operations, operationBaseUr
5237
5239
  `\u26A0 operation "${op.key}": mode=async but timeoutMs=${op.timeoutMs} \u2014 ack should return in <10s; long timeouts mask slow extensions`
5238
5240
  );
5239
5241
  }
5242
+ const capabilities = op.capabilities ?? [];
5240
5243
  if (ex) {
5241
5244
  const empty = {};
5242
5245
  await client.operations.updateOperation({
@@ -5253,7 +5256,8 @@ async function reconcileOperations(client, configId, operations, operationBaseUr
5253
5256
  precondition: op.precondition ?? empty,
5254
5257
  isActive: op.isActive,
5255
5258
  supportsAsync,
5256
- callbackTtlSeconds: op.callbackTtlSeconds
5259
+ callbackTtlSeconds: op.callbackTtlSeconds,
5260
+ capabilities
5257
5261
  });
5258
5262
  summary.operations.updated++;
5259
5263
  summary.updatedOperationIds.push(ex.id);
@@ -5275,7 +5279,8 @@ async function reconcileOperations(client, configId, operations, operationBaseUr
5275
5279
  precondition: op.precondition,
5276
5280
  configId,
5277
5281
  supportsAsync,
5278
- callbackTtlSeconds: op.callbackTtlSeconds
5282
+ callbackTtlSeconds: op.callbackTtlSeconds,
5283
+ capabilities
5279
5284
  });
5280
5285
  summary.operations.created++;
5281
5286
  }
@@ -191,6 +191,28 @@ interface ApplyConfigOperationInput {
191
191
  callbackTimeoutRetryPolicy?: {
192
192
  maxRetries?: number;
193
193
  };
194
+ /**
195
+ * Capability strings stamped onto the scoped dispatch token (and its
196
+ * callback-window successor) so the extension can call back into
197
+ * api-public with the precise authorities it needs — nothing more.
198
+ *
199
+ * Per-model record access is three-part: `records:read:<model_key>`,
200
+ * `records:write:<model_key>`, `records:delete:<model_key>`,
201
+ * `records:publish:<model_key>`. List every model the operation
202
+ * touches; the unscoped two-part forms (`records:read` etc.) only
203
+ * work for admin API keys and won't satisfy customer-scoped tokens.
204
+ *
205
+ * Cross-cutting caps: `embeddings:read`, `embeddings:write`,
206
+ * `shares:read`, `shares:write`, `files:read`, `files:write`,
207
+ * `config:read`, `status:write`, and the secrets:* family. See
208
+ * `services/internal/scopedtoken/capabilities.go` for the full enum.
209
+ *
210
+ * `operations:complete` is auto-injected on callback tokens — never
211
+ * declare it here. Omitting `capabilities` (or passing an empty array)
212
+ * mints an authentic-but-unprivileged token; useful for operations
213
+ * whose extension makes no back-channel calls.
214
+ */
215
+ capabilities?: string[];
194
216
  }
195
217
  interface ApplyConfigSegmentInput {
196
218
  key: string;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@eide/foir-cli",
3
- "version": "0.25.0",
3
+ "version": "0.25.1",
4
4
  "description": "Universal platform CLI for Foir platform",
5
5
  "type": "module",
6
6
  "publishConfig": {