kiosapi 0.1.3 → 0.1.4

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.
@@ -17,19 +17,20 @@ const ROLES = {
17
17
  brief: 'Peranmu: PENINJAU. Baca file yang relevan dan tinjau hasil implementasi: sebutkan masalah/risiko & saran perbaikan singkat.',
18
18
  },
19
19
  };
20
- /** Run one role as a sub-agent and return its final text. */
21
- async function runRole(role, task, opts) {
22
- console.log(`\n${bold(role.title)}`);
23
- const s = newSession(opts.model, role.mode, opts.otomatis);
20
+ /** Run one role as a sub-agent (with its own model) and return its final text. */
21
+ async function runRole(name, task, opts) {
22
+ const role = ROLES[name];
23
+ const model = opts.models[name];
24
+ console.log(`\n${bold(role.title)} ${dim(`(${model})`)}`);
25
+ const s = newSession(model, role.mode, opts.otomatis);
24
26
  s.messages.push({ role: 'system', content: role.brief });
25
27
  return runTurn(s, task);
26
28
  }
27
29
  /** Orchestrate the perencana → pengkode → peninjau pipeline for a task. */
28
30
  export async function runTeam(task, opts) {
29
31
  console.log(bold('👥 Tim agen: perencana → pengkode → peninjau'));
30
- console.log(dim(`Model: ${opts.model}`));
31
- const plan = await runRole(ROLES.perencana, task, opts);
32
- await runRole(ROLES.pengkode, `Tugas: ${task}\n\nRencana:\n${plan || '(tidak ada rencana eksplisit)'}`, opts);
33
- await runRole(ROLES.peninjau, `Tinjau hasil implementasi untuk tugas: ${task}`, opts);
32
+ const plan = await runRole('perencana', task, opts);
33
+ await runRole('pengkode', `Tugas: ${task}\n\nRencana:\n${plan || '(tidak ada rencana eksplisit)'}`, opts);
34
+ await runRole('peninjau', `Tinjau hasil implementasi untuk tugas: ${task}`, opts);
34
35
  console.log(green('\n✓ Tim selesai.'));
35
36
  }
package/dist/commands.js CHANGED
@@ -404,19 +404,34 @@ export async function cmdLihat(args) {
404
404
  stop();
405
405
  process.stdout.write('\n');
406
406
  }
407
- /** tim — multi-agent pipeline (perencana → pengkode → peninjau). */
407
+ /**
408
+ * tim — multi-agent pipeline (perencana → pengkode → peninjau). Each role can use a different model
409
+ * via --perencana/--pengkode/--peninjau; roles without an override fall back to -m / the default.
410
+ */
408
411
  export async function cmdTim(args) {
409
412
  const { values, positionals } = parseArgs({
410
413
  args,
411
- options: { model: { type: 'string', short: 'm' }, otomatis: { type: 'boolean' } },
414
+ options: {
415
+ model: { type: 'string', short: 'm' },
416
+ otomatis: { type: 'boolean' },
417
+ perencana: { type: 'string' },
418
+ pengkode: { type: 'string' },
419
+ peninjau: { type: 'string' },
420
+ },
412
421
  allowPositionals: true,
413
422
  });
414
423
  const task = positionals.join(' ').trim();
415
424
  if (!task)
416
425
  throw new Error('Beri tugas. Contoh: kiosapi tim "bikin endpoint /health + tes"');
417
- const model = await resolveModel(values.model);
418
- await warnIfNoTools(model);
419
- await runTeam(task, { model, otomatis: Boolean(values.otomatis) });
426
+ const base = await resolveModel(values.model);
427
+ const models = {
428
+ perencana: values.perencana ?? base,
429
+ pengkode: values.pengkode ?? base,
430
+ peninjau: values.peninjau ?? base,
431
+ };
432
+ for (const m of new Set(Object.values(models)))
433
+ await warnIfNoTools(m);
434
+ await runTeam(task, { models, otomatis: Boolean(values.otomatis) });
420
435
  }
421
436
  /** saldo — show own balance, bonus tokens, and month-to-date spend. */
422
437
  export async function cmdSaldo() {
package/dist/session.js CHANGED
@@ -99,7 +99,10 @@ async function runSlash(line, s) {
99
99
  if (!task)
100
100
  console.log(red('Beri tugas. Contoh: /tim bikin endpoint /health + tes'));
101
101
  else
102
- await runTeam(task, { model: s.model, otomatis: s.otomatis });
102
+ await runTeam(task, {
103
+ models: { perencana: s.model, pengkode: s.model, peninjau: s.model },
104
+ otomatis: s.otomatis,
105
+ });
103
106
  return false;
104
107
  }
105
108
  case 'gambar':
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "kiosapi",
3
- "version": "0.1.3",
3
+ "version": "0.1.4",
4
4
  "type": "module",
5
5
  "description": "CLI Kiosapi.id berbahasa Indonesia — bangun aplikasimu pakai API key Kiosapi (agen + multimodal).",
6
6
  "keywords": [
@@ -28,7 +28,10 @@
28
28
  "bin": {
29
29
  "kiosapi": "./dist/index.js"
30
30
  },
31
- "files": ["dist", "README.md"],
31
+ "files": [
32
+ "dist",
33
+ "README.md"
34
+ ],
32
35
  "engines": {
33
36
  "node": ">=20"
34
37
  },