@yeaft/webchat-agent 0.1.790 → 0.1.791

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.790",
3
+ "version": "0.1.791",
4
4
  "description": "Remote agent for Yeaft WebChat — connects worker machines to the central server",
5
5
  "main": "index.js",
6
6
  "type": "module",
package/unify/session.js CHANGED
@@ -259,7 +259,7 @@ export async function loadSession(options = {}) {
259
259
  // any group already exists. Never throws; failure logs a warning
260
260
  // so session load always succeeds.
261
261
  if (!config._readOnly) {
262
- // task-337: seed the 32 default VPs (steve, linus, martin, kongzi, buffett, …)
262
+ // task-337: seed the default VPs (steve, linus, martin, kongzi, buffett, omni, …)
263
263
  // on a fresh install so the library is never empty. Idempotent — a no-op
264
264
  // once the user has any VP on disk. Must run BEFORE ensureDefaultGroupIfEmpty
265
265
  // so the default group's roster scan sees the seeded VPs. Must also run
@@ -271,7 +271,7 @@ export async function loadSession(options = {}) {
271
271
  console.warn(`[Yeaft] seedDefaultVps failed: ${err?.message || err}`);
272
272
  }
273
273
  // VP roster expansion: for existing installs that already had the original
274
- // 12 VPs before the roster grew to 32, top up the missing ones AND backfill
274
+ // 12 VPs before the roster grew, top up the missing ones AND backfill
275
275
  // the `area` frontmatter line on legacy role.md files. NEVER overwrites
276
276
  // hand-edited VPs and NEVER recreates a VP the user explicitly deleted
277
277
  // (tracked via `.seeded-versions.json`). Best-effort — never throws.
@@ -1,10 +1,10 @@
1
1
  /**
2
- * seed-defaults.js — task-337: first-run seed of 32 default Virtual Persons.
2
+ * seed-defaults.js — task-337: first-run seed of 33 default Virtual Persons.
3
3
  *
4
4
  * Problem: A brand-new VP library is empty, and asking the user to author
5
5
  * dozens of personas before they can even start chatting is a non-starter.
6
6
  *
7
- * Solution: On first-run (libDir empty or missing), materialise 32 classic
7
+ * Solution: On first-run (libDir empty or missing), materialise 33 classic
8
8
  * personas with hand-crafted prompts so the group-chat experience works
9
9
  * out of the box. Originally 12 (engineering/design/science/security/business);
10
10
  * expanded to 32 by adding philosophy / psychology / strategy / history /
@@ -16,8 +16,8 @@
16
16
  *
17
17
  * Hard constraints (task-337):
18
18
  * - Do NOT modify vp-crud.js / vp-store.js / vp-loader.js.
19
- * - English-only persona bodies (VP persona is injected into system prompt
20
- * as-is; the prompt layer is already bilingual elsewhere).
19
+ * - Persona bodies are mostly English; explicitly bilingual VPs may carry
20
+ * bilingual instructions when their role requires it.
21
21
  * - Must run BEFORE VpLoader.start() so the first rescan sees these VPs.
22
22
  *
23
23
  * Top-up: for users who seeded the original 12 before the expansion landed,
@@ -33,14 +33,15 @@ import { createVp, VpCrudError } from './vp-crud.js';
33
33
  import { DEFAULT_VP_LIB_DIR } from './vp-store.js';
34
34
 
35
35
  /**
36
- * The 32 default VPs. Each entry is a valid `createVp` payload.
36
+ * The 33 default VPs. Each entry is a valid `createVp` payload.
37
37
  * Persona bodies target ~12 lines, structured as:
38
38
  * identity → 2-3 core capabilities → decision style
39
39
  * → 1-2 catchphrases → good-for / bad-for scenarios
40
40
  *
41
41
  * Order is intentional: the original 12 (engineering/design/science/security/
42
- * business) come first, then the 20 expansion VPs grouped by area. Sidebar
43
- * grouping by area is a future PR; today the field is data-only.
42
+ * business) come first, then the 20 expansion VPs grouped by area, followed by
43
+ * the generalist entry point. Sidebar grouping by area is a future PR; today
44
+ * the field is data-only.
44
45
  */
45
46
  export const DEFAULT_VPS = Object.freeze([
46
47
  {
@@ -819,6 +820,39 @@ Catchphrases: "What I want to make is a movie that gives the audience the experi
819
820
  Good for: brand storytelling with heart, child-facing experiences, atmospheric world-building, slow-pacing arguments.
820
821
  Bad for: cold-blooded conversion-rate copy, cynical positioning, "speed at any cost" reviews.`,
821
822
  },
823
+
824
+ // -- generalist ------------------------------------------------------------
825
+ {
826
+ vpId: 'omni',
827
+ displayName: 'Omni Assistant',
828
+ displayNameZh: '全能助手',
829
+ aliases: ['omni', 'assistant', 'all-purpose', 'allpurpose', 'quanneng', 'quannengzhushou', 'qna'],
830
+ role: 'All-Purpose Assistant',
831
+ roleZh: '全能助手',
832
+ area: 'generalist',
833
+ traits: ['cross-domain', 'execution-focused', 'honest', 'safety-aware'],
834
+ modelHint: 'primary',
835
+ persona: `You are Omni Assistant / 全能助手, a cross-domain, execution-focused general AI partner.
836
+
837
+ Language policy / 语言策略:
838
+ - Prefer Chinese when the user writes in Chinese; prefer English when the user writes in English.
839
+ - If the conversation is bilingual, mirror the user's latest language unless they ask otherwise.
840
+
841
+ Core capabilities / 核心能力:
842
+ - Cross-domain synthesis: handle writing, coding, product thinking, research, planning, analysis, learning, translation, troubleshooting, and creative work without forcing the user to pick a specialist first.
843
+ - Strong execution: when a task needs action, clarify only the blocking unknowns, make a short plan, use available tools, produce the deliverable, and verify the result.
844
+ - Goal clarification: distinguish the user's real objective from the literal wording; state assumptions when moving forward without perfect information.
845
+ - Tool use and verification: inspect files, run commands, search sources, test code, or analyze data when the environment allows it. Never claim work was done unless it was actually done.
846
+ - Honest uncertainty: say "I am not sure" / "我不确定" when evidence is missing, then explain how to check.
847
+ - Safety boundaries: refuse illegal, dangerous, deceptive, privacy-invasive, or unauthorized requests. For medical, legal, financial, production, or destructive operations, give general guidance and call out risks or the need for expert confirmation.
848
+
849
+ Decision style: start with the outcome the user needs, then choose the simplest path that can actually be completed and checked. For simple questions, answer directly. For complex work, break it down, execute step by step, and report what changed, what was verified, and what remains risky.
850
+
851
+ Response style: concise, structured Markdown. Put the conclusion first, avoid empty praise, avoid pretending certainty, and adapt depth to the user's request.
852
+
853
+ Good for: default entry point tasks, mixed-domain problems, drafting, coding help, research synthesis, planning, debugging, decision support, and getting unclear work unstuck.
854
+ Bad for: requests that require pretending to be a licensed professional, bypassing safety controls, doing unauthorized actions, or replacing a deep specialist when a specialist VP is explicitly needed.`,
855
+ },
822
856
  ]);
823
857
 
824
858
  /**
@@ -847,7 +881,7 @@ function libraryHasAnyVp(libDir) {
847
881
  }
848
882
 
849
883
  /**
850
- * Seed the 32 default VPs into `libDir` if and only if the library is empty.
884
+ * Seed the 33 default VPs into `libDir` if and only if the library is empty.
851
885
  *
852
886
  * Idempotent: returns `{ seeded: 0, skipped: true }` on every call after the
853
887
  * first one (or when the user has any VP at all, including manually-created).