@apotech-os/support-kit 9.0.0 → 10.1.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/index.d.cts CHANGED
@@ -340,8 +340,8 @@ interface AgentProfile {
340
340
  * Each optional step is nullable; `null` = step absent for this tenant.
341
341
  * Real modes: `draft: null` = tenant "triage only"; `evaluate: null` =
342
342
  * generation without evaluation (always `ready`, auto-send impossible).
343
- * `model`/`provider` are FALLBACKS ONLY: when the resolved Langfuse
344
- * prompt carries a model config, it wins (I16).
343
+ * `model`/`provider` are authoritative: the resolved Langfuse prompt's
344
+ * model config never overrides them.
345
345
  */
346
346
  nodes: {
347
347
  triage: TriageNodeConfig;
@@ -556,6 +556,13 @@ interface CompletionRequest {
556
556
  label?: string;
557
557
  resolve?: boolean;
558
558
  };
559
+ /**
560
+ * The `vars` the node handed `PromptPort.resolve` for this prompt,
561
+ * forwarded to `ctx.api.llm.complete` so the platform records them on the
562
+ * generation (spec MCP §5.4.3: `explain_ticket` shows them). Absent when
563
+ * the prompt was resolved without variables.
564
+ */
565
+ promptVariables?: Record<string, string>;
559
566
  /** Forwarded verbatim to `ctx.api.llm.complete` v2's `trace` (S2). */
560
567
  trace?: {
561
568
  sessionId?: string;
@@ -598,10 +605,9 @@ interface ResolvedPrompt {
598
605
  version: number;
599
606
  /**
600
607
  * Model config carried by the resolved Langfuse prompt, when it declares
601
- * one. WINS over `AgentProfile.nodes.<node>`'s own `model`/`provider`
602
- * (I16 — see `domain/profile.ts`'s `AgentProfile.nodes` doc: those fields
603
- * are fallbacks only). `null`/absent means "no override", the profile's
604
- * own settings apply unchanged.
608
+ * one. Informational only: no graph node or kit function calls the LLM
609
+ * with it — the model stored in the OS (`AgentProfile.nodes.<node>.model`,
610
+ * `agent.modelId`) always wins.
605
611
  */
606
612
  config?: {
607
613
  model: string;
@@ -2132,7 +2138,7 @@ declare const SUPPORT_KIT_SETTINGS_FIELDS: SettingsField[];
2132
2138
  * French translation is now a COMPILE ERROR in that map, not a silent
2133
2139
  * English leak an operator discovers on a live settings page.
2134
2140
  */
2135
- type SettingsIssueKey = 'sourceViewId' | 'nodes' | 'nodePrompt' | 'senderEmail';
2141
+ type SettingsIssueKey = 'sourceViewId' | 'appScopeTag' | 'nodes' | 'nodePrompt' | 'senderEmail';
2136
2142
  interface SettingsValidationIssue {
2137
2143
  /** The offending settings key. */
2138
2144
  key: SettingsIssueKey;
@@ -2140,8 +2146,8 @@ interface SettingsValidationIssue {
2140
2146
  message: string;
2141
2147
  }
2142
2148
  /**
2143
- * The two cross-field rules the spec names, plus the one shape rule no
2144
- * schema can express: `nodes.triage` must be configured. `nodes` has no
2149
+ * The two cross-field rules the spec names, the app's own ticket tag, plus
2150
+ * the one shape rule no schema can express: `nodes.triage` must be configured. `nodes` has no
2145
2151
  * default (a defaulted "every step null" would install a pipeline that
2146
2152
  * triages nothing), and `AgentProfile.nodes.triage` is non-nullable — this
2147
2153
  * check is what makes both safe. Per-field typing (e.g. `batchLimit` being a
@@ -2162,7 +2168,7 @@ declare function validateSettings(settings: Record<string, unknown>): SettingsVa
2162
2168
  * written in French straight away — unlike `validateSettings`' own, they are
2163
2169
  * never logged, never returned by a handler, and so need no translation layer.
2164
2170
  */
2165
- type SettingsWarningKey = 'appScopeTagVetoesFollowups' | 'appScopeTagCollision' | 'scopeTagMismatch' | 'noAutoSendChannels';
2171
+ type SettingsWarningKey = 'appScopeTagVetoesFollowups' | 'appScopeTagCollision' | 'noAutoSendChannels';
2166
2172
  interface SettingsWarning {
2167
2173
  key: SettingsWarningKey;
2168
2174
  /** Operator-facing French, safe to show as-is. */
@@ -2187,16 +2193,13 @@ declare function settingsWarnings(settings: Record<string, unknown>): SettingsWa
2187
2193
  * - `responseTtlMinutes` → `schedule.fastResponseTtlMinutes`, `batchLimit`
2188
2194
  * → `schedule.triageBatchLimit`.
2189
2195
  *
2190
- * Three settings have no profile counterpart on purpose:
2196
+ * Two settings have no profile counterpart on purpose:
2191
2197
  * `dryRun` (read by the HANDLERS — `functions/triage-tick.ts` and
2192
2198
  * `functions/process-response.ts` swap the `reply`/`state` ports for the
2193
2199
  * recorders of `adapters/recording-ports.ts` and force `send: {mode:
2194
2200
  * 'none'}` — not by the graph, which must run identically either way),
2195
- * `statsTimezone` (a §3.8 rendering concern) and `webhookScopeTag`
2196
- * (spec-gorgias-followup-webhook-v1 D2 — which tickets of a shared Gorgias
2197
- * account this app may answer a follow-up on is a routing decision, read by
2198
- * the webhook's own gates, never by a node). `to-profile.spec.ts` pins that
2199
- * list, so a new settings field cannot be forgotten here.
2201
+ * and `statsTimezone` (a §3.8 rendering concern). `to-profile.spec.ts` pins
2202
+ * that list, so a new settings field cannot be forgotten here.
2200
2203
  *
2201
2204
  * `prompts` is a PARAMETER, not derived here: `prompts.draft` is the agent
2202
2205
  * record's own Langfuse binding (§3.4), which a settings blob cannot know.
@@ -2277,9 +2280,7 @@ interface SupportKitSettings {
2277
2280
  autoRepliedTag: string;
2278
2281
  needsReviewTag: string;
2279
2282
  followupTag: string;
2280
- /** D2 — the tag scoping which tickets the follow-up webhook may answer. Empty = inert (see `settings/fields.ts`). */
2281
- webhookScopeTag: string;
2282
- /** The tag this app stamps on every ticket its triage sees. Empty = stamps nothing (see `settings/fields.ts`). */
2283
+ /** The app's ticket tag: stamped by the triage, required by the follow-up webhook, served to the extension (see `settings/fields.ts`). */
2283
2284
  appScopeTag: string;
2284
2285
  autoSendEnabled: boolean;
2285
2286
  senderEmail: string;
package/dist/index.d.ts CHANGED
@@ -340,8 +340,8 @@ interface AgentProfile {
340
340
  * Each optional step is nullable; `null` = step absent for this tenant.
341
341
  * Real modes: `draft: null` = tenant "triage only"; `evaluate: null` =
342
342
  * generation without evaluation (always `ready`, auto-send impossible).
343
- * `model`/`provider` are FALLBACKS ONLY: when the resolved Langfuse
344
- * prompt carries a model config, it wins (I16).
343
+ * `model`/`provider` are authoritative: the resolved Langfuse prompt's
344
+ * model config never overrides them.
345
345
  */
346
346
  nodes: {
347
347
  triage: TriageNodeConfig;
@@ -556,6 +556,13 @@ interface CompletionRequest {
556
556
  label?: string;
557
557
  resolve?: boolean;
558
558
  };
559
+ /**
560
+ * The `vars` the node handed `PromptPort.resolve` for this prompt,
561
+ * forwarded to `ctx.api.llm.complete` so the platform records them on the
562
+ * generation (spec MCP §5.4.3: `explain_ticket` shows them). Absent when
563
+ * the prompt was resolved without variables.
564
+ */
565
+ promptVariables?: Record<string, string>;
559
566
  /** Forwarded verbatim to `ctx.api.llm.complete` v2's `trace` (S2). */
560
567
  trace?: {
561
568
  sessionId?: string;
@@ -598,10 +605,9 @@ interface ResolvedPrompt {
598
605
  version: number;
599
606
  /**
600
607
  * Model config carried by the resolved Langfuse prompt, when it declares
601
- * one. WINS over `AgentProfile.nodes.<node>`'s own `model`/`provider`
602
- * (I16 — see `domain/profile.ts`'s `AgentProfile.nodes` doc: those fields
603
- * are fallbacks only). `null`/absent means "no override", the profile's
604
- * own settings apply unchanged.
608
+ * one. Informational only: no graph node or kit function calls the LLM
609
+ * with it — the model stored in the OS (`AgentProfile.nodes.<node>.model`,
610
+ * `agent.modelId`) always wins.
605
611
  */
606
612
  config?: {
607
613
  model: string;
@@ -2132,7 +2138,7 @@ declare const SUPPORT_KIT_SETTINGS_FIELDS: SettingsField[];
2132
2138
  * French translation is now a COMPILE ERROR in that map, not a silent
2133
2139
  * English leak an operator discovers on a live settings page.
2134
2140
  */
2135
- type SettingsIssueKey = 'sourceViewId' | 'nodes' | 'nodePrompt' | 'senderEmail';
2141
+ type SettingsIssueKey = 'sourceViewId' | 'appScopeTag' | 'nodes' | 'nodePrompt' | 'senderEmail';
2136
2142
  interface SettingsValidationIssue {
2137
2143
  /** The offending settings key. */
2138
2144
  key: SettingsIssueKey;
@@ -2140,8 +2146,8 @@ interface SettingsValidationIssue {
2140
2146
  message: string;
2141
2147
  }
2142
2148
  /**
2143
- * The two cross-field rules the spec names, plus the one shape rule no
2144
- * schema can express: `nodes.triage` must be configured. `nodes` has no
2149
+ * The two cross-field rules the spec names, the app's own ticket tag, plus
2150
+ * the one shape rule no schema can express: `nodes.triage` must be configured. `nodes` has no
2145
2151
  * default (a defaulted "every step null" would install a pipeline that
2146
2152
  * triages nothing), and `AgentProfile.nodes.triage` is non-nullable — this
2147
2153
  * check is what makes both safe. Per-field typing (e.g. `batchLimit` being a
@@ -2162,7 +2168,7 @@ declare function validateSettings(settings: Record<string, unknown>): SettingsVa
2162
2168
  * written in French straight away — unlike `validateSettings`' own, they are
2163
2169
  * never logged, never returned by a handler, and so need no translation layer.
2164
2170
  */
2165
- type SettingsWarningKey = 'appScopeTagVetoesFollowups' | 'appScopeTagCollision' | 'scopeTagMismatch' | 'noAutoSendChannels';
2171
+ type SettingsWarningKey = 'appScopeTagVetoesFollowups' | 'appScopeTagCollision' | 'noAutoSendChannels';
2166
2172
  interface SettingsWarning {
2167
2173
  key: SettingsWarningKey;
2168
2174
  /** Operator-facing French, safe to show as-is. */
@@ -2187,16 +2193,13 @@ declare function settingsWarnings(settings: Record<string, unknown>): SettingsWa
2187
2193
  * - `responseTtlMinutes` → `schedule.fastResponseTtlMinutes`, `batchLimit`
2188
2194
  * → `schedule.triageBatchLimit`.
2189
2195
  *
2190
- * Three settings have no profile counterpart on purpose:
2196
+ * Two settings have no profile counterpart on purpose:
2191
2197
  * `dryRun` (read by the HANDLERS — `functions/triage-tick.ts` and
2192
2198
  * `functions/process-response.ts` swap the `reply`/`state` ports for the
2193
2199
  * recorders of `adapters/recording-ports.ts` and force `send: {mode:
2194
2200
  * 'none'}` — not by the graph, which must run identically either way),
2195
- * `statsTimezone` (a §3.8 rendering concern) and `webhookScopeTag`
2196
- * (spec-gorgias-followup-webhook-v1 D2 — which tickets of a shared Gorgias
2197
- * account this app may answer a follow-up on is a routing decision, read by
2198
- * the webhook's own gates, never by a node). `to-profile.spec.ts` pins that
2199
- * list, so a new settings field cannot be forgotten here.
2201
+ * and `statsTimezone` (a §3.8 rendering concern). `to-profile.spec.ts` pins
2202
+ * that list, so a new settings field cannot be forgotten here.
2200
2203
  *
2201
2204
  * `prompts` is a PARAMETER, not derived here: `prompts.draft` is the agent
2202
2205
  * record's own Langfuse binding (§3.4), which a settings blob cannot know.
@@ -2277,9 +2280,7 @@ interface SupportKitSettings {
2277
2280
  autoRepliedTag: string;
2278
2281
  needsReviewTag: string;
2279
2282
  followupTag: string;
2280
- /** D2 — the tag scoping which tickets the follow-up webhook may answer. Empty = inert (see `settings/fields.ts`). */
2281
- webhookScopeTag: string;
2282
- /** The tag this app stamps on every ticket its triage sees. Empty = stamps nothing (see `settings/fields.ts`). */
2283
+ /** The app's ticket tag: stamped by the triage, required by the follow-up webhook, served to the extension (see `settings/fields.ts`). */
2283
2284
  appScopeTag: string;
2284
2285
  autoSendEnabled: boolean;
2285
2286
  senderEmail: string;