@granular-software/sdk 0.4.56 → 0.4.58

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.
@@ -214,10 +214,29 @@ interface OpenEnvironmentOptions {
214
214
  email?: string;
215
215
  /**
216
216
  * Permission profile names or IDs to ensure before opening the environment.
217
- * This should be provided even for existing users so the SDK can guarantee
218
- * assignments for first-time environment creation.
217
+ * Required at runtime when `assignmentMode` is omitted or set to `ensure`.
218
+ * Ignored by `require-existing`, which never mutates authorization records.
219
219
  */
220
- permissions: string[];
220
+ permissions?: string[];
221
+ /**
222
+ * How the SDK should handle the subject's ontology assignment.
223
+ *
224
+ * `ensure` preserves the historical behavior: permission profiles and the
225
+ * assignment are created or updated as needed. `require-existing` accepts
226
+ * only `granularId`, requires a current assignment, and never issues SDK
227
+ * authorization-setup writes for the selected subject, permission profile,
228
+ * or assignment. Managed opening can still write default tags,
229
+ * environments, activations, importer/setup state, sessions, and internal
230
+ * shared-mount subjects.
231
+ */
232
+ assignmentMode?: "ensure" | "require-existing";
233
+ /**
234
+ * Optional integrity guard for `require-existing`. Opening fails when the
235
+ * assignment read by the SDK does not use this permission profile ID. The
236
+ * control plane rechecks the same expectation while resolving an existing
237
+ * active environment and atomically when changing the active pointer.
238
+ */
239
+ expectedPermissionProfileId?: string;
221
240
  /**
222
241
  * When true, if the latest environment for this ontology/user/tag is marked
223
242
  * outdated relative to the current tag target, create a fresh environment on
@@ -214,10 +214,29 @@ interface OpenEnvironmentOptions {
214
214
  email?: string;
215
215
  /**
216
216
  * Permission profile names or IDs to ensure before opening the environment.
217
- * This should be provided even for existing users so the SDK can guarantee
218
- * assignments for first-time environment creation.
217
+ * Required at runtime when `assignmentMode` is omitted or set to `ensure`.
218
+ * Ignored by `require-existing`, which never mutates authorization records.
219
219
  */
220
- permissions: string[];
220
+ permissions?: string[];
221
+ /**
222
+ * How the SDK should handle the subject's ontology assignment.
223
+ *
224
+ * `ensure` preserves the historical behavior: permission profiles and the
225
+ * assignment are created or updated as needed. `require-existing` accepts
226
+ * only `granularId`, requires a current assignment, and never issues SDK
227
+ * authorization-setup writes for the selected subject, permission profile,
228
+ * or assignment. Managed opening can still write default tags,
229
+ * environments, activations, importer/setup state, sessions, and internal
230
+ * shared-mount subjects.
231
+ */
232
+ assignmentMode?: "ensure" | "require-existing";
233
+ /**
234
+ * Optional integrity guard for `require-existing`. Opening fails when the
235
+ * assignment read by the SDK does not use this permission profile ID. The
236
+ * control plane rechecks the same expectation while resolving an existing
237
+ * active environment and atomically when changing the active pointer.
238
+ */
239
+ expectedPermissionProfileId?: string;
221
240
  /**
222
241
  * When true, if the latest environment for this ontology/user/tag is marked
223
242
  * outdated relative to the current tag target, create a fresh environment on
package/dist/spend.d.mts CHANGED
@@ -1 +1 @@
1
- export { G as GranularSpendContext, l as OpenAIUsageSpendEvent, m as RecordOpenAIUsageSpendOptions, o as RecordOpenAIUsageSpendResult, p as buildOpenAISpendEventId, r as recordOpenAIUsageSpend, t as toGranularHttpBase } from './spend-DpRRCrAr.mjs';
1
+ export { G as GranularSpendContext, l as OpenAIUsageSpendEvent, m as RecordOpenAIUsageSpendOptions, o as RecordOpenAIUsageSpendResult, p as buildOpenAISpendEventId, r as recordOpenAIUsageSpend, t as toGranularHttpBase } from './spend-czRX7l0X.mjs';
package/dist/spend.d.ts CHANGED
@@ -1 +1 @@
1
- export { G as GranularSpendContext, l as OpenAIUsageSpendEvent, m as RecordOpenAIUsageSpendOptions, o as RecordOpenAIUsageSpendResult, p as buildOpenAISpendEventId, r as recordOpenAIUsageSpend, t as toGranularHttpBase } from './spend-DpRRCrAr.js';
1
+ export { G as GranularSpendContext, l as OpenAIUsageSpendEvent, m as RecordOpenAIUsageSpendOptions, o as RecordOpenAIUsageSpendResult, p as buildOpenAISpendEventId, r as recordOpenAIUsageSpend, t as toGranularHttpBase } from './spend-czRX7l0X.js';
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@granular-software/sdk",
3
- "version": "0.4.56",
3
+ "version": "0.4.58",
4
4
  "description": "TypeScript SDK and CLI for Granular - define, build, and deploy AI sandboxes",
5
5
  "main": "./dist/index.js",
6
6
  "module": "./dist/index.mjs",