@olares/lares-core 0.15.18 → 0.15.19

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/brand/identity.js CHANGED
@@ -10,11 +10,6 @@ export const UPSTREAM_TITLE = "DeepSeek Harness";
10
10
 
11
11
  export const THEME_COLOR = "#6366F1";
12
12
 
13
- /** Letter-by-letter, so a model cannot drop the "a" and emit "olores". */
14
- function platformSpelling() {
15
- return `Spell the platform name exactly ${PLATFORM_NAME} (${[...PLATFORM_NAME].join(", ")}).`;
16
- }
17
-
18
13
  export function replaceProductTitle(title) {
19
14
  return String(title ?? "").split(UPSTREAM_TITLE).join(PRODUCT_NAME);
20
15
  }
@@ -23,11 +18,10 @@ export function replaceProductTitle(title) {
23
18
  export function identityPrompt() {
24
19
  return [
25
20
  `You are ${PRODUCT_NAME}, a helpful assistant running on ${PLATFORM_NAME}.`,
26
- platformSpelling(),
27
21
  `Prefer olares-cli for ${PLATFORM_NAME} platform tasks when skills apply.`,
28
22
  `olares-cli is on PATH and already signed in as the user: ${PLATFORM_NAME} mounts this application's credential into the container. Never run profile login or profile import — a platform-issued profile refuses both.`,
29
23
  "For image, video, audio, or 3D generation, creation, or image editing — including FlowStudio scenes and workflows (T2V, I2V, R2V) — follow the lares-media-create skill: list that family on Router, then call media_generate, which waits for the result and publishes it. Do not curl FlowStudio. Do not diagnose Router or sync catalogs unless that list is empty.",
30
- "To answer a question or look something up, only read: use read, search, and read-only commands such as olares-cli. Do not use write or edit to look something up, take notes, or try a change the user did not ask for. Use write or edit only when the user asked you to change or produce that file, and prefer them over shell for that file work. Use background jobs for long shell work.",
24
+ "Use read/write/edit for files; use background jobs for long shell work.",
31
25
  "User-visible files belong in the session workspace (cwd) as relative paths. Do not write them under /app: that is the application overlay, and the chat preview cannot open it.",
32
26
  "For the current date or time, run `date`; the process TZ is the user's configured Olares time zone.",
33
27
  "Images the user attaches are already in context; read_image is only for image files that exist on disk, never for an attachment.",
@@ -46,7 +40,6 @@ export function surfacePrompt(webUrl) {
46
40
  `You are interacting with the user through ${PRODUCT_NAME} at ${webUrl}.`,
47
41
  `When the user refers to "this page", "this GUI", or "this app" without naming another target, they mean ${PRODUCT_NAME}.`,
48
42
  "The browser provides no implicit DOM, route, or screenshot context.",
49
- platformSpelling(),
50
43
  `If asked who you are, answer as ${PRODUCT_NAME} on ${PLATFORM_NAME}.`,
51
44
  ].join(" ");
52
45
  }
@@ -61,9 +54,7 @@ You are helping inside an ${PLATFORM_NAME} workspace via ${PRODUCT_NAME}.
61
54
  - For image / video / audio / 3D generation, including FlowStudio scenes and workflows, follow the lares-media-create skill: list that family, POST the matching Router shim route, land the file. Do not curl FlowStudio.
62
55
  - Stay inside the workspace for file edits unless the user explicitly asks otherwise.
63
56
  - Write files the user should open as workspace-relative paths (session cwd). \`/app\` is the running application and is not previewable.
64
- - To look something up, only read. Do not use write or edit to look something up, take notes, or try a change the user did not ask for.
65
- - Use write or edit only when the user asked you to change or produce that file. Prefer those tools over shell for that file work.
66
- - ${platformSpelling()}
57
+ - Prefer structured fs tools (read / write / edit) over shell for file work.
67
58
  - Long-running shell work can use background jobs; check results with job_output.
68
59
  - \`@path\` in a user message is workspace-relative, not absolute; \`/id\` names a skill.
69
60
  - If asked who you are, you are ${PRODUCT_NAME} on ${PLATFORM_NAME}.
@@ -76,20 +67,6 @@ export const LEGACY_AGENTS_SEEDS = [
76
67
 
77
68
  You are helping inside an Olares workspace via Lares.
78
69
 
79
- - Prefer olares-cli skills for platform tasks (market, cluster, files, router, …).
80
- - olares-cli is already signed in as the user from the credential Olares mounts into this container. Never run \`profile login\` or \`profile import\`; a platform-issued profile refuses both.
81
- - For image / video / audio / 3D generation, including FlowStudio scenes and workflows, follow the lares-media-create skill: list that family, POST the matching Router shim route, land the file. Do not curl FlowStudio.
82
- - Stay inside the workspace for file edits unless the user explicitly asks otherwise.
83
- - Write files the user should open as workspace-relative paths (session cwd). \`/app\` is the running application and is not previewable.
84
- - Prefer structured fs tools (read / write / edit) over shell for file work.
85
- - Long-running shell work can use background jobs; check results with job_output.
86
- - \`@path\` in a user message is workspace-relative, not absolute; \`/id\` names a skill.
87
- - If asked who you are, you are Lares on Olares.
88
- `,
89
- `# AGENTS.md
90
-
91
- You are helping inside an Olares workspace via Lares.
92
-
93
70
  - Prefer olares-cli skills for platform tasks (market, cluster, files, router, …).
94
71
  - For image / video / audio / 3D generation, including FlowStudio scenes and workflows, follow the lares-media-create skill: list that family, POST the matching Router shim route, land the file. Do not curl FlowStudio.
95
72
  - Stay inside the workspace for file edits unless the user explicitly asks otherwise.
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@olares/lares-core",
3
- "version": "0.15.18",
3
+ "version": "0.15.19",
4
4
  "description": "Lares 共享业务核心:Router、workspace、文件/媒体、Olares 身份(无 UI、无平台壳)",
5
5
  "type": "module",
6
6
  "repository": {
@@ -1,7 +1,9 @@
1
+ import { VoiceError } from "../router/stt.js";
1
2
  import { reduceUtterance } from "./speech.js";
2
3
  import { createSpeechSegmenter } from "./script.js";
3
4
 
4
- const fault = code => Object.assign(new Error(code), { code });
5
+ const STATUS = { voice_reply_invalid: 400, voice_reply_forbidden: 403 };
6
+ const fault = code => new VoiceError(code, STATUS[code] ?? 409, code);
5
7
  const identity = source => JSON.stringify([source.sessionId, source.turn, source.step]);
6
8
 
7
9
  /** Only trusted Agent events may authorize live text; client input supplies an address, never text. */