pantheon-opencode 1.6.3-beta.6 → 1.7.0-beta.1

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.
Files changed (69) hide show
  1. package/AGENTS.global.md +1 -1
  2. package/AGENTS.md +1 -1
  3. package/CHANGELOG.md +201 -0
  4. package/README.md +16 -2
  5. package/README.pt-BR.md +1 -1
  6. package/bin/pantheon-init.mjs +46 -28
  7. package/package.json +2 -2
  8. package/plugin.json +2 -2
  9. package/pyproject.toml +1 -1
  10. package/scripts/decision-router-budget.mjs +102 -2
  11. package/scripts/decision-router-v2-budget.mjs +2 -2
  12. package/scripts/decision-router.mjs +82 -25
  13. package/scripts/doctor.mjs +4 -1
  14. package/scripts/install/cli-ui.mjs +2 -1
  15. package/scripts/install/decision-router-config.mjs +12 -4
  16. package/scripts/install/interactive.mjs +45 -28
  17. package/scripts/install/opencode.mjs +151 -30
  18. package/scripts/jev-live-probe.mjs +212 -0
  19. package/scripts/skill-search.mjs +273 -0
  20. package/skills-lock.json +3 -1
  21. package/src/agents/aphrodite.md +34 -1
  22. package/src/agents/apollo.md +227 -0
  23. package/src/agents/athena.md +26 -0
  24. package/src/agents/demeter.md +33 -0
  25. package/src/agents/gaia.md +24 -0
  26. package/src/agents/hephaestus.md +24 -0
  27. package/src/agents/hermes.md +33 -0
  28. package/src/agents/iris.md +24 -0
  29. package/src/agents/mnemosyne.md +25 -3
  30. package/src/agents/nyx.md +50 -22
  31. package/src/agents/prometheus.md +242 -1
  32. package/src/agents/talos.md +24 -0
  33. package/src/agents/themis.md +24 -0
  34. package/src/agents/zeus.md +81 -6
  35. package/src/pantheon/j1-approvals.ts +123 -0
  36. package/src/pantheon/jev-decision-tool.ts +293 -35
  37. package/src/pantheon/jev-decisions.ts +95 -12
  38. package/src/pantheon/jev-escalation.ts +1 -1
  39. package/src/pantheon/jev-quality-score.ts +45 -10
  40. package/src/pantheon/jev-rank-verify.ts +665 -0
  41. package/src/pantheon/jev-risk-gate.ts +82 -12
  42. package/src/pantheon/local-decision-budget.ts +169 -2
  43. package/src/pantheon/local-decision-prompt.ts +2 -0
  44. package/src/pantheon/local-decision-router.ts +16 -0
  45. package/src/pantheon/local-decision-turn.ts +110 -4
  46. package/src/pantheon/local-decision-usage-evidence.internal.ts +2 -2
  47. package/src/pantheon/pantheon-decision-catalog.ts +9 -2
  48. package/src/pantheon/v2-decision-budget.ts +4 -2
  49. package/src/pantheon/v2-tools.ts +42 -0
  50. package/src/plugin-v2.ts +85 -5
  51. package/src/plugins/tui/dist/server-v2.d.ts +14 -6
  52. package/src/plugins/tui/dist/server-v2.d.ts.map +1 -1
  53. package/src/plugins/tui/dist/server-v2.js +16 -9
  54. package/src/plugins/tui/dist/server-v2.js.map +1 -1
  55. package/src/plugins/tui/dist/tui-v2.js +128 -25
  56. package/src/plugins/tui/dist/tui-v2.js.map +1 -1
  57. package/src/plugins/tui/dist/tui.js +1 -1
  58. package/src/plugins/tui/package-lock.json +2 -2
  59. package/src/plugins/tui/package.json +1 -1
  60. package/src/plugins/tui/src/server-v2.ts +14 -7
  61. package/src/plugins/tui/src/whats-new-highlights.ts +59 -5
  62. package/src/plugins/tui/src/whats-new-open.ts +41 -1
  63. package/src/plugins/tui/src/whats-new.tsx +61 -8
  64. package/src/routing.yml +2 -0
  65. package/src/skills/README.md +1 -1
  66. package/src/skills/agent-forge/SKILL.md +76 -0
  67. package/src/skills/auto-continue/SKILL.md +12 -163
  68. package/src/skills/auto-continue/references/auto-continue-details.md +175 -0
  69. package/src/skills/prompt-refinery/SKILL.md +60 -0
@@ -63,10 +63,33 @@ export const J4_QUALITY_SCORE_POINT = 'J4'
63
63
 
64
64
  /** Question names of the two prepared questions, matched on consumption. */
65
65
  export const QUALITY_QUESTION_NAME = 'quality'
66
- export const REVIEW_QUESTION_NAME = 'noul'
66
+ /**
67
+ * Field report (beta.13→16): the review question was literally named 'noul'
68
+ * — the decision model's internal archetype leaked into a user-visible
69
+ * payload. The name is ours to choose; `quality` says what it measures.
70
+ */
71
+ export const REVIEW_QUESTION_NAME = 'needs_review'
67
72
 
68
73
  /** DSH hard-cap mirror: at most 4 criteria per review request. */
69
74
  export const J4_MAX_CRITERIA = 4
75
+
76
+ /**
77
+ * Normalize one criterion: a plain string, or a `{ id?, description }` record
78
+ * (field report beta.24 #10 — the object form is the natural caller shape and
79
+ * was refused by a strings-only check; both are accepted, the DESCRIPTION is
80
+ * what rides the request, the id is caller bookkeeping).
81
+ */
82
+ export function normalizeJevCriterion(raw: unknown): string | null {
83
+ if (typeof raw === 'string') return raw
84
+ if (raw !== null && typeof raw === 'object' && !Array.isArray(raw)) {
85
+ const record = raw as { id?: unknown; description?: unknown }
86
+ if (record.id !== undefined && (typeof record.id !== 'string' || record.id.length > 64)) {
87
+ return null
88
+ }
89
+ if (typeof record.description === 'string') return record.description
90
+ }
91
+ return null
92
+ }
70
93
  /** A rubric needs at least one named criterion. */
71
94
  export const J4_MIN_CRITERIA = 1
72
95
  /** Each criterion is a bounded instruction string (1–120 chars). */
@@ -114,7 +137,12 @@ export type QualityScorePreparedRequest =
114
137
  /** The request body; the caller attaches the resolved route's `model`. */
115
138
  readonly request: Omit<NativeDecisionRequest, 'model'>
116
139
  }
117
- | { readonly ok: false; readonly reasonCode: QualityScoreRequestFailure }
140
+ | {
141
+ readonly ok: false
142
+ readonly reasonCode: QualityScoreRequestFailure
143
+ /** Per-cause token (e.g. CRITERIA_SHAPE) so the caller can fix the input. */
144
+ readonly detail?: string
145
+ }
118
146
 
119
147
  const QUALITY_LABELS = [
120
148
  'unusable',
@@ -220,16 +248,23 @@ export function buildQualityScoreRequest(
220
248
  if (criteria.length < J4_MIN_CRITERIA || criteria.length > J4_MAX_CRITERIA) {
221
249
  return { ok: false, reasonCode: 'CRITERIA_INVALID' }
222
250
  }
251
+ const normalized: string[] = []
223
252
  for (const criterion of criteria) {
253
+ const text = normalizeJevCriterion(criterion)
224
254
  if (
225
- typeof criterion !== 'string' ||
226
- criterion.length < 1 ||
227
- criterion.length > J4_CRITERIA_MAX_LENGTH ||
228
- criterion.trim().length === 0 ||
229
- isHostileCriterion(criterion)
255
+ text === null ||
256
+ text.length < 1 ||
257
+ text.length > J4_CRITERIA_MAX_LENGTH ||
258
+ text.trim().length === 0 ||
259
+ isHostileCriterion(text)
230
260
  ) {
231
- return { ok: false, reasonCode: 'CRITERIA_INVALID' }
261
+ return {
262
+ ok: false,
263
+ reasonCode: 'CRITERIA_INVALID',
264
+ detail: 'CRITERIA_SHAPE — cada critério é uma string (1-120) ou {id?, description}',
265
+ }
232
266
  }
267
+ normalized.push(text)
233
268
  }
234
269
 
235
270
  const state =
@@ -244,7 +279,7 @@ export function buildQualityScoreRequest(
244
279
  }
245
280
  const qualityInstructions =
246
281
  QUALITY_INSTRUCTIONS_PREFIX +
247
- ` Criteria: ${criteria.map((criterion, index) => `(${index + 1}) ${criterion}`).join('; ')}.`
282
+ ` Criteria: ${normalized.map((criterion, index) => `(${index + 1}) ${criterion}`).join('; ')}.`
248
283
  return {
249
284
  ok: true,
250
285
  request: Object.freeze({
@@ -356,7 +391,7 @@ export function encodeQualityScoreReason(input: {
356
391
  * ANY other key — `state`, `questions`, or a smuggled content field — refuses
357
392
  * the preparation, so no content slot exists even at the input boundary.
358
393
  */
359
- const REVIEW_ENVELOPE_KEYS: ReadonlySet<string> = new Set([
394
+ export const REVIEW_ENVELOPE_KEYS: ReadonlySet<string> = new Set([
360
395
  'schemaVersion',
361
396
  'mode',
362
397
  'delegateId',