@happyvertical/smrt-support 0.51.30 → 0.51.32

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.
@@ -2,7 +2,7 @@
2
2
  "version": "1.0.0",
3
3
  "timestamp": 0,
4
4
  "packageName": "@happyvertical/smrt-support",
5
- "packageVersion": "0.51.30",
5
+ "packageVersion": "0.51.32",
6
6
  "objects": {
7
7
  "@happyvertical/smrt-support:ServiceTimeEntry": {
8
8
  "name": "servicetimeentry",
@@ -2059,6 +2059,20 @@
2059
2059
  "isStatic": false,
2060
2060
  "isPublic": true
2061
2061
  },
2062
+ "attemptTriageDecision": {
2063
+ "name": "attemptTriageDecision",
2064
+ "async": true,
2065
+ "parameters": [
2066
+ {
2067
+ "name": "request",
2068
+ "type": "DecisionRequest",
2069
+ "optional": false
2070
+ }
2071
+ ],
2072
+ "returnType": "Promise<DecisionResult | undefined>",
2073
+ "isStatic": false,
2074
+ "isPublic": true
2075
+ },
2062
2076
  "initialize": {
2063
2077
  "name": "initialize",
2064
2078
  "async": true,
@@ -5025,6 +5039,11 @@
5025
5039
  "required": false,
5026
5040
  "_meta": {}
5027
5041
  },
5042
+ "allowedCategories": {
5043
+ "type": "text",
5044
+ "required": false,
5045
+ "_meta": {}
5046
+ },
5028
5047
  "allowedTools": {
5029
5048
  "type": "text",
5030
5049
  "required": false,
@@ -5059,6 +5078,28 @@
5059
5078
  "isStatic": false,
5060
5079
  "isPublic": true
5061
5080
  },
5081
+ "getAllowedCategories": {
5082
+ "name": "getAllowedCategories",
5083
+ "async": false,
5084
+ "parameters": [],
5085
+ "returnType": "string[]",
5086
+ "isStatic": false,
5087
+ "isPublic": true
5088
+ },
5089
+ "setAllowedCategories": {
5090
+ "name": "setAllowedCategories",
5091
+ "async": false,
5092
+ "parameters": [
5093
+ {
5094
+ "name": "categories",
5095
+ "type": "string[]",
5096
+ "optional": false
5097
+ }
5098
+ ],
5099
+ "returnType": "void",
5100
+ "isStatic": false,
5101
+ "isPublic": true
5102
+ },
5062
5103
  "getAllowedTools": {
5063
5104
  "name": "getAllowedTools",
5064
5105
  "async": false,
@@ -5148,7 +5189,7 @@
5148
5189
  "collectionExportName": "SupportPolicyCollection",
5149
5190
  "schema": {
5150
5191
  "tableName": "support_policies",
5151
- "ddl": "CREATE TABLE IF NOT EXISTS \"support_policies\" (\n \"id\" UUID PRIMARY KEY NOT NULL,\n \"slug\" TEXT NOT NULL,\n \"context\" TEXT NOT NULL DEFAULT '',\n \"created_at\" TIMESTAMP NOT NULL DEFAULT current_timestamp,\n \"updated_at\" TIMESTAMP NOT NULL DEFAULT current_timestamp,\n \"tenant_id\" UUID,\n \"name\" TEXT DEFAULT '',\n \"plan_id\" UUID,\n \"project_id\" TEXT,\n \"enabled\" BOOLEAN,\n \"auto_acknowledge\" BOOLEAN,\n \"auto_classify\" BOOLEAN,\n \"auto_answer\" BOOLEAN,\n \"auto_troubleshoot\" BOOLEAN,\n \"auto_resolve\" BOOLEAN,\n \"auto_resolve_max_severity\" TEXT,\n \"confidence_threshold\" REAL DEFAULT 0.7,\n \"max_auto_attempts\" INTEGER DEFAULT 1,\n \"auto_send_email_replies\" BOOLEAN,\n \"sensitive_categories\" TEXT,\n \"allowed_tools\" TEXT,\n \"metadata\" TEXT\n);",
5192
+ "ddl": "CREATE TABLE IF NOT EXISTS \"support_policies\" (\n \"id\" UUID PRIMARY KEY NOT NULL,\n \"slug\" TEXT NOT NULL,\n \"context\" TEXT NOT NULL DEFAULT '',\n \"created_at\" TIMESTAMP NOT NULL DEFAULT current_timestamp,\n \"updated_at\" TIMESTAMP NOT NULL DEFAULT current_timestamp,\n \"tenant_id\" UUID,\n \"name\" TEXT DEFAULT '',\n \"plan_id\" UUID,\n \"project_id\" TEXT,\n \"enabled\" BOOLEAN,\n \"auto_acknowledge\" BOOLEAN,\n \"auto_classify\" BOOLEAN,\n \"auto_answer\" BOOLEAN,\n \"auto_troubleshoot\" BOOLEAN,\n \"auto_resolve\" BOOLEAN,\n \"auto_resolve_max_severity\" TEXT,\n \"confidence_threshold\" REAL DEFAULT 0.7,\n \"max_auto_attempts\" INTEGER DEFAULT 1,\n \"auto_send_email_replies\" BOOLEAN,\n \"sensitive_categories\" TEXT,\n \"allowed_categories\" TEXT,\n \"allowed_tools\" TEXT,\n \"metadata\" TEXT\n);",
5152
5193
  "columns": {
5153
5194
  "id": {
5154
5195
  "type": "UUID",
@@ -5261,6 +5302,11 @@
5261
5302
  "notNull": false,
5262
5303
  "unique": false
5263
5304
  },
5305
+ "allowed_categories": {
5306
+ "type": "TEXT",
5307
+ "notNull": false,
5308
+ "unique": false
5309
+ },
5264
5310
  "allowed_tools": {
5265
5311
  "type": "TEXT",
5266
5312
  "notNull": false,
@@ -5303,7 +5349,7 @@
5303
5349
  ]
5304
5350
  }
5305
5351
  ],
5306
- "version": "61b60e25"
5352
+ "version": "db53199e"
5307
5353
  },
5308
5354
  "importPath": "@happyvertical/smrt-support"
5309
5355
  },
@@ -5343,7 +5389,7 @@
5343
5389
  "collectionExportName": "SupportPolicyCollectionCollection",
5344
5390
  "schema": {
5345
5391
  "tableName": "support_policies",
5346
- "ddl": "CREATE TABLE IF NOT EXISTS \"support_policies\" (\n \"id\" UUID PRIMARY KEY NOT NULL,\n \"slug\" TEXT NOT NULL,\n \"context\" TEXT NOT NULL DEFAULT '',\n \"created_at\" TIMESTAMP NOT NULL DEFAULT current_timestamp,\n \"updated_at\" TIMESTAMP NOT NULL DEFAULT current_timestamp,\n \"tenant_id\" UUID,\n \"name\" TEXT DEFAULT '',\n \"plan_id\" UUID,\n \"project_id\" TEXT,\n \"enabled\" BOOLEAN,\n \"auto_acknowledge\" BOOLEAN,\n \"auto_classify\" BOOLEAN,\n \"auto_answer\" BOOLEAN,\n \"auto_troubleshoot\" BOOLEAN,\n \"auto_resolve\" BOOLEAN,\n \"auto_resolve_max_severity\" TEXT,\n \"confidence_threshold\" REAL DEFAULT 0.7,\n \"max_auto_attempts\" INTEGER DEFAULT 1,\n \"auto_send_email_replies\" BOOLEAN,\n \"sensitive_categories\" TEXT,\n \"allowed_tools\" TEXT,\n \"metadata\" TEXT\n);",
5392
+ "ddl": "CREATE TABLE IF NOT EXISTS \"support_policies\" (\n \"id\" UUID PRIMARY KEY NOT NULL,\n \"slug\" TEXT NOT NULL,\n \"context\" TEXT NOT NULL DEFAULT '',\n \"created_at\" TIMESTAMP NOT NULL DEFAULT current_timestamp,\n \"updated_at\" TIMESTAMP NOT NULL DEFAULT current_timestamp,\n \"tenant_id\" UUID,\n \"name\" TEXT DEFAULT '',\n \"plan_id\" UUID,\n \"project_id\" TEXT,\n \"enabled\" BOOLEAN,\n \"auto_acknowledge\" BOOLEAN,\n \"auto_classify\" BOOLEAN,\n \"auto_answer\" BOOLEAN,\n \"auto_troubleshoot\" BOOLEAN,\n \"auto_resolve\" BOOLEAN,\n \"auto_resolve_max_severity\" TEXT,\n \"confidence_threshold\" REAL DEFAULT 0.7,\n \"max_auto_attempts\" INTEGER DEFAULT 1,\n \"auto_send_email_replies\" BOOLEAN,\n \"sensitive_categories\" TEXT,\n \"allowed_categories\" TEXT,\n \"allowed_tools\" TEXT,\n \"metadata\" TEXT\n);",
5347
5393
  "columns": {
5348
5394
  "id": {
5349
5395
  "type": "UUID",
@@ -5456,6 +5502,11 @@
5456
5502
  "notNull": false,
5457
5503
  "unique": false
5458
5504
  },
5505
+ "allowed_categories": {
5506
+ "type": "TEXT",
5507
+ "notNull": false,
5508
+ "unique": false
5509
+ },
5459
5510
  "allowed_tools": {
5460
5511
  "type": "TEXT",
5461
5512
  "notNull": false,
@@ -5498,7 +5549,7 @@
5498
5549
  ]
5499
5550
  }
5500
5551
  ],
5501
- "version": "61b60e25"
5552
+ "version": "db53199e"
5502
5553
  },
5503
5554
  "importPath": "@happyvertical/smrt-support"
5504
5555
  },
@@ -8,8 +8,10 @@ export declare class SupportAiRun extends SmrtObject {
8
8
  phase: SupportAiRunPhase;
9
9
  outcome: SupportAiRunOutcome;
10
10
  /**
11
- * Model-reported confidence in [0, 1] for answer/classify/resolve phases;
12
- * null when the phase has no confidence semantics (e.g. acknowledge).
11
+ * Model-reported answer/resolve confidence or the classification audit
12
+ * certainty in [0, 1]. Classification certainty is not calibrated answer
13
+ * confidence and never controls the answer policy threshold. Null when the
14
+ * phase has no confidence semantics (e.g. acknowledge).
13
15
  */
14
16
  confidence: number | null;
15
17
  /** Classification output JSON: severity, category, sentiment, sensitive. */
@@ -1 +1 @@
1
- {"version":3,"file":"support-ai-run.d.ts","sourceRoot":"","sources":["../../src/models/support-ai-run.ts"],"names":[],"mappings":"AAAA;;;;;;;;;GASG;AAEH,OAAO,EAGL,cAAc,EACd,UAAU,EAEX,MAAM,0BAA0B,CAAC;AAElC,OAAO,EAEL,KAAK,mBAAmB,EACxB,KAAK,iBAAiB,EACvB,MAAM,aAAa,CAAC;AAErB,qBAOa,YAAa,SAAQ,UAAU;IAE1C,QAAQ,EAAE,MAAM,GAAG,IAAI,CAAQ;IAG/B,MAAM,EAAE,MAAM,CAAM;IAEpB,oEAAoE;IAEpE,aAAa,EAAE,MAAM,GAAG,IAAI,CAAQ;IAGpC,KAAK,EAAE,iBAAiB,CAAiB;IAGzC,OAAO,EAAE,mBAAmB,CAAe;IAE3C;;;OAGG;IAEH,UAAU,EAAE,MAAM,GAAG,IAAI,CAAQ;IAEjC,4EAA4E;IAE5E,cAAc,EAAE,MAAM,CAAQ;IAE9B,wEAAwE;IAExE,qBAAqB,EAAE,MAAM,GAAG,IAAI,CAAQ;IAE5C,yEAAyE;IAEzE,aAAa,EAAE,MAAM,CAAQ;IAE7B,gEAAgE;IAEhE,SAAS,EAAE,MAAM,CAAQ;IAEzB,gDAAgD;IAEhD,KAAK,EAAE,MAAM,CAAM;IAEnB,6EAA6E;IAE7E,aAAa,EAAE,MAAM,CAAM;IAE3B,yCAAyC;IAEzC,KAAK,EAAE,MAAM,CAAM;IAEnB,SAAS,EAAE,IAAI,CAAc;IAE7B,WAAW,EAAE,IAAI,GAAG,IAAI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4 +1,4 @@
1
- import { SmrtCollection, SmrtObject } from '@happyvertical/smrt-core';
1
+ import { DecisionRequest, DecisionResult, SmrtCollection, SmrtObject } from '@happyvertical/smrt-core';
2
2
  import { SupportCaseStatus } from '../types.js';
3
3
  /** Generate a short human-facing case number (unique enough per tenant). */
4
4
  export declare function generateCaseNumber(now?: Date): string;
@@ -84,6 +84,14 @@ export declare class SupportCase extends SmrtObject {
84
84
  updateMetadata(patch: Record<string, unknown>): void;
85
85
  getPlanSnapshot(): Record<string, unknown>;
86
86
  setPlanSnapshot(value: Record<string, unknown>): void;
87
+ /**
88
+ * Attempt typed support triage without changing the established tool route.
89
+ *
90
+ * A configured decision client is deliberately resolved only after the tool
91
+ * guard, matching the core routing rule. `undefined` means the caller must
92
+ * use its legacy generative behavior.
93
+ */
94
+ attemptTriageDecision(request: DecisionRequest): Promise<DecisionResult | undefined>;
87
95
  /**
88
96
  * Capture the status the row was loaded with so the save-time guard can
89
97
  * reject illegal flips made via raw field assignment.
@@ -1 +1 @@
1
- {"version":3,"file":"support-case.d.ts","sourceRoot":"","sources":["../../src/models/support-case.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;GAUG;AAEH,OAAO,EAIL,cAAc,EACd,UAAU,EAEX,MAAM,0BAA0B,CAAC;AAElC,OAAO,EAIL,KAAK,iBAAiB,EACvB,MAAM,aAAa,CAAC;AAQrB,4EAA4E;AAC5E,wBAAgB,kBAAkB,CAAC,GAAG,GAAE,IAAiB,GAAG,MAAM,CAIjE;AAED,qBAOa,WAAY,SAAQ,UAAU;IAEzC,QAAQ,EAAE,MAAM,GAAG,IAAI,CAAQ;IAE/B,0EAA0E;IAE1E,UAAU,EAAE,MAAM,CAAM;IAExB,kDAAkD;IAElD,OAAO,EAAE,MAAM,CAAM;IAErB,mEAAmE;IAEnE,WAAW,EAAE,MAAM,CAAM;IAGzB,MAAM,EAAE,iBAAiB,CAAS;IAElC,qEAAqE;IAErE,QAAQ,EAAE,MAAM,CAAY;IAE5B;;;O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e,WAAW,CAAC"}
@@ -16,6 +16,7 @@ export declare const DEFAULT_SUPPORT_POLICY: {
16
16
  readonly maxAutoAttempts: 1;
17
17
  readonly autoSendEmailReplies: false;
18
18
  readonly sensitiveCategories: string[];
19
+ readonly allowedCategories: string[];
19
20
  readonly allowedTools: string[];
20
21
  };
21
22
  export declare class SupportPolicy extends SmrtObject {
@@ -56,11 +57,18 @@ export declare class SupportPolicy extends SmrtObject {
56
57
  * triggers a Human Handoff (FR-28b). JSON array of category keys.
57
58
  */
58
59
  sensitiveCategories: string;
60
+ /**
61
+ * Optional closed vocabulary for AI classification categories. Empty keeps
62
+ * the legacy free-vocabulary category generation path.
63
+ */
64
+ allowedCategories: string;
59
65
  /** Tool ids the troubleshooting phase may execute. JSON array, fail-closed. */
60
66
  allowedTools: string;
61
67
  metadata: string;
62
68
  getSensitiveCategories(): string[];
63
69
  setSensitiveCategories(categories: string[]): void;
70
+ getAllowedCategories(): string[];
71
+ setAllowedCategories(categories: string[]): void;
64
72
  getAllowedTools(): string[];
65
73
  setAllowedTools(tools: string[]): void;
66
74
  getMetadata(): Record<string, unknown>;
@@ -1 +1 @@
1
- {"version":3,"file":"support-policy.d.ts","sourceRoot":"","sources":["../../src/models/support-policy.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;GAUG;AAEH,OAAO,EAGL,cAAc,EACd,UAAU,EAEX,MAAM,0BAA0B,CAAC;AAIlC;;;;;GAKG;AACH,eAAO,MAAM,sBAAsB;;;;;;;;;;kCAUN,MAAM,EAAE;2BACf,MAAM,EAAE;CACpB,CAAC;AAEX,qBAQa,aAAc,SAAQ,UAAU;IAE3C,QAAQ,EAAE,MAAM,GAAG,IAAI,CAAQ;IAE/B,0DAA0D;IAC1D,IAAI,EAAE,MAAM,CAAM;IAElB,iEAAiE;IAEjE,MAAM,EAAE,MAAM,GAAG,IAAI,CAAQ;IAE7B,yEAAyE;IAEzE,SAAS,EAAE,MAAM,GAAG,IAAI,CAAQ;IAGhC,OAAO,EAAE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,CAAC,UAAU,EAAE,MAAM,EAAE,GAAG,IAAI;IAIlD,oBAAoB,IAAI,MAAM,EAAE;IAIhC,oBAAoB,CAAC,UAAU,EAAE,MAAM,EAAE,GAAG,IAAI;IAIhD,eAAe,IAAI,MAAM,EAAE;IAI3B,eAAe,CAAC,KAAK,EAAE,MAAM,EAAE,GAAG,IAAI;IAItC,WAAW,IAAI,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC;IAItC,WAAW,CAAC,KAAK,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,GAAG,IAAI;IAIjD,sEAAsE;IACtE,SAAS,IAAI,MAAM;CAMpB;AAED,qBAAa,uBAAwB,SAAQ,cAAc,CAAC,aAAa,CAAC;IACxE,MAAM,CAAC,QAAQ,CAAC,UAAU,uBAAiB;IAE3C;;;;OAIG;IACG,eAAe,CAAC,OAAO,EAAE;QAC7B,MAAM,CAAC,EAAE,MAAM,GAAG,IAAI,CAAC;QACvB,SAAS,CAAC,EAAE,MAAM,GAAG,IAAI,CAAC;KAC3B,GAAG,OAAO,CAAC,aAAa,GAAG,IAAI,CAAC;CAYlC;AAED,eAAe,aAAa,CAAC"}
@@ -3,7 +3,7 @@ import { SupportAiRun, SupportAiRunCollection } from '../models/support-ai-run.j
3
3
  import { SupportCase } from '../models/support-case.js';
4
4
  import { SupportInteractionCollection } from '../models/support-interaction.js';
5
5
  import { SupportPolicyCollection } from '../models/support-policy.js';
6
- import { HumanHandoffTrigger } from '../types.js';
6
+ import { HumanHandoffTrigger, SeverityDefinition } from '../types.js';
7
7
  import { HumanHandoffService } from './human-handoff-service.js';
8
8
  import { SupportCaseService } from './support-case-service.js';
9
9
  import { IntakeResult } from './support-intake-service.js';
@@ -24,10 +24,17 @@ export interface SupportAiClassifyResult {
24
24
  category: string;
25
25
  /** Whether the matter is sensitive (always triggers a Human Handoff). */
26
26
  sensitive: boolean;
27
- /** Confidence in `[0, 1]`. */
27
+ /** Whether a typed decision lacked a unique majority and requires a human. */
28
+ ambiguous?: boolean;
29
+ /**
30
+ * Classification certainty in `[0, 1]`. Typed decisions use an audit-only
31
+ * operating aggregate; this is never the answer confidence policy consumes.
32
+ */
28
33
  confidence: number;
29
34
  /** Model identifier, when the boundary knows it. */
30
35
  model?: string;
36
+ /** Additive provenance for an optional typed-decision classification. */
37
+ metadata?: Record<string, unknown>;
31
38
  }
32
39
  /** Draft answer returned by {@link SupportAiBoundary.answer}. */
33
40
  export interface SupportAiAnswerResult {
@@ -49,6 +56,8 @@ export interface SupportAiBoundary {
49
56
  subject: string;
50
57
  body: string;
51
58
  severityKeys: string[];
59
+ severityDefinitions?: Record<string, SeverityDefinition>;
60
+ allowedCategories?: string[];
52
61
  sensitiveCategories: string[];
53
62
  }): Promise<SupportAiClassifyResult>;
54
63
  answer(input: {
@@ -152,6 +161,8 @@ export declare class SupportAiWorkflow {
152
161
  private requestBodyOf;
153
162
  /** Severity vocabulary: the case's plan snapshot, else the defaults. */
154
163
  private severityKeysOf;
164
+ /** Severity vocabulary and definitions from the frozen plan snapshot. */
165
+ private severityDefinitionsOf;
155
166
  /** One-line case summary handed to the answer boundary. */
156
167
  private caseSummaryOf;
157
168
  /** Route a trigger through the handoff engine and notify the app seam. */
@@ -1 +1 @@
1
- {"version":3,"file":"support-ai-workflow.d.ts","sourceRoot":"","sources":["../../src/services/support-ai-workflow.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;GAgBG;AAEH,OAAO,KAAK,EAAE,iBAAiB,EAAE,MAAM,0BAA0B,CAAC;AAClE,OAAO,EACL,KAAK,YAAY,EACjB,sBAAsB,EACvB,MAAM,6BAA6B,CAAC;AACrC,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,2BAA2B,CAAC;AAC7D,OAAO,EAAE,4BAA4B,EAAE,MAAM,kCAAkC,CAAC;AAChF,OAAO,EAEL,uBAAuB,EACxB,MAAM,6BAA6B,CAAC;AACrC,OAAO,EAEL,KAAK,mBAAmB,EAIzB,MAAM,aAAa,CAAC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GAKG;AACH,wBAAgB,uBAAuB,CACrC,OAAO,EAAE,MAAM,WAAW,GACzB,iBAAiB,CA4BnB;AAgGD,eAAe,iBAAiB,CAAC"}
1
+ {"version":3,"file":"support-ai-workflow.d.ts","sourceRoot":"","sources":["../../src/services/support-ai-workflow.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;GAgBG;AAEH,OAAO,KAAK,EAEV,iBAAiB,EAClB,MAAM,0BAA0B,CAAC;AAClC,OAAO,EACL,KAAK,YAAY,EACjB,sBAAsB,EACvB,MAAM,6BAA6B,CAAC;AACrC,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,2BAA2B,CAAC;AAC7D,OAAO,EAAE,4BAA4B,EAAE,MAAM,kCAAkC,CAAC;AAChF,OAAO,EAEL,uBAAuB,EACxB,MAAM,6BAA6B,CAAC;AACrC,OAAO,EAEL,KAAK,mBAAmB,EACxB,KAAK,kBAAkB,EAIxB,MAAM,aAAa,CAAC;AACrB,OAAO,EAAE,mBAAmB,EAAE,MAAM,4BAA4B,CAAC;AACjE,OAAO,EAAE,kBAAkB,EAAE,MAAM,2BAA2B,CAAC;AAC/D,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,6BAA6B,CAAC;AAEhE,yEAAyE;AACzE,MAAM,WAAW,gBAAgB;IAC/B,uDAAuD;IACvD,IAAI,EAAE,MAAM,CAAC;IACb,+DAA+D;IAC/D,GAAG,EAAE,MAAM,CAAC;IACZ,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,OAAO,EAAE,MAAM,CAAC;CACjB;AAED,qEAAqE;AACrE,MAAM,WAAW,uBAAuB;IACtC,mEAAmE;IACnE,QAAQ,EAAE,MAAM,CAAC;IACjB,iEAAiE;IACjE,QAAQ,EAAE,MAAM,CAAC;IACjB,yEAAyE;IACzE,SAAS,EAAE,OAAO,CAAC;IACnB,8EAA8E;IAC9E,SAAS,CAAC,EAAE,OAAO,CAAC;IACpB;;;OAGG;IACH,UAAU,EAAE,MAAM,CA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wBAAwB,CAAC;QACpC,SAAS,CAAC,EAAE,CAAC,MAAM,EAAE,oBAAoB,KAAK,OAAO,CAAC,IAAI,CAAC,CAAC;KAC7D;WAWY,MAAM,CACjB,OAAO,EAAE,wBAAwB,GAChC,OAAO,CAAC,iBAAiB,CAAC;IAuB7B;;;OAGG;IACG,aAAa,CAAC,MAAM,EAAE,YAAY,GAAG,OAAO,CAAC,YAAY,EAAE,CAAC;IAUlE;;;;;OAKG;IACG,WAAW,CACf,MAAM,EAAE,MAAM,EACd,IAAI,GAAE;QAAE,aAAa,CAAC,EAAE,MAAM,GAAG,IAAI,CAAA;KAAO,GAC3C,OAAO,CAAC,YAAY,EAAE,CAAC;IAyU1B,mEAAmE;YACrD,cAAc;IA8C5B,qEAAqE;IACrE,OAAO,CAAC,iBAAiB;IAuCzB,0EAA0E;YAC5D,sBAAsB;IAiCpC;;;;OAIG;YACW,mBAAmB;IAOjC;2BACuB;YACT,aAAa;IAa3B,wEAAwE;IACxE,OAAO,CAAC,cAAc;IAItB,yEAAyE;IACzE,OAAO,CAAC,qBAAqB;IAqB7B,2DAA2D;IAC3D,OAAO,CAAC,aAAa;IAcrB,0EAA0E;YAC5D,cAAc;IAc5B,yDAAyD;YAC3C,QAAQ;IA8CtB,wCAAwC;IACxC,OAAO,CAAC,QAAQ;CAMjB;AAED;;;;GAIG;AACH,wBAAgB,2BAA2B,IAAI,wBAAwB,CAItE;AAqHD;;;;;GAKG;AACH,wBAAgB,uBAAuB,CACrC,OAAO,EAAE,MAAM,WAAW,GACzB,iBAAiB,CAmEnB;AAgHD,eAAe,iBAAiB,CAAC"}
@@ -3,12 +3,12 @@
3
3
  "sensitiveFieldsExcluded": true,
4
4
  "generatedAt": "1970-01-01T00:00:00.000Z",
5
5
  "packageName": "@happyvertical/smrt-support",
6
- "packageVersion": "0.51.30",
6
+ "packageVersion": "0.51.32",
7
7
  "sourceManifestPath": "dist/manifest.json",
8
8
  "agentDocPath": "AGENTS.md",
9
9
  "sourceHashes": {
10
- "manifest": "ed9ae7a21f73f3020004a51a3fc4fc897ae9b48ab535e68cef1a8e5c0a78736a",
11
- "packageJson": "2ba49c6c6ac26c910460a28932fcd1cee41768eaf05d8044c06855444c3a80d5",
10
+ "manifest": "bbc42c6222cbbc34e6cc8a0fd73502d03323c1182a4701d25b51001441fbb2e8",
11
+ "packageJson": "d589b22822a4acd3e9e09c8149965cad594969c0a6c393c1d3f90a68caec413c",
12
12
  "agents": "57d75c4e48c549de0e7e50bfc16d739384cd37f4a0c66f0375d1985b24e6cbdd"
13
13
  },
14
14
  "exports": [
@@ -1368,6 +1368,7 @@
1368
1368
  }
1369
1369
  ],
1370
1370
  "methods": [
1371
+ "attemptTriageDecision",
1371
1372
  "getMetadata",
1372
1373
  "getPlanSnapshot",
1373
1374
  "initialize",
@@ -1378,6 +1379,14 @@
1378
1379
  "updateMetadata"
1379
1380
  ],
1380
1381
  "methodSignatures": [
1382
+ {
1383
+ "name": "attemptTriageDecision",
1384
+ "async": true,
1385
+ "params": [
1386
+ "request: DecisionRequest"
1387
+ ],
1388
+ "returns": "Promise<DecisionResult | undefined>"
1389
+ },
1381
1390
  {
1382
1391
  "name": "getMetadata",
1383
1392
  "returns": "Record<string, unknown>"
@@ -1475,6 +1484,13 @@
1475
1484
  }
1476
1485
  ],
1477
1486
  "withheldSurfaces": [
1487
+ {
1488
+ "kind": "api",
1489
+ "operation": "attemptTriageDecision",
1490
+ "code": "not-included",
1491
+ "reason": "not listed in api.include",
1492
+ "objectName": "@happyvertical/smrt-support:SupportCase"
1493
+ },
1478
1494
  {
1479
1495
  "kind": "api",
1480
1496
  "operation": "getMetadata",
@@ -3078,6 +3094,12 @@
3078
3094
  "required": false,
3079
3095
  "columnType": "TEXT"
3080
3096
  },
3097
+ {
3098
+ "name": "allowedCategories",
3099
+ "type": "text",
3100
+ "required": false,
3101
+ "columnType": "TEXT"
3102
+ },
3081
3103
  {
3082
3104
  "name": "allowedTools",
3083
3105
  "type": "text",
@@ -3101,15 +3123,21 @@
3101
3123
  }
3102
3124
  ],
3103
3125
  "methods": [
3126
+ "getAllowedCategories",
3104
3127
  "getAllowedTools",
3105
3128
  "getMetadata",
3106
3129
  "getSensitiveCategories",
3107
3130
  "scopeRank",
3131
+ "setAllowedCategories",
3108
3132
  "setAllowedTools",
3109
3133
  "setMetadata",
3110
3134
  "setSensitiveCategories"
3111
3135
  ],
3112
3136
  "methodSignatures": [
3137
+ {
3138
+ "name": "getAllowedCategories",
3139
+ "returns": "string[]"
3140
+ },
3113
3141
  {
3114
3142
  "name": "getAllowedTools",
3115
3143
  "returns": "string[]"
@@ -3126,6 +3154,13 @@
3126
3154
  "name": "scopeRank",
3127
3155
  "returns": "number"
3128
3156
  },
3157
+ {
3158
+ "name": "setAllowedCategories",
3159
+ "params": [
3160
+ "categories: string[]"
3161
+ ],
3162
+ "returns": "void"
3163
+ },
3129
3164
  {
3130
3165
  "name": "setAllowedTools",
3131
3166
  "params": [
@@ -3224,6 +3259,13 @@
3224
3259
  }
3225
3260
  ],
3226
3261
  "withheldSurfaces": [
3262
+ {
3263
+ "kind": "api",
3264
+ "operation": "getAllowedCategories",
3265
+ "code": "not-included",
3266
+ "reason": "not listed in api.include",
3267
+ "objectName": "@happyvertical/smrt-support:SupportPolicy"
3268
+ },
3227
3269
  {
3228
3270
  "kind": "api",
3229
3271
  "operation": "getAllowedTools",
@@ -3252,6 +3294,13 @@
3252
3294
  "reason": "not listed in api.include",
3253
3295
  "objectName": "@happyvertical/smrt-support:SupportPolicy"
3254
3296
  },
3297
+ {
3298
+ "kind": "api",
3299
+ "operation": "setAllowedCategories",
3300
+ "code": "not-included",
3301
+ "reason": "not listed in api.include",
3302
+ "objectName": "@happyvertical/smrt-support:SupportPolicy"
3303
+ },
3255
3304
  {
3256
3305
  "kind": "api",
3257
3306
  "operation": "setAllowedTools",
package/dist/types.d.ts CHANGED
@@ -45,7 +45,7 @@ export type SupportAiRunPhase = 'acknowledge' | 'classify' | 'answer' | 'trouble
45
45
  /** Terminal outcome of one AI workflow phase run. */
46
46
  export type SupportAiRunOutcome = 'completed' | 'skipped' | 'failed' | 'handed_off';
47
47
  /** What triggered a Human Handoff (FR-28b). */
48
- export type HumanHandoffTrigger = 'client_request' | 'low_confidence' | 'high_severity' | 'sensitive' | 'failed_resolution' | 'target_risk' | 'policy' | 'manual';
48
+ export type HumanHandoffTrigger = 'client_request' | 'low_confidence' | 'ambiguous_classification' | 'high_severity' | 'sensitive' | 'failed_resolution' | 'target_risk' | 'policy' | 'manual';
49
49
  /** Service Time Entry lifecycle (FR-36). */
50
50
  export type ServiceTimeEntryStatus = 'draft' | 'submitted' | 'approved' | 'rejected' | 'corrected';
51
51
  /**
@@ -1 +1 @@
1
- {"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../src/types.ts"],"names":[],"mappings":"AAAA;;;;;;;;;GASG;AAEH,8CAA8C;AAC9C,MAAM,MAAM,iBAAiB,GACzB,KAAK,GACL,SAAS,GACT,UAAU,GACV,aAAa,GACb,mBAAmB,GACnB,WAAW,GACX,UAAU,GACV,QAAQ,CAAC;AAEb;;;;;;GAMG;AACH,eAAO,MAAM,+BAA+B,EAAE,MAAM,CAClD,iBAAiB,EACjB,iBAAiB,EAAE,CAkDpB,CAAC;AAEF,uEAAuE;AACvE,eAAO,MAAM,0BAA0B,EAAE,iBAAiB,EAOzD,CAAC;AAEF,gEAAgE;AAChE,MAAM,MAAM,mBAAmB,GAAG,KAAK,GAAG,QAAQ,GAAG,MAAM,GAAG,QAAQ,CAAC;AAEvE,4DAA4D;AAC5D,MAAM,MAAM,kBAAkB,GAC1B,MAAM,GACN,OAAO,GACP,OAAO,GACP,OAAO,GACP,KAAK,GACL,KAAK,CAAC;AAEV,iEAAiE;AACjE,MAAM,MAAM,2BAA2B,GAAG,SAAS,GAAG,UAAU,GAAG,UAAU,CAAC;AAE9E,kDAAkD;AAClD,MAAM,MAAM,gBAAgB,GAAG,QAAQ,GAAG,YAAY,GAAG,OAAO,GAAG,QAAQ,CAAC;A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,IAAI,GAAG,SAAS,GAC7B,MAAM,EAAE,CAKV"}
package/dist/types.js.map CHANGED
@@ -1 +1 @@
1
- {"version":3,"file":"types.js","names":[],"sources":["../src/types.ts"],"sourcesContent":["/**\n * Shared types, enums, and lifecycle maps for `@happyvertical/smrt-support`.\n *\n * Domain language follows the HappyVertical support glossary: a **Support\n * Case** is the canonical record of a client support request; **Support\n * Interactions** are channel transports attached to it; **Service Targets**\n * are operational clocks (not contractual SLAs); a **Managed Support Plan**\n * carries the client-facing terms while a **Support Compensation Plan**\n * carries the provider-facing terms — the two are never merged.\n */\n\n/** Support Case lifecycle states (FR-29b). */\nexport type SupportCaseStatus =\n | 'new'\n | 'triaged'\n | 'assigned'\n | 'in_progress'\n | 'waiting_on_client'\n | 'escalated'\n | 'resolved'\n | 'closed';\n\n/**\n * Legal Support Case status transitions, enforced at save time by\n * {@link SupportCase} (S5 guarded-lifecycle idiom — raw mass-assignment on a\n * generated route cannot skip states). Reopening (`resolved`/`closed` back to\n * an active state) is legal here; the reopen bookkeeping (count, history\n * event) is layered by `SupportCaseService.reopen()`.\n */\nexport const SUPPORT_CASE_STATUS_TRANSITIONS: Record<\n SupportCaseStatus,\n SupportCaseStatus[]\n> = {\n new: [\n 'triaged',\n 'assigned',\n 'in_progress',\n 'waiting_on_client',\n 'escalated',\n 'resolved',\n 'closed',\n ],\n triaged: [\n 'assigned',\n 'in_progress',\n 'waiting_on_client',\n 'escalated',\n 'resolved',\n 'closed',\n ],\n assigned: [\n 'triaged',\n 'in_progress',\n 'waiting_on_client',\n 'escalated',\n 'resolved',\n 'closed',\n ],\n in_progress: [\n 'assigned',\n 'waiting_on_client',\n 'escalated',\n 'resolved',\n 'closed',\n ],\n waiting_on_client: [\n 'assigned',\n 'in_progress',\n 'escalated',\n 'resolved',\n 'closed',\n ],\n escalated: [\n 'assigned',\n 'in_progress',\n 'waiting_on_client',\n 'resolved',\n 'closed',\n ],\n resolved: ['closed', 'in_progress', 'triaged'],\n closed: ['triaged', 'in_progress'],\n};\n\n/** Case statuses considered \"open\" for create-or-join intake dedup. */\nexport const OPEN_SUPPORT_CASE_STATUSES: SupportCaseStatus[] = [\n 'new',\n 'triaged',\n 'assigned',\n 'in_progress',\n 'waiting_on_client',\n 'escalated',\n];\n\n/** Client-facing priority (ordering/urgency inside a queue). */\nexport type SupportCasePriority = 'low' | 'normal' | 'high' | 'urgent';\n\n/** Transport kind a Support Interaction arrived through. */\nexport type SupportChannelKind =\n | 'chat'\n | 'email'\n | 'phone'\n | 'voice'\n | 'web'\n | 'api';\n\n/** Direction of a Support Interaction relative to the Client. */\nexport type SupportInteractionDirection = 'inbound' | 'outbound' | 'internal';\n\n/** Who performed an interaction or case event. */\nexport type SupportActorKind = 'client' | 'specialist' | 'agent' | 'system';\n\n/** Append-only case audit event types. */\nexport type SupportCaseEventType =\n | 'created'\n | 'interaction'\n | 'transition'\n | 'assignment'\n | 'ai_run'\n | 'handoff'\n | 'human_requested'\n | 'escalation'\n | 'target_scheduled'\n | 'target_satisfied'\n | 'target_breached'\n | 'target_paused'\n | 'target_resumed'\n | 'work_linked'\n | 'reopened'\n | 'plan_applied'\n | 'time_recorded'\n | 'note';\n\n/** What kind of transport container a channel binding points at. */\nexport type SupportBindingKind = 'chat_room' | 'email_account';\n\n/** Operational Work Item link kinds carried by a {@link SupportWorkLink}. */\nexport type SupportWorkLinkKind = 'support_work_item' | 'development_work_item';\n\n/** Service Target clock types (FR-30/FR-31). */\nexport type ServiceTargetType =\n | 'acknowledgement'\n | 'response'\n | 'update'\n | 'resolution';\n\n/** Service Target clock states. */\nexport type ServiceTargetStatus =\n | 'pending'\n | 'paused'\n | 'satisfied'\n | 'breached'\n | 'cancelled';\n\n/** Why a case was escalated. */\nexport type SupportEscalationReason =\n | 'target_breach'\n | 'target_risk'\n | 'manual'\n | 'ai_trigger';\n\n/** AI support workflow phases (FR-28a). */\nexport type SupportAiRunPhase =\n | 'acknowledge'\n | 'classify'\n | 'answer'\n | 'troubleshoot'\n | 'resolve';\n\n/** Terminal outcome of one AI workflow phase run. */\nexport type SupportAiRunOutcome =\n | 'completed'\n | 'skipped'\n | 'failed'\n | 'handed_off';\n\n/** What triggered a Human Handoff (FR-28b). */\nexport type HumanHandoffTrigger =\n | 'client_request'\n | 'low_confidence'\n | 'high_severity'\n | 'sensitive'\n | 'failed_resolution'\n | 'target_risk'\n | 'policy'\n | 'manual';\n\n/** Service Time Entry lifecycle (FR-36). */\nexport type ServiceTimeEntryStatus =\n | 'draft'\n | 'submitted'\n | 'approved'\n | 'rejected'\n | 'corrected';\n\n/**\n * Legal Service Time Entry status transitions. `approved → corrected` is the\n * only exit from `approved` and is reachable exclusively through the explicit\n * correction path (the approved snapshot itself stays frozen).\n */\nexport const SERVICE_TIME_ENTRY_STATUS_TRANSITIONS: Record<\n ServiceTimeEntryStatus,\n ServiceTimeEntryStatus[]\n> = {\n draft: ['submitted', 'rejected'],\n submitted: ['approved', 'rejected', 'draft'],\n approved: ['corrected'],\n rejected: ['draft', 'submitted'],\n corrected: [],\n};\n\n/** How a Service Time Entry was produced (FR-40). */\nexport type ServiceTimeEntrySource = 'timer' | 'manual' | 'import' | 'agent';\n\n/** Who/what delivered the work behind a Service Time Entry. */\nexport type SupportParticipantKind = 'human' | 'agent';\n\n/** Which approval path accepted a Service Time Entry (FR-36). */\nexport type TimeEntryApprovalPath =\n | 'automatic'\n | 'operator'\n | 'client'\n | 'threshold';\n\n/** Derived commercial snapshot lifecycle (charges and compensation). */\nexport type SupportSettlementStatus =\n | 'pending'\n | 'final'\n | 'corrected'\n | 'voided';\n\n/** Support Specialist availability window kinds. */\nexport type SupportAvailabilityKind = 'weekly' | 'on_call' | 'time_off';\n\n/** Support Specialist activation state. */\nexport type SupportSpecialistStatus = 'active' | 'inactive';\n\n/** Project Support Qualification levels. */\nexport type SupportQualificationLevel = 'trainee' | 'qualified' | 'expert';\n\n/** A weekly coverage window in a plan's coverage calendar. */\nexport interface CoverageWindow {\n /** 0 = Sunday … 6 = Saturday (JS `Date#getDay` convention). */\n weekday: number;\n /** Minutes from midnight, inclusive start. */\n startMinute: number;\n /** Minutes from midnight, exclusive end. */\n endMinute: number;\n}\n\n/** Per-severity Service Target minutes; `null` disables that clock. */\nexport interface ServiceTargetMinutes {\n acknowledgementMinutes: number | null;\n responseMinutes: number | null;\n updateMinutes: number | null;\n resolutionMinutes: number | null;\n}\n\n/** One step of a plan's escalation policy, applied in `level` order. */\nexport interface EscalationStep {\n level: number;\n action: 'notify' | 'reassign';\n /** Profile ids to notify (recorded on the escalation; delivery is app-side). */\n notifyProfileIds?: string[];\n /** Minutes after the previous step before this one fires (0 = immediately). */\n delayMinutes?: number;\n}\n\n/** A severity definition entry in a plan (key → labels). */\nexport interface SeverityDefinition {\n label: string;\n description?: string;\n}\n\n/**\n * Default severity vocabulary used when a plan doesn't define its own.\n * `sev1` is the most severe.\n */\nexport const DEFAULT_SEVERITY_DEFINITIONS: Record<string, SeverityDefinition> =\n {\n sev1: { label: 'Critical', description: 'Service down or unusable' },\n sev2: { label: 'Major', description: 'Significant degradation' },\n sev3: { label: 'Minor', description: 'Limited impact' },\n sev4: { label: 'Question', description: 'Question or request' },\n };\n\n/** Time-entry approval policy carried by a Managed Support Plan (FR-36). */\nexport interface TimeApprovalPolicy {\n /** Base path when no threshold applies. */\n mode: 'automatic' | 'operator' | 'client';\n /** Entries longer than this require review even under `automatic`. */\n thresholdMinutes?: number;\n /**\n * Entries pricing above this amount require review even under `automatic`.\n * Integer minor units, matching `SupportCharge.amount` it is compared\n * against — `$19.99` is `1999` (#2401).\n */\n thresholdAmount?: number;\n}\n\n/** One piece of work evidence attached to a Service Time Entry. */\nexport interface TimeEntryEvidence {\n kind: string;\n ref: string;\n label?: string;\n}\n\n/**\n * Parse a JSON value stored as text, returning the fallback on malformed\n * input (never throws — stored JSON may predate schema changes). Accepts an\n * already-parsed value (e.g. a `type: 'json'` column that hydrated as an\n * object) and hands it back unchanged.\n */\nexport function parseJsonField<T>(raw: unknown, fallback: T): T {\n if (!raw) {\n return fallback;\n }\n // Text columns hydrate as strings; a non-string here means the caller\n // already holds a parsed value — hand it back rather than throwing.\n if (typeof raw !== 'string') {\n return raw as T;\n }\n try {\n const parsed = JSON.parse(raw);\n return (parsed ?? fallback) as T;\n } catch {\n return fallback;\n }\n}\n\n/** Parse a JSON array-of-strings field, tolerating malformed input. */\nexport function parseStringArrayField(\n raw: string | null | undefined,\n): string[] {\n const parsed = parseJsonField<unknown>(raw, []);\n return Array.isArray(parsed)\n ? parsed.filter((value): value is string => typeof value === 'string')\n : [];\n}\n"],"mappings":";AA6BO,IAAM,kCAGT;CACF,KAAK;EACH;EACA;EACA;EACA;EACA;EACA;EACA;CACF;CACA,SAAS;EACP;EACA;EACA;EACA;EACA;EACA;CACF;CACA,UAAU;EACR;EACA;EACA;EACA;EACA;EACA;CACF;CACA,aAAa;EACX;EACA;EACA;EACA;EACA;CACF;CACA,mBAAmB;EACjB;EACA;EACA;EACA;EACA;CACF;CACA,WAAW;EACT;EACA;EACA;EACA;EACA;CACF;CACA,UAAU;EAAC;EAAU;EAAe;CAAS;CAC7C,QAAQ,CAAC,WAAW,aAAa;AACnC;AAGO,IAAM,6BAAkD;CAC7D;CACA;CACA;CACA;CACA;CACA;AACF;AA4GO,IAAM,wCAGT;CACF,OAAO,CAAC,aAAa,UAAU;CAC/B,WAAW;EAAC;EAAY;EAAY;CAAO;CAC3C,UAAU,CAAC,WAAW;CACtB,UAAU,CAAC,SAAS,WAAW;CAC/B,WAAW,CAAC;AACd;AAqEO,IAAM,+BACX;CACE,MAAM;EAAE,OAAO;EAAY,aAAa;CAA2B;CACnE,MAAM;EAAE,OAAO;EAAS,aAAa;CAA0B;CAC/D,MAAM;EAAE,OAAO;EAAS,aAAa;CAAiB;CACtD,MAAM;EAAE,OAAO;EAAY,aAAa;CAAsB;AAChE;AA6BK,SAAS,eAAkB,KAAc,UAAgB;CAC9D,IAAI,CAAC,KACH,OAAO;CAIT,IAAI,OAAO,QAAQ,UACjB,OAAO;CAET,IAAI;EAEF,OADe,KAAK,MAAM,GAClB,KAAU;CACpB,QAAQ;EACN,OAAO;CACT;AACF;AAGO,SAAS,sBACd,KACU;CACV,MAAM,SAAS,eAAwB,KAAK,CAAC,CAAC;CAC9C,OAAO,MAAM,QAAQ,MAAM,IACvB,OAAO,QAAQ,UAA2B,OAAO,UAAU,QAAQ,IACnE,CAAC;AACP"}
1
+ {"version":3,"file":"types.js","names":[],"sources":["../src/types.ts"],"sourcesContent":["/**\n * Shared types, enums, and lifecycle maps for `@happyvertical/smrt-support`.\n *\n * Domain language follows the HappyVertical support glossary: a **Support\n * Case** is the canonical record of a client support request; **Support\n * Interactions** are channel transports attached to it; **Service Targets**\n * are operational clocks (not contractual SLAs); a **Managed Support Plan**\n * carries the client-facing terms while a **Support Compensation Plan**\n * carries the provider-facing terms — the two are never merged.\n */\n\n/** Support Case lifecycle states (FR-29b). */\nexport type SupportCaseStatus =\n | 'new'\n | 'triaged'\n | 'assigned'\n | 'in_progress'\n | 'waiting_on_client'\n | 'escalated'\n | 'resolved'\n | 'closed';\n\n/**\n * Legal Support Case status transitions, enforced at save time by\n * {@link SupportCase} (S5 guarded-lifecycle idiom — raw mass-assignment on a\n * generated route cannot skip states). Reopening (`resolved`/`closed` back to\n * an active state) is legal here; the reopen bookkeeping (count, history\n * event) is layered by `SupportCaseService.reopen()`.\n */\nexport const SUPPORT_CASE_STATUS_TRANSITIONS: Record<\n SupportCaseStatus,\n SupportCaseStatus[]\n> = {\n new: [\n 'triaged',\n 'assigned',\n 'in_progress',\n 'waiting_on_client',\n 'escalated',\n 'resolved',\n 'closed',\n ],\n triaged: [\n 'assigned',\n 'in_progress',\n 'waiting_on_client',\n 'escalated',\n 'resolved',\n 'closed',\n ],\n assigned: [\n 'triaged',\n 'in_progress',\n 'waiting_on_client',\n 'escalated',\n 'resolved',\n 'closed',\n ],\n in_progress: [\n 'assigned',\n 'waiting_on_client',\n 'escalated',\n 'resolved',\n 'closed',\n ],\n waiting_on_client: [\n 'assigned',\n 'in_progress',\n 'escalated',\n 'resolved',\n 'closed',\n ],\n escalated: [\n 'assigned',\n 'in_progress',\n 'waiting_on_client',\n 'resolved',\n 'closed',\n ],\n resolved: ['closed', 'in_progress', 'triaged'],\n closed: ['triaged', 'in_progress'],\n};\n\n/** Case statuses considered \"open\" for create-or-join intake dedup. */\nexport const OPEN_SUPPORT_CASE_STATUSES: SupportCaseStatus[] = [\n 'new',\n 'triaged',\n 'assigned',\n 'in_progress',\n 'waiting_on_client',\n 'escalated',\n];\n\n/** Client-facing priority (ordering/urgency inside a queue). */\nexport type SupportCasePriority = 'low' | 'normal' | 'high' | 'urgent';\n\n/** Transport kind a Support Interaction arrived through. */\nexport type SupportChannelKind =\n | 'chat'\n | 'email'\n | 'phone'\n | 'voice'\n | 'web'\n | 'api';\n\n/** Direction of a Support Interaction relative to the Client. */\nexport type SupportInteractionDirection = 'inbound' | 'outbound' | 'internal';\n\n/** Who performed an interaction or case event. */\nexport type SupportActorKind = 'client' | 'specialist' | 'agent' | 'system';\n\n/** Append-only case audit event types. */\nexport type SupportCaseEventType =\n | 'created'\n | 'interaction'\n | 'transition'\n | 'assignment'\n | 'ai_run'\n | 'handoff'\n | 'human_requested'\n | 'escalation'\n | 'target_scheduled'\n | 'target_satisfied'\n | 'target_breached'\n | 'target_paused'\n | 'target_resumed'\n | 'work_linked'\n | 'reopened'\n | 'plan_applied'\n | 'time_recorded'\n | 'note';\n\n/** What kind of transport container a channel binding points at. */\nexport type SupportBindingKind = 'chat_room' | 'email_account';\n\n/** Operational Work Item link kinds carried by a {@link SupportWorkLink}. */\nexport type SupportWorkLinkKind = 'support_work_item' | 'development_work_item';\n\n/** Service Target clock types (FR-30/FR-31). */\nexport type ServiceTargetType =\n | 'acknowledgement'\n | 'response'\n | 'update'\n | 'resolution';\n\n/** Service Target clock states. */\nexport type ServiceTargetStatus =\n | 'pending'\n | 'paused'\n | 'satisfied'\n | 'breached'\n | 'cancelled';\n\n/** Why a case was escalated. */\nexport type SupportEscalationReason =\n | 'target_breach'\n | 'target_risk'\n | 'manual'\n | 'ai_trigger';\n\n/** AI support workflow phases (FR-28a). */\nexport type SupportAiRunPhase =\n | 'acknowledge'\n | 'classify'\n | 'answer'\n | 'troubleshoot'\n | 'resolve';\n\n/** Terminal outcome of one AI workflow phase run. */\nexport type SupportAiRunOutcome =\n | 'completed'\n | 'skipped'\n | 'failed'\n | 'handed_off';\n\n/** What triggered a Human Handoff (FR-28b). */\nexport type HumanHandoffTrigger =\n | 'client_request'\n | 'low_confidence'\n | 'ambiguous_classification'\n | 'high_severity'\n | 'sensitive'\n | 'failed_resolution'\n | 'target_risk'\n | 'policy'\n | 'manual';\n\n/** Service Time Entry lifecycle (FR-36). */\nexport type ServiceTimeEntryStatus =\n | 'draft'\n | 'submitted'\n | 'approved'\n | 'rejected'\n | 'corrected';\n\n/**\n * Legal Service Time Entry status transitions. `approved → corrected` is the\n * only exit from `approved` and is reachable exclusively through the explicit\n * correction path (the approved snapshot itself stays frozen).\n */\nexport const SERVICE_TIME_ENTRY_STATUS_TRANSITIONS: Record<\n ServiceTimeEntryStatus,\n ServiceTimeEntryStatus[]\n> = {\n draft: ['submitted', 'rejected'],\n submitted: ['approved', 'rejected', 'draft'],\n approved: ['corrected'],\n rejected: ['draft', 'submitted'],\n corrected: [],\n};\n\n/** How a Service Time Entry was produced (FR-40). */\nexport type ServiceTimeEntrySource = 'timer' | 'manual' | 'import' | 'agent';\n\n/** Who/what delivered the work behind a Service Time Entry. */\nexport type SupportParticipantKind = 'human' | 'agent';\n\n/** Which approval path accepted a Service Time Entry (FR-36). */\nexport type TimeEntryApprovalPath =\n | 'automatic'\n | 'operator'\n | 'client'\n | 'threshold';\n\n/** Derived commercial snapshot lifecycle (charges and compensation). */\nexport type SupportSettlementStatus =\n | 'pending'\n | 'final'\n | 'corrected'\n | 'voided';\n\n/** Support Specialist availability window kinds. */\nexport type SupportAvailabilityKind = 'weekly' | 'on_call' | 'time_off';\n\n/** Support Specialist activation state. */\nexport type SupportSpecialistStatus = 'active' | 'inactive';\n\n/** Project Support Qualification levels. */\nexport type SupportQualificationLevel = 'trainee' | 'qualified' | 'expert';\n\n/** A weekly coverage window in a plan's coverage calendar. */\nexport interface CoverageWindow {\n /** 0 = Sunday … 6 = Saturday (JS `Date#getDay` convention). */\n weekday: number;\n /** Minutes from midnight, inclusive start. */\n startMinute: number;\n /** Minutes from midnight, exclusive end. */\n endMinute: number;\n}\n\n/** Per-severity Service Target minutes; `null` disables that clock. */\nexport interface ServiceTargetMinutes {\n acknowledgementMinutes: number | null;\n responseMinutes: number | null;\n updateMinutes: number | null;\n resolutionMinutes: number | null;\n}\n\n/** One step of a plan's escalation policy, applied in `level` order. */\nexport interface EscalationStep {\n level: number;\n action: 'notify' | 'reassign';\n /** Profile ids to notify (recorded on the escalation; delivery is app-side). */\n notifyProfileIds?: string[];\n /** Minutes after the previous step before this one fires (0 = immediately). */\n delayMinutes?: number;\n}\n\n/** A severity definition entry in a plan (key → labels). */\nexport interface SeverityDefinition {\n label: string;\n description?: string;\n}\n\n/**\n * Default severity vocabulary used when a plan doesn't define its own.\n * `sev1` is the most severe.\n */\nexport const DEFAULT_SEVERITY_DEFINITIONS: Record<string, SeverityDefinition> =\n {\n sev1: { label: 'Critical', description: 'Service down or unusable' },\n sev2: { label: 'Major', description: 'Significant degradation' },\n sev3: { label: 'Minor', description: 'Limited impact' },\n sev4: { label: 'Question', description: 'Question or request' },\n };\n\n/** Time-entry approval policy carried by a Managed Support Plan (FR-36). */\nexport interface TimeApprovalPolicy {\n /** Base path when no threshold applies. */\n mode: 'automatic' | 'operator' | 'client';\n /** Entries longer than this require review even under `automatic`. */\n thresholdMinutes?: number;\n /**\n * Entries pricing above this amount require review even under `automatic`.\n * Integer minor units, matching `SupportCharge.amount` it is compared\n * against — `$19.99` is `1999` (#2401).\n */\n thresholdAmount?: number;\n}\n\n/** One piece of work evidence attached to a Service Time Entry. */\nexport interface TimeEntryEvidence {\n kind: string;\n ref: string;\n label?: string;\n}\n\n/**\n * Parse a JSON value stored as text, returning the fallback on malformed\n * input (never throws — stored JSON may predate schema changes). Accepts an\n * already-parsed value (e.g. a `type: 'json'` column that hydrated as an\n * object) and hands it back unchanged.\n */\nexport function parseJsonField<T>(raw: unknown, fallback: T): T {\n if (!raw) {\n return fallback;\n }\n // Text columns hydrate as strings; a non-string here means the caller\n // already holds a parsed value — hand it back rather than throwing.\n if (typeof raw !== 'string') {\n return raw as T;\n }\n try {\n const parsed = JSON.parse(raw);\n return (parsed ?? fallback) as T;\n } catch {\n return fallback;\n }\n}\n\n/** Parse a JSON array-of-strings field, tolerating malformed input. */\nexport function parseStringArrayField(\n raw: string | null | undefined,\n): string[] {\n const parsed = parseJsonField<unknown>(raw, []);\n return Array.isArray(parsed)\n ? parsed.filter((value): value is string => typeof value === 'string')\n : [];\n}\n"],"mappings":";AA6BO,IAAM,kCAGT;CACF,KAAK;EACH;EACA;EACA;EACA;EACA;EACA;EACA;CACF;CACA,SAAS;EACP;EACA;EACA;EACA;EACA;EACA;CACF;CACA,UAAU;EACR;EACA;EACA;EACA;EACA;EACA;CACF;CACA,aAAa;EACX;EACA;EACA;EACA;EACA;CACF;CACA,mBAAmB;EACjB;EACA;EACA;EACA;EACA;CACF;CACA,WAAW;EACT;EACA;EACA;EACA;EACA;CACF;CACA,UAAU;EAAC;EAAU;EAAe;CAAS;CAC7C,QAAQ,CAAC,WAAW,aAAa;AACnC;AAGO,IAAM,6BAAkD;CAC7D;CACA;CACA;CACA;CACA;CACA;AACF;AA6GO,IAAM,wCAGT;CACF,OAAO,CAAC,aAAa,UAAU;CAC/B,WAAW;EAAC;EAAY;EAAY;CAAO;CAC3C,UAAU,CAAC,WAAW;CACtB,UAAU,CAAC,SAAS,WAAW;CAC/B,WAAW,CAAC;AACd;AAqEO,IAAM,+BACX;CACE,MAAM;EAAE,OAAO;EAAY,aAAa;CAA2B;CACnE,MAAM;EAAE,OAAO;EAAS,aAAa;CAA0B;CAC/D,MAAM;EAAE,OAAO;EAAS,aAAa;CAAiB;CACtD,MAAM;EAAE,OAAO;EAAY,aAAa;CAAsB;AAChE;AA6BK,SAAS,eAAkB,KAAc,UAAgB;CAC9D,IAAI,CAAC,KACH,OAAO;CAIT,IAAI,OAAO,QAAQ,UACjB,OAAO;CAET,IAAI;EAEF,OADe,KAAK,MAAM,GAClB,KAAU;CACpB,QAAQ;EACN,OAAO;CACT;AACF;AAGO,SAAS,sBACd,KACU;CACV,MAAM,SAAS,eAAwB,KAAK,CAAC,CAAC;CAC9C,OAAO,MAAM,QAAQ,MAAM,IACvB,OAAO,QAAQ,UAA2B,OAAO,UAAU,QAAQ,IACnE,CAAC;AACP"}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@happyvertical/smrt-support",
3
- "version": "0.51.30",
3
+ "version": "0.51.32",
4
4
  "smrtJsdoc": "strict",
5
5
  "description": "AI-first Support Cases: channel-neutral intake, lifecycle, routing, service targets, and service time for the SMRT framework",
6
6
  "type": "module",
@@ -26,16 +26,16 @@
26
26
  "./manifest.json": "./dist/manifest.json"
27
27
  },
28
28
  "dependencies": {
29
- "@happyvertical/logger": "^0.94.0",
30
- "@happyvertical/smrt-chat": "0.51.30",
31
- "@happyvertical/smrt-core": "0.51.30",
32
- "@happyvertical/smrt-jobs": "0.51.30",
33
- "@happyvertical/smrt-messages": "0.51.30",
34
- "@happyvertical/smrt-projects": "0.51.30",
35
- "@happyvertical/smrt-tenancy": "0.51.30",
36
- "@happyvertical/smrt-ui": "0.51.30",
37
- "@happyvertical/smrt-users": "0.51.30",
38
- "@happyvertical/sql": "^0.94.0"
29
+ "@happyvertical/logger": "^0.94.1",
30
+ "@happyvertical/smrt-chat": "0.51.32",
31
+ "@happyvertical/smrt-core": "0.51.32",
32
+ "@happyvertical/smrt-jobs": "0.51.32",
33
+ "@happyvertical/smrt-messages": "0.51.32",
34
+ "@happyvertical/smrt-projects": "0.51.32",
35
+ "@happyvertical/smrt-tenancy": "0.51.32",
36
+ "@happyvertical/smrt-ui": "0.51.32",
37
+ "@happyvertical/smrt-users": "0.51.32",
38
+ "@happyvertical/sql": "^0.94.1"
39
39
  },
40
40
  "peerDependencies": {
41
41
  "svelte": "^5.57.1"
@@ -46,7 +46,7 @@
46
46
  }
47
47
  },
48
48
  "devDependencies": {
49
- "@happyvertical/smrt-vitest": "0.51.30",
49
+ "@happyvertical/smrt-vitest": "0.51.32",
50
50
  "@sveltejs/package": "^2.5.8",
51
51
  "@sveltejs/vite-plugin-svelte": "^7.3.0",
52
52
  "@types/node": "24.13.6",