@yeaft/webchat-agent 0.1.648 → 0.1.649

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/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@yeaft/webchat-agent",
3
- "version": "0.1.648",
3
+ "version": "0.1.649",
4
4
  "description": "Remote agent for Yeaft WebChat — connects worker machines to the central server",
5
5
  "main": "index.js",
6
6
  "type": "module",
@@ -17,8 +17,34 @@ const FILES = {
17
17
  triagePass2: 'triage-pass2.md',
18
18
  update: 'update.md',
19
19
  create: 'create.md',
20
+ // H2.e — per-scope segment extraction prompts (one per scope family)
21
+ extractUser: 'extract-user.md',
22
+ extractVp: 'extract-vp.md',
23
+ extractGroup: 'extract-group.md',
24
+ extractFeature: 'extract-feature.md',
25
+ extractTopic: 'extract-topic.md',
26
+ // H2.e — per-scope summary compression
27
+ summarizeScope: 'summarize-scope.md',
20
28
  };
21
29
 
30
+ /**
31
+ * Map a scope string (e.g. "user", "vp/alice", "topic/auth/jwt") to the
32
+ * extraction template name. Unknown scopes fall back to `extractTopic`
33
+ * (the most generic template) so we never throw at extraction time.
34
+ *
35
+ * @param {string} scope
36
+ * @returns {keyof typeof FILES}
37
+ */
38
+ export function extractTemplateForScope(scope) {
39
+ if (!scope || typeof scope !== 'string') return 'extractTopic';
40
+ if (scope === 'user') return 'extractUser';
41
+ if (scope.startsWith('vp/')) return 'extractVp';
42
+ if (scope.startsWith('group/')) return 'extractGroup';
43
+ if (scope.startsWith('feature/')) return 'extractFeature';
44
+ if (scope.startsWith('topic/')) return 'extractTopic';
45
+ return 'extractTopic';
46
+ }
47
+
22
48
  /** @type {Record<string, string>} */
23
49
  const cache = {};
24
50