advisers 0.1.0-preview.2 → 0.1.0-preview.3

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/README-zh.md CHANGED
@@ -5,9 +5,11 @@
5
5
  ## 安装
6
6
 
7
7
  ```sh
8
- npm i -g advisers@next
8
+ npm i -g advisers@next advisers-office@next
9
9
  advisers soul init
10
+ advisers brief "做一份 Q4 预算 Excel,周五前给老板"
10
11
  advisers chat "周五前把报价发给王工"
12
+ advisers office xlsx spec.json out.xlsx
11
13
  advisers ls
12
14
  advisers export
13
15
  ```
@@ -16,11 +18,13 @@ CLI 目前是**context 预览**,不是聊天 UI:它记录消息、生成 Foc
16
18
 
17
19
  ## 状态
18
20
 
19
- `0.1.0-preview.1` 是预览版:
21
+ `0.1.0-preview.2` 是预览版:
20
22
 
21
23
  - 内存/JSON 账本,位于 `~/.advisers/state.json`;
22
24
  - soul 位于 `~/.advisers/soul.md`,人类独占;
23
- - 命令:`soul`、`chat`、`ls`、`why`、`forget`、`export`;
25
+ - 命令:`soul`、`brief`、`chat`、`office`、`ls`、`why`、`forget`、`export`;
26
+ - IntentBrief + 澄清策略 + readback;
27
+ - `advisers-office` 提供 DOCX/XLSX/PPTX/Mermaid/draw.io builder;
24
28
  - 不调模型、不用 SQLite、不接真实 IM、不含 DSH bundle。
25
29
 
26
30
  核心与架构:
package/README.md CHANGED
@@ -7,9 +7,11 @@ routines.
7
7
  ## Install
8
8
 
9
9
  ```sh
10
- npm i -g advisers@next
10
+ npm i -g advisers@next advisers-office@next
11
11
  advisers soul init
12
+ advisers brief "做一份 Q4 预算 Excel,周五前给老板"
12
13
  advisers chat "周五前把报价发给王工"
14
+ advisers office xlsx spec.json out.xlsx
13
15
  advisers ls
14
16
  advisers export
15
17
  ```
@@ -20,11 +22,13 @@ next milestone.
20
22
 
21
23
  ## Status
22
24
 
23
- `0.1.0-preview.1` is a preview:
25
+ `0.1.0-preview.2` is a preview:
24
26
 
25
27
  - in-memory/JSON ledger at `~/.advisers/state.json`;
26
28
  - soul at `~/.advisers/soul.md`, human-owned;
27
- - `soul`, `chat`, `ls`, `why`, `forget`, `export` commands;
29
+ - `soul`, `brief`, `chat`, `office`, `ls`, `why`, `forget`, `export` commands;
30
+ - IntentBrief + clarification policy + readback;
31
+ - DOCX/XLSX/PPTX/Mermaid/draw.io builders in `advisers-office`;
28
32
  - no LLM call, no SQLite, no real IM Link, no DSH bundle.
29
33
 
30
34
  Shared core and architecture:
package/bin/advisers.js CHANGED
@@ -78,7 +78,13 @@ Usage:
78
78
  advisers export export the ledger as JSON
79
79
  advisers brief <text> print the IntentBrief for a request
80
80
  advisers office <kind> <spec.json> <out>
81
- build docx/xlsx/pptx/mermaid/drawio
81
+ build docx/xlsx/pptx/xmind/mermaid/drawio
82
+ advisers routine ls list routines
83
+ advisers routine add <spec.json>
84
+ add a draft routine
85
+ advisers routine approve <id>
86
+ activate a routine (human action)
87
+ advisers routine archive <id>
82
88
  advisers soul show print soul.md
83
89
  advisers soul set <file> set soul.md from a file (human action)
84
90
  advisers soul init write a minimal starter soul.md
@@ -173,10 +179,58 @@ function brief(text) {
173
179
  console.log('\n' + core.renderReadback(brief))
174
180
  }
175
181
 
182
+ function routine(sub, arg) {
183
+ const ledger = loadLedger()
184
+ if (sub === 'ls' || !sub) {
185
+ const rows = ledger.listRoutines()
186
+ if (!rows.length) {
187
+ console.log('no routines yet')
188
+ return
189
+ }
190
+ for (const r of rows) console.log(`${r.id}\t${r.status}\tv${r.version}\t${r.name}`)
191
+ return
192
+ }
193
+ if (sub === 'add') {
194
+ if (!arg) {
195
+ console.error('usage: advisers routine add <spec.json>')
196
+ process.exitCode = 1
197
+ return
198
+ }
199
+ const spec = JSON.parse(readFileSync(arg, 'utf8'))
200
+ const routine = ledger.addRoutine({
201
+ name: spec.name,
202
+ description: spec.description ?? '',
203
+ trigger: spec.trigger ?? [],
204
+ steps: spec.steps ?? [],
205
+ preferences: spec.preferences ?? [],
206
+ pitfalls: spec.pitfalls ?? [],
207
+ verification: spec.verification ?? [],
208
+ scope: spec.scope,
209
+ createdBy: spec.createdBy ?? 'user',
210
+ })
211
+ saveLedger(ledger)
212
+ console.log(`draft routine ${routine.id}: ${routine.name}; approve with \`advisers routine approve ${routine.id}\``)
213
+ return
214
+ }
215
+ if (sub === 'approve' || sub === 'archive') {
216
+ if (!arg) {
217
+ console.error(`usage: advisers routine ${sub} <id>`)
218
+ process.exitCode = 1
219
+ return
220
+ }
221
+ const routine = sub === 'approve' ? ledger.approveRoutine(arg) : ledger.archiveRoutine(arg)
222
+ saveLedger(ledger)
223
+ console.log(`${routine.status}: ${routine.id}`)
224
+ return
225
+ }
226
+ console.error(`unknown routine subcommand: ${sub}`)
227
+ process.exitCode = 1
228
+ }
229
+
176
230
  async function office(kind, specFile, outFile) {
177
- const kinds = ['docx', 'xlsx', 'pptx', 'mermaid', 'drawio']
231
+ const kinds = ['docx', 'xlsx', 'pptx', 'xmind', 'mermaid', 'drawio']
178
232
  if (!kinds.includes(kind) || !specFile || !outFile) {
179
- console.error('usage: advisers office <docx|xlsx|pptx|mermaid|drawio> <spec.json> <out>')
233
+ console.error('usage: advisers office <docx|xlsx|pptx|xmind|mermaid|drawio> <spec.json> <out>')
180
234
  process.exitCode = 1
181
235
  return
182
236
  }
@@ -203,10 +257,10 @@ async function office(kind, specFile, outFile) {
203
257
  console.log(`wrote ${outFile}`)
204
258
  return
205
259
  }
206
- const builder = kind === 'docx' ? mod.buildDocx : kind === 'xlsx' ? mod.buildXlsx : mod.buildPptx
260
+ const builder = kind === 'docx' ? mod.buildDocx : kind === 'xlsx' ? mod.buildXlsx : kind === 'xmind' ? mod.buildXmind : mod.buildPptx
207
261
  const buffer = await builder(spec)
208
262
  writeFileSync(outFile, buffer)
209
- const result = await mod.validateOffice(buffer, kind)
263
+ const result = kind === 'xmind' ? await mod.validateXmind(buffer) : await mod.validateOffice(buffer, kind)
210
264
  console.log(result.ok ? `wrote ${outFile} (${buffer.length} bytes)` : `wrote ${outFile}, missing: ${result.missing.join(', ')}`)
211
265
  if (!result.ok) process.exitCode = 1
212
266
  }
@@ -286,6 +340,8 @@ if (!command || command === 'help' || command === '--help') {
286
340
  } else if (command === 'office') {
287
341
  await office(args[0], args[1], args[2])
288
342
  process.exit(process.exitCode || 0)
343
+ } else if (command === 'routine') {
344
+ routine(args[0], args[1])
289
345
  } else if (command === 'soul') {
290
346
  soul(args[0], args[1])
291
347
  } else {
package/index.js CHANGED
@@ -1,5 +1,5 @@
1
1
  export * from 'advisers-core'
2
2
 
3
- export const version = '0.1.0-preview.2'
3
+ export const version = '0.1.0-preview.3'
4
4
  export const distribution = 'cordis'
5
5
  export const status = 'bootstrapping'
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "advisers",
3
- "version": "0.1.0-preview.2",
3
+ "version": "0.1.0-preview.3",
4
4
  "description": "A staff of AI advisers: a cordis-native personal secretary runtime with scoped memory, commitments, and reviewable routines.",
5
5
  "keywords": [
6
6
  "cordis",
@@ -30,7 +30,7 @@
30
30
  "LICENSE"
31
31
  ],
32
32
  "dependencies": {
33
- "advisers-core": "0.1.0-preview.2"
33
+ "advisers-core": "0.1.0-preview.3"
34
34
  },
35
35
  "repository": {
36
36
  "type": "git",
@@ -45,7 +45,7 @@
45
45
  "access": "public"
46
46
  },
47
47
  "peerDependencies": {
48
- "advisers-office": "0.1.0-preview.1"
48
+ "advisers-office": "0.1.0-preview.2"
49
49
  },
50
50
  "peerDependenciesMeta": {
51
51
  "advisers-office": {