@telos-dev-team/dealernode-permissions 1.1.60 → 1.1.62

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.
@@ -150,6 +150,40 @@ export declare const BACKOFFICE_PERMISSIONS: {
150
150
  readonly VIEW: "backoffice.dealer_notifications.view";
151
151
  readonly MANAGE: "backoffice.dealer_notifications.manage";
152
152
  };
153
+ /**
154
+ * AI agents (DealerNode-AI) operated from the backoffice (A48). Reading, config,
155
+ * customer-data (PII) and actions that reach the outside world are separate keys
156
+ * on purpose. The data and logic stay in DealerNode-AI; the backoffice is a BFF.
157
+ */
158
+ readonly AGENTS: {
159
+ /** Read everything that is not PII nor costs: summary, line, features, config,
160
+ * voice, KB, prompt, tools, events, assistant prompt, jobs, watchers, health,
161
+ * models, deployment. */
162
+ readonly VIEW: "backoffice.agents.view";
163
+ /** Posventa config, voice, template, KB (incl. import). Changes what the agent
164
+ * says to real customers. */
165
+ readonly CONFIG_MANAGE: "backoffice.agents.config.manage";
166
+ /** Per-dealer features and limits. Turns on automatic calls and mass messaging. */
167
+ readonly FEATURES_MANAGE: "backoffice.agents.features.manage";
168
+ /** Activity, transcripts, assistant threads. PII: names, phones, message and
169
+ * call content. */
170
+ readonly CONVERSATIONS_VIEW: "backoffice.agents.conversations.view";
171
+ /** Simulator, voice test, test a question against the KB. Calls the real model;
172
+ * the voice test calls a real phone. */
173
+ readonly SIMULATE: "backoffice.agents.simulate";
174
+ /** Chat with a dealer's assistant as the operator, with Admin powers (can send
175
+ * SMS and emails to that dealer's customers). */
176
+ readonly ASSISTANT_OPERATE: "backoffice.agents.assistant.operate";
177
+ /** Jobs, watchers, silences. Turns on real alerts to staff. */
178
+ readonly JOBS_MANAGE: "backoffice.agents.jobs.manage";
179
+ /** Onboarding, provisioning, line maintenance, suspend/reactivate. Buys numbers,
180
+ * suspends lines. */
181
+ readonly LIFECYCLE_MANAGE: "backoffice.agents.lifecycle.manage";
182
+ /** Models, provider keys, prices. Global: affects every dealer and the bill. */
183
+ readonly LLM_MANAGE: "backoffice.agents.llm.manage";
184
+ /** Costs. Billing data. */
185
+ readonly COSTS_VIEW: "backoffice.agents.costs.view";
186
+ };
153
187
  };
154
188
  export type BackofficePermission = typeof BACKOFFICE_PERMISSIONS;
155
189
  /**
@@ -168,11 +202,23 @@ export type BackofficePermissionId = Leaves<BackofficePermission>;
168
202
  * in dealernode-backend.
169
203
  */
170
204
  export declare const BACKOFFICE_PERMISSION_PRESETS: {
171
- /** Every `*.view` permission, nothing else. */
172
- readonly READ_ONLY: ("backoffice.dealers.view" | "backoffice.dealers.manage" | "backoffice.users.view" | "backoffice.users.manage" | "backoffice.permissions.manage" | "backoffice.payments.view" | "backoffice.payments.manage" | "backoffice.dealer_resources.view" | "backoffice.dealer_resources.manage" | "backoffice.catalog.view" | "backoffice.catalog.manage" | "backoffice.dealer_roles.view" | "backoffice.dealer_roles.manage" | "backoffice.dealer_members.view" | "backoffice.dealer_members.manage" | "backoffice.dealer_relationships.view" | "backoffice.dealer_relationships.manage" | "backoffice.dealer_groups.view" | "backoffice.dealer_groups.manage" | "backoffice.workflows.view" | "backoffice.workflows.manage" | "backoffice.billing.view" | "backoffice.billing.manage" | "backoffice.billing.credentials" | "backoffice.dealer_integrations.view" | "backoffice.dealer_integrations.manage" | "backoffice.emails.view" | "backoffice.dealer_notifications.view" | "backoffice.dealer_notifications.manage")[];
205
+ /**
206
+ * Every `*.view` permission except the sensitive ones
207
+ * (`SENSITIVE_VIEW_PERMISSIONS`: agent transcripts/PII and costs), nothing else.
208
+ */
209
+ readonly READ_ONLY: ("backoffice.dealers.view" | "backoffice.dealers.manage" | "backoffice.users.view" | "backoffice.users.manage" | "backoffice.permissions.manage" | "backoffice.payments.view" | "backoffice.payments.manage" | "backoffice.dealer_resources.view" | "backoffice.dealer_resources.manage" | "backoffice.catalog.view" | "backoffice.catalog.manage" | "backoffice.dealer_roles.view" | "backoffice.dealer_roles.manage" | "backoffice.dealer_members.view" | "backoffice.dealer_members.manage" | "backoffice.dealer_relationships.view" | "backoffice.dealer_relationships.manage" | "backoffice.dealer_groups.view" | "backoffice.dealer_groups.manage" | "backoffice.workflows.view" | "backoffice.workflows.manage" | "backoffice.billing.view" | "backoffice.billing.manage" | "backoffice.billing.credentials" | "backoffice.dealer_integrations.view" | "backoffice.dealer_integrations.manage" | "backoffice.emails.view" | "backoffice.dealer_notifications.view" | "backoffice.dealer_notifications.manage" | "backoffice.agents.view" | "backoffice.agents.config.manage" | "backoffice.agents.features.manage" | "backoffice.agents.conversations.view" | "backoffice.agents.simulate" | "backoffice.agents.assistant.operate" | "backoffice.agents.jobs.manage" | "backoffice.agents.lifecycle.manage" | "backoffice.agents.llm.manage" | "backoffice.agents.costs.view")[];
173
210
  /** Read-only plus the two areas support routinely needs to act on. */
174
- readonly SUPPORT: readonly [...("backoffice.dealers.view" | "backoffice.dealers.manage" | "backoffice.users.view" | "backoffice.users.manage" | "backoffice.permissions.manage" | "backoffice.payments.view" | "backoffice.payments.manage" | "backoffice.dealer_resources.view" | "backoffice.dealer_resources.manage" | "backoffice.catalog.view" | "backoffice.catalog.manage" | "backoffice.dealer_roles.view" | "backoffice.dealer_roles.manage" | "backoffice.dealer_members.view" | "backoffice.dealer_members.manage" | "backoffice.dealer_relationships.view" | "backoffice.dealer_relationships.manage" | "backoffice.dealer_groups.view" | "backoffice.dealer_groups.manage" | "backoffice.workflows.view" | "backoffice.workflows.manage" | "backoffice.billing.view" | "backoffice.billing.manage" | "backoffice.billing.credentials" | "backoffice.dealer_integrations.view" | "backoffice.dealer_integrations.manage" | "backoffice.emails.view" | "backoffice.dealer_notifications.view" | "backoffice.dealer_notifications.manage")[], "backoffice.dealers.manage", "backoffice.dealer_resources.manage", "backoffice.dealer_relationships.manage", "backoffice.dealer_integrations.manage"];
211
+ readonly SUPPORT: readonly [...("backoffice.dealers.view" | "backoffice.dealers.manage" | "backoffice.users.view" | "backoffice.users.manage" | "backoffice.permissions.manage" | "backoffice.payments.view" | "backoffice.payments.manage" | "backoffice.dealer_resources.view" | "backoffice.dealer_resources.manage" | "backoffice.catalog.view" | "backoffice.catalog.manage" | "backoffice.dealer_roles.view" | "backoffice.dealer_roles.manage" | "backoffice.dealer_members.view" | "backoffice.dealer_members.manage" | "backoffice.dealer_relationships.view" | "backoffice.dealer_relationships.manage" | "backoffice.dealer_groups.view" | "backoffice.dealer_groups.manage" | "backoffice.workflows.view" | "backoffice.workflows.manage" | "backoffice.billing.view" | "backoffice.billing.manage" | "backoffice.billing.credentials" | "backoffice.dealer_integrations.view" | "backoffice.dealer_integrations.manage" | "backoffice.emails.view" | "backoffice.dealer_notifications.view" | "backoffice.dealer_notifications.manage" | "backoffice.agents.view" | "backoffice.agents.config.manage" | "backoffice.agents.features.manage" | "backoffice.agents.conversations.view" | "backoffice.agents.simulate" | "backoffice.agents.assistant.operate" | "backoffice.agents.jobs.manage" | "backoffice.agents.lifecycle.manage" | "backoffice.agents.llm.manage" | "backoffice.agents.costs.view")[], "backoffice.dealers.manage", "backoffice.dealer_resources.manage", "backoffice.dealer_relationships.manage", "backoffice.dealer_integrations.manage"];
212
+ /**
213
+ * Operating a dealer's AI agents (A48) end to end: read, configure, simulate,
214
+ * operate the assistant, manage jobs and lifecycle, and see conversations (PII)
215
+ * and costs. Deliberately WITHOUT `AGENTS.LLM_MANAGE` — models, provider keys
216
+ * and prices are global (every dealer and the platform bill), which is
217
+ * platform-admin territory, not day-to-day AI operation. Explicit list (like
218
+ * SUPPORT), not derived, so adding an `agents.*` key never silently widens it.
219
+ */
220
+ readonly AI_SUPPORT: readonly ["backoffice.agents.view", "backoffice.agents.conversations.view", "backoffice.agents.costs.view", "backoffice.agents.config.manage", "backoffice.agents.features.manage", "backoffice.agents.simulate", "backoffice.agents.assistant.operate", "backoffice.agents.jobs.manage", "backoffice.agents.lifecycle.manage"];
175
221
  /** Every backoffice permission. */
176
- readonly ADMIN: ("backoffice.dealers.view" | "backoffice.dealers.manage" | "backoffice.users.view" | "backoffice.users.manage" | "backoffice.permissions.manage" | "backoffice.payments.view" | "backoffice.payments.manage" | "backoffice.dealer_resources.view" | "backoffice.dealer_resources.manage" | "backoffice.catalog.view" | "backoffice.catalog.manage" | "backoffice.dealer_roles.view" | "backoffice.dealer_roles.manage" | "backoffice.dealer_members.view" | "backoffice.dealer_members.manage" | "backoffice.dealer_relationships.view" | "backoffice.dealer_relationships.manage" | "backoffice.dealer_groups.view" | "backoffice.dealer_groups.manage" | "backoffice.workflows.view" | "backoffice.workflows.manage" | "backoffice.billing.view" | "backoffice.billing.manage" | "backoffice.billing.credentials" | "backoffice.dealer_integrations.view" | "backoffice.dealer_integrations.manage" | "backoffice.emails.view" | "backoffice.dealer_notifications.view" | "backoffice.dealer_notifications.manage")[];
222
+ readonly ADMIN: ("backoffice.dealers.view" | "backoffice.dealers.manage" | "backoffice.users.view" | "backoffice.users.manage" | "backoffice.permissions.manage" | "backoffice.payments.view" | "backoffice.payments.manage" | "backoffice.dealer_resources.view" | "backoffice.dealer_resources.manage" | "backoffice.catalog.view" | "backoffice.catalog.manage" | "backoffice.dealer_roles.view" | "backoffice.dealer_roles.manage" | "backoffice.dealer_members.view" | "backoffice.dealer_members.manage" | "backoffice.dealer_relationships.view" | "backoffice.dealer_relationships.manage" | "backoffice.dealer_groups.view" | "backoffice.dealer_groups.manage" | "backoffice.workflows.view" | "backoffice.workflows.manage" | "backoffice.billing.view" | "backoffice.billing.manage" | "backoffice.billing.credentials" | "backoffice.dealer_integrations.view" | "backoffice.dealer_integrations.manage" | "backoffice.emails.view" | "backoffice.dealer_notifications.view" | "backoffice.dealer_notifications.manage" | "backoffice.agents.view" | "backoffice.agents.config.manage" | "backoffice.agents.features.manage" | "backoffice.agents.conversations.view" | "backoffice.agents.simulate" | "backoffice.agents.assistant.operate" | "backoffice.agents.jobs.manage" | "backoffice.agents.lifecycle.manage" | "backoffice.agents.llm.manage" | "backoffice.agents.costs.view")[];
177
223
  };
178
224
  export {};
@@ -153,6 +153,40 @@ exports.BACKOFFICE_PERMISSIONS = {
153
153
  VIEW: "backoffice.dealer_notifications.view",
154
154
  MANAGE: "backoffice.dealer_notifications.manage",
155
155
  },
156
+ /**
157
+ * AI agents (DealerNode-AI) operated from the backoffice (A48). Reading, config,
158
+ * customer-data (PII) and actions that reach the outside world are separate keys
159
+ * on purpose. The data and logic stay in DealerNode-AI; the backoffice is a BFF.
160
+ */
161
+ AGENTS: {
162
+ /** Read everything that is not PII nor costs: summary, line, features, config,
163
+ * voice, KB, prompt, tools, events, assistant prompt, jobs, watchers, health,
164
+ * models, deployment. */
165
+ VIEW: "backoffice.agents.view",
166
+ /** Posventa config, voice, template, KB (incl. import). Changes what the agent
167
+ * says to real customers. */
168
+ CONFIG_MANAGE: "backoffice.agents.config.manage",
169
+ /** Per-dealer features and limits. Turns on automatic calls and mass messaging. */
170
+ FEATURES_MANAGE: "backoffice.agents.features.manage",
171
+ /** Activity, transcripts, assistant threads. PII: names, phones, message and
172
+ * call content. */
173
+ CONVERSATIONS_VIEW: "backoffice.agents.conversations.view",
174
+ /** Simulator, voice test, test a question against the KB. Calls the real model;
175
+ * the voice test calls a real phone. */
176
+ SIMULATE: "backoffice.agents.simulate",
177
+ /** Chat with a dealer's assistant as the operator, with Admin powers (can send
178
+ * SMS and emails to that dealer's customers). */
179
+ ASSISTANT_OPERATE: "backoffice.agents.assistant.operate",
180
+ /** Jobs, watchers, silences. Turns on real alerts to staff. */
181
+ JOBS_MANAGE: "backoffice.agents.jobs.manage",
182
+ /** Onboarding, provisioning, line maintenance, suspend/reactivate. Buys numbers,
183
+ * suspends lines. */
184
+ LIFECYCLE_MANAGE: "backoffice.agents.lifecycle.manage",
185
+ /** Models, provider keys, prices. Global: affects every dealer and the bill. */
186
+ LLM_MANAGE: "backoffice.agents.llm.manage",
187
+ /** Costs. Billing data. */
188
+ COSTS_VIEW: "backoffice.agents.costs.view",
189
+ },
156
190
  };
157
191
  function flatten(node) {
158
192
  const values = [];
@@ -168,7 +202,16 @@ function flatten(node) {
168
202
  return values;
169
203
  }
170
204
  const ALL_BACKOFFICE_PERMISSIONS = flatten(exports.BACKOFFICE_PERMISSIONS);
171
- const READ_ONLY_BACKOFFICE_PERMISSIONS = ALL_BACKOFFICE_PERMISSIONS.filter((id) => id.endsWith(".view"));
205
+ /**
206
+ * `*.view` ids intentionally kept OUT of READ_ONLY: they expose customer PII
207
+ * (transcripts, call content) or billing data, which a plain read-only operator
208
+ * should not get just because the id ends in `.view`. ADMIN still includes them.
209
+ */
210
+ const SENSITIVE_VIEW_PERMISSIONS = [
211
+ exports.BACKOFFICE_PERMISSIONS.AGENTS.CONVERSATIONS_VIEW,
212
+ exports.BACKOFFICE_PERMISSIONS.AGENTS.COSTS_VIEW,
213
+ ];
214
+ const READ_ONLY_BACKOFFICE_PERMISSIONS = ALL_BACKOFFICE_PERMISSIONS.filter((id) => id.endsWith(".view") && !SENSITIVE_VIEW_PERMISSIONS.includes(id));
172
215
  /**
173
216
  * Selection presets for the permission-assignment UI. Consumers resolve
174
217
  * these ids against their own `permission` table rows (the DB, not this
@@ -176,7 +219,10 @@ const READ_ONLY_BACKOFFICE_PERMISSIONS = ALL_BACKOFFICE_PERMISSIONS.filter((id)
176
219
  * in dealernode-backend.
177
220
  */
178
221
  exports.BACKOFFICE_PERMISSION_PRESETS = {
179
- /** Every `*.view` permission, nothing else. */
222
+ /**
223
+ * Every `*.view` permission except the sensitive ones
224
+ * (`SENSITIVE_VIEW_PERMISSIONS`: agent transcripts/PII and costs), nothing else.
225
+ */
180
226
  READ_ONLY: READ_ONLY_BACKOFFICE_PERMISSIONS,
181
227
  /** Read-only plus the two areas support routinely needs to act on. */
182
228
  SUPPORT: [
@@ -186,6 +232,25 @@ exports.BACKOFFICE_PERMISSION_PRESETS = {
186
232
  exports.BACKOFFICE_PERMISSIONS.DEALER_RELATIONSHIPS.MANAGE,
187
233
  exports.BACKOFFICE_PERMISSIONS.DEALER_INTEGRATIONS.MANAGE,
188
234
  ],
235
+ /**
236
+ * Operating a dealer's AI agents (A48) end to end: read, configure, simulate,
237
+ * operate the assistant, manage jobs and lifecycle, and see conversations (PII)
238
+ * and costs. Deliberately WITHOUT `AGENTS.LLM_MANAGE` — models, provider keys
239
+ * and prices are global (every dealer and the platform bill), which is
240
+ * platform-admin territory, not day-to-day AI operation. Explicit list (like
241
+ * SUPPORT), not derived, so adding an `agents.*` key never silently widens it.
242
+ */
243
+ AI_SUPPORT: [
244
+ exports.BACKOFFICE_PERMISSIONS.AGENTS.VIEW,
245
+ exports.BACKOFFICE_PERMISSIONS.AGENTS.CONVERSATIONS_VIEW,
246
+ exports.BACKOFFICE_PERMISSIONS.AGENTS.COSTS_VIEW,
247
+ exports.BACKOFFICE_PERMISSIONS.AGENTS.CONFIG_MANAGE,
248
+ exports.BACKOFFICE_PERMISSIONS.AGENTS.FEATURES_MANAGE,
249
+ exports.BACKOFFICE_PERMISSIONS.AGENTS.SIMULATE,
250
+ exports.BACKOFFICE_PERMISSIONS.AGENTS.ASSISTANT_OPERATE,
251
+ exports.BACKOFFICE_PERMISSIONS.AGENTS.JOBS_MANAGE,
252
+ exports.BACKOFFICE_PERMISSIONS.AGENTS.LIFECYCLE_MANAGE,
253
+ ],
189
254
  /** Every backoffice permission. */
190
255
  ADMIN: ALL_BACKOFFICE_PERMISSIONS,
191
256
  };
@@ -579,12 +579,6 @@ export declare const PERMISSIONS: {
579
579
  readonly REVOKE: "invitation.operations.revoke";
580
580
  };
581
581
  };
582
- readonly WORKFLOW: {
583
- readonly OPERATIONS: {
584
- readonly VIEW: "workflow.operations.view";
585
- readonly MANAGE: "workflow.operations.manage";
586
- };
587
- };
588
582
  readonly WHOLESALE: {
589
583
  readonly OPERATIONS: {
590
584
  readonly VIEW: "wholesale.operations.view";
@@ -628,15 +628,6 @@ exports.PERMISSIONS = {
628
628
  },
629
629
  },
630
630
  // ============================================
631
- // WORKFLOW
632
- // ============================================
633
- WORKFLOW: {
634
- OPERATIONS: {
635
- VIEW: "workflow.operations.view",
636
- MANAGE: "workflow.operations.manage",
637
- },
638
- },
639
- // ============================================
640
631
  // WHOLESALE
641
632
  // ============================================
642
633
  WHOLESALE: {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@telos-dev-team/dealernode-permissions",
3
- "version": "1.1.60",
3
+ "version": "1.1.62",
4
4
  "description": "Shared permissions constants for dealernode projects",
5
5
  "main": "dist/index.js",
6
6
  "types": "dist/index.d.ts",