opencode-titan 0.1.2 → 0.1.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/dist/index.js +63 -5
- package/package.json +1 -1
package/dist/index.js
CHANGED
|
@@ -359,6 +359,20 @@ ${customAppendPrompt}` : effectiveBase;
|
|
|
359
359
|
}
|
|
360
360
|
function buildTitanPrompt(myrmidons, maxResponseWords = DEFAULT_MAX_RESPONSE_WORDS) {
|
|
361
361
|
const resolveProvider = resolveMyrmidonProvider;
|
|
362
|
+
const bestFor = (myrmidon) => {
|
|
363
|
+
const strong = myrmidon.intelligence >= 7;
|
|
364
|
+
const fast = myrmidon.speed >= 7;
|
|
365
|
+
if (myrmidon.modelType === "dense") {
|
|
366
|
+
if (strong) {
|
|
367
|
+
return "hard reasoning, complex code generation, debugging strategy, architectural decisions";
|
|
368
|
+
}
|
|
369
|
+
return "moderate logic tasks, small bounded code changes, structured analysis";
|
|
370
|
+
}
|
|
371
|
+
if (fast) {
|
|
372
|
+
return "fast codebase search, documentation lookups, broad exploration, gathering many facts in parallel";
|
|
373
|
+
}
|
|
374
|
+
return "general information gathering and lookups";
|
|
375
|
+
};
|
|
362
376
|
const myrmidonDescriptions = myrmidons.map((myrmidon, idx) => {
|
|
363
377
|
const name = `myrmidon-${idx}`;
|
|
364
378
|
const provider = resolveProvider(myrmidon);
|
|
@@ -372,9 +386,38 @@ function buildTitanPrompt(myrmidons, maxResponseWords = DEFAULT_MAX_RESPONSE_WOR
|
|
|
372
386
|
- **Speed:** ${myrmidon.speed}/10 (${myrmidon.speed >= 7 ? "fast" : myrmidon.speed >= 4 ? "moderate" : "slow"})
|
|
373
387
|
- **Intelligence:** ${myrmidon.intelligence}/10 (${myrmidon.intelligence >= 7 ? "strong reasoning" : myrmidon.intelligence >= 4 ? "adequate reasoning" : "limited reasoning"})
|
|
374
388
|
- **Model Type:** ${myrmidon.modelType} (${myrmidon.modelType === "dense" ? "better at logic, planning, complex problem-solving" : "better at information gathering, fast lookups, broad search"})
|
|
375
|
-
|
|
389
|
+
- **Best for:** ${bestFor(myrmidon)}
|
|
390
|
+
${myrmidon.displayName ? `- **Display Name (UI label only \u2014 NEVER use this to route or to refer to this worker; always say @${name}):** ${myrmidon.displayName}` : ""}
|
|
376
391
|
</Myrmidon>`;
|
|
377
392
|
}).join("\n\n");
|
|
393
|
+
const byIntelligence = myrmidons.map((m, idx) => ({ m, idx })).sort((a, b) => b.m.intelligence - a.m.intelligence || a.idx - b.idx);
|
|
394
|
+
const bySpeed = myrmidons.map((m, idx) => ({ m, idx })).sort((a, b) => b.m.speed - a.m.speed || a.idx - b.idx);
|
|
395
|
+
const smartest = byIntelligence[0];
|
|
396
|
+
const fastest = bySpeed[0];
|
|
397
|
+
const denseRanked = byIntelligence.filter(({ m }) => m.modelType === "dense");
|
|
398
|
+
const sparseRanked = bySpeed.filter(({ m }) => m.modelType === "sparse");
|
|
399
|
+
const rankLines = [];
|
|
400
|
+
if (smartest) {
|
|
401
|
+
rankLines.push(
|
|
402
|
+
`- **Smartest (use for the hardest reasoning):** @myrmidon-${smartest.idx} (intelligence ${smartest.m.intelligence}/10)`
|
|
403
|
+
);
|
|
404
|
+
}
|
|
405
|
+
if (fastest) {
|
|
406
|
+
rankLines.push(
|
|
407
|
+
`- **Fastest (use for time-sensitive lookups / max parallelism):** @myrmidon-${fastest.idx} (speed ${fastest.m.speed}/10)`
|
|
408
|
+
);
|
|
409
|
+
}
|
|
410
|
+
if (denseRanked.length > 0) {
|
|
411
|
+
rankLines.push(
|
|
412
|
+
`- **Dense (logic/planning), best\u2192worst:** ${denseRanked.map(({ idx, m }) => `@myrmidon-${idx} (int ${m.intelligence})`).join(", ")}`
|
|
413
|
+
);
|
|
414
|
+
}
|
|
415
|
+
if (sparseRanked.length > 0) {
|
|
416
|
+
rankLines.push(
|
|
417
|
+
`- **Sparse (search/gathering), fastest\u2192slowest:** ${sparseRanked.map(({ idx, m }) => `@myrmidon-${idx} (spd ${m.speed})`).join(", ")}`
|
|
418
|
+
);
|
|
419
|
+
}
|
|
420
|
+
const capabilityRoster = rankLines.join("\n");
|
|
378
421
|
const hasDense = myrmidons.some((m) => m.modelType === "dense");
|
|
379
422
|
const hasSparse = myrmidons.some((m) => m.modelType === "sparse");
|
|
380
423
|
const hasHighIntel = myrmidons.some((m) => m.intelligence >= 7);
|
|
@@ -425,6 +468,14 @@ You have ${myrmidons.length} Myrmidons available:
|
|
|
425
468
|
|
|
426
469
|
${myrmidonDescriptions}
|
|
427
470
|
|
|
471
|
+
**CAPABILITY ROSTER \u2014 pick by fitness, never by number**
|
|
472
|
+
Your Myrmidons are NOT interchangeable and are NOT to be used in numeric order. myrmidon-0 is not "the default." Choose the worker whose Speed / Intelligence / Model Type best fits each task, using this ranking:
|
|
473
|
+
${capabilityRoster}
|
|
474
|
+
|
|
475
|
+
Routing rule: match the task to a capability FIRST, then pick the worker that ranks highest for that capability. The index in the name (0, 1, 2, \u2026) is just an identifier \u2014 it carries NO priority. Sending most work to @myrmidon-0 simply because it is listed first is a bug.
|
|
476
|
+
|
|
477
|
+
**Canonical naming:** Refer to every worker ONLY by its \`@myrmidon-N\` name \u2014 in your planning, your reasoning, your dispatches, and when re-running or referencing a previous task. Do not use a worker's Display Name or any \`child-N\` alias to identify it. When you re-run a task, re-use the EXACT same \`@myrmidon-N\` you originally dispatched it to; verify the index against the roster before dispatching so you don't accidentally reference a different worker.
|
|
478
|
+
|
|
428
479
|
${sharedProviders.length > 0 ? `
|
|
429
480
|
**\u26A0\uFE0F PROVIDER CONFLICTS \u2014 READ BEFORE EVERY DISPATCH \u26A0\uFE0F**
|
|
430
481
|
Each line below is a group of mutually-exclusive Myrmidons that share one physical backend. Only one model fits in that backend's VRAM at a time. Treat each group as a "pick at most ONE per turn" constraint:
|
|
@@ -475,10 +526,10 @@ You are slow. Your Myrmidons are fast \u2014 sometimes 50x faster. You have **${
|
|
|
475
526
|
|
|
476
527
|
**You must never artificially cap dispatches at 2.** If there are 3, 4, or 5 independent tasks, dispatch 3, 4, or 5 Myrmidons in one turn.
|
|
477
528
|
|
|
478
|
-
Examples:
|
|
479
|
-
- 3 independent investigation tasks \u2192 dispatch
|
|
480
|
-
- 5 files to analyze \u2192 dispatch one Myrmidon per file, all in ONE response.
|
|
481
|
-
- Mix of coding + research + validation \u2192
|
|
529
|
+
Examples (note: the worker names below are illustrative \u2014 always pick by capability from the roster, not by these literal indices):
|
|
530
|
+
- 3 independent investigation tasks \u2192 dispatch three DIFFERENT Myrmidons chosen for the work (e.g. the hard-analysis one to your smartest dense worker, the two lookups to your fastest sparse workers) in ONE response.
|
|
531
|
+
- 5 files to analyze \u2192 dispatch one Myrmidon per file, all in ONE response, spreading them across your fastest workers and free providers.
|
|
532
|
+
- Mix of coding + research + validation \u2192 route the coding to a dense worker, the research to a fast sparse worker, the validation to whichever capable worker is on a free provider \u2014 all at once.
|
|
482
533
|
|
|
483
534
|
Identify idle Myrmidons before acting on anything yourself.
|
|
484
535
|
|
|
@@ -513,6 +564,13 @@ Build a minimal work graph:
|
|
|
513
564
|
- Which tasks depend on others?
|
|
514
565
|
- Which Myrmidon is best suited for each task based on speed, intelligence, and model type?
|
|
515
566
|
|
|
567
|
+
### Worker-selection algorithm (run this for EVERY task \u2014 do not default to index order)
|
|
568
|
+
For each unit of work, in order:
|
|
569
|
+
1. **Classify the task:** is it (a) hard reasoning / complex code / debugging strategy \u2192 wants *dense + high intelligence*, or (b) search / lookup / broad gathering \u2192 wants *sparse + high speed*?
|
|
570
|
+
2. **Consult the CAPABILITY ROSTER** above and pick the highest-ranked worker for that class. Use the "Smartest" worker for (a); use the "Fastest" sparse worker for (b).
|
|
571
|
+
3. **Apply the provider constraint:** if your top pick's provider is already taken this turn by a different model, drop to the next-best worker on a FREE provider rather than colliding.
|
|
572
|
+
4. **Only then** emit the dispatch. The numeric index played no role in this decision \u2014 if you notice you're about to send everything to @myrmidon-0, stop and re-run this algorithm; you're almost certainly ignoring a better-fit worker.
|
|
573
|
+
|
|
516
574
|
## 3. Dispatch
|
|
517
575
|
Launch ALL independent tasks in a single response using the task() tool.
|
|
518
576
|
|