cuelo 0.10.232 → 0.10.233

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 (63) hide show
  1. package/.next/BUILD_ID +1 -1
  2. package/.next/app-path-routes-manifest.json +41 -41
  3. package/.next/build-manifest.json +2 -2
  4. package/.next/prerender-manifest.json +3 -3
  5. package/.next/required-server-files.js +1 -1
  6. package/.next/required-server-files.json +1 -1
  7. package/.next/server/app/_global-error/page_client-reference-manifest.js +1 -1
  8. package/.next/server/app/_global-error.html +1 -1
  9. package/.next/server/app/_global-error.rsc +1 -1
  10. package/.next/server/app/_global-error.segments/_full.segment.rsc +1 -1
  11. package/.next/server/app/_global-error.segments/_global-error/__PAGE__.segment.rsc +1 -1
  12. package/.next/server/app/_global-error.segments/_global-error.segment.rsc +1 -1
  13. package/.next/server/app/_global-error.segments/_head.segment.rsc +1 -1
  14. package/.next/server/app/_global-error.segments/_index.segment.rsc +1 -1
  15. package/.next/server/app/_global-error.segments/_tree.segment.rsc +1 -1
  16. package/.next/server/app/_not-found/page_client-reference-manifest.js +1 -1
  17. package/.next/server/app/_not-found.html +1 -1
  18. package/.next/server/app/_not-found.rsc +2 -2
  19. package/.next/server/app/_not-found.segments/_full.segment.rsc +2 -2
  20. package/.next/server/app/_not-found.segments/_head.segment.rsc +1 -1
  21. package/.next/server/app/_not-found.segments/_index.segment.rsc +2 -2
  22. package/.next/server/app/_not-found.segments/_not-found/__PAGE__.segment.rsc +1 -1
  23. package/.next/server/app/_not-found.segments/_not-found.segment.rsc +1 -1
  24. package/.next/server/app/_not-found.segments/_tree.segment.rsc +1 -1
  25. package/.next/server/app/api/updates/apply/route.js +2 -2
  26. package/.next/server/app/api/updates/route.js +1 -1
  27. package/.next/server/app/index.html +1 -1
  28. package/.next/server/app/index.rsc +4 -4
  29. package/.next/server/app/index.segments/__PAGE__.segment.rsc +3 -3
  30. package/.next/server/app/index.segments/_full.segment.rsc +4 -4
  31. package/.next/server/app/index.segments/_head.segment.rsc +1 -1
  32. package/.next/server/app/index.segments/_index.segment.rsc +2 -2
  33. package/.next/server/app/index.segments/_tree.segment.rsc +1 -1
  34. package/.next/server/app/page.js +5 -5
  35. package/.next/server/app/page_client-reference-manifest.js +1 -1
  36. package/.next/server/app/recover/page_client-reference-manifest.js +1 -1
  37. package/.next/server/app/recover.html +1 -1
  38. package/.next/server/app/recover.rsc +2 -2
  39. package/.next/server/app/recover.segments/_full.segment.rsc +2 -2
  40. package/.next/server/app/recover.segments/_head.segment.rsc +1 -1
  41. package/.next/server/app/recover.segments/_index.segment.rsc +2 -2
  42. package/.next/server/app/recover.segments/_tree.segment.rsc +1 -1
  43. package/.next/server/app/recover.segments/recover/__PAGE__.segment.rsc +1 -1
  44. package/.next/server/app/recover.segments/recover.segment.rsc +1 -1
  45. package/.next/server/app-paths-manifest.json +41 -41
  46. package/.next/server/chunks/5228.js +1 -1
  47. package/.next/server/middleware-build-manifest.js +1 -1
  48. package/.next/server/pages/404.html +1 -1
  49. package/.next/server/pages/500.html +1 -1
  50. package/.next/server/server-reference-manifest.json +1 -1
  51. package/.next/static/chunks/app/{layout-8fe49107ef95bc85.js → layout-4b28f216485a3896.js} +1 -1
  52. package/.next/static/chunks/app/{page-1b2075085bff84f0.js → page-1d9e31c2d51d3152.js} +5 -5
  53. package/.next/trace +111 -111
  54. package/.next/trace-build +1 -1
  55. package/Tools/CUELO_Setup/files/native-runtime-patch.js +1 -1
  56. package/Tools/CUELO_Setup/files/usage-server.js +8 -4
  57. package/Tools/OMP_Global_Config/agent/extensions/draft.ts +2 -2
  58. package/Tools/OMP_Global_Config/agent/rules/subagent.md +4 -4
  59. package/Tools/OMP_Global_Config/agent/rules/writing-review-procedure.md +2 -2
  60. package/Tools/OMP_Global_Config/patches/apply-core-patch.mjs +162 -0
  61. package/package.json +1 -1
  62. /package/.next/static/{NVK-6kV2UVzHGTnMG9ZVq → f3GLlXoGuVAhYoVJet89H}/_buildManifest.js +0 -0
  63. /package/.next/static/{NVK-6kV2UVzHGTnMG9ZVq → f3GLlXoGuVAhYoVJet89H}/_ssgManifest.js +0 -0
package/.next/trace-build CHANGED
@@ -1 +1 @@
1
- [{"name":"run-webpack","duration":73937622,"timestamp":368017,"id":14,"parentId":1,"tags":{},"startTime":1794539331670,"traceId":"69573f7228fee2b1"},{"name":"run-typescript","duration":15710653,"timestamp":74697251,"id":11363,"parentId":1,"tags":{},"startTime":1794539405999,"traceId":"69573f7228fee2b1"},{"name":"static-check","duration":2414135,"timestamp":90488860,"id":11366,"parentId":1,"tags":{},"startTime":1794539421790,"traceId":"69573f7228fee2b1"},{"name":"static-generation","duration":5022357,"timestamp":92983790,"id":11572,"parentId":1,"tags":{},"startTime":1794539424285,"traceId":"69573f7228fee2b1"},{"name":"collect-build-traces","duration":15625801,"timestamp":92967333,"id":11569,"parentId":1,"tags":{},"startTime":1794539424269,"traceId":"69573f7228fee2b1"},{"name":"telemetry-flush","duration":55,"timestamp":108596677,"id":11581,"parentId":1,"tags":{},"startTime":1794539439898,"traceId":"69573f7228fee2b1"},{"name":"next-build","duration":108289241,"timestamp":307512,"id":1,"tags":{"buildMode":"default","version":"16.2.12","bundler":"webpack","has-custom-webpack-config":"true","use-build-worker":"false"},"startTime":1794539331609,"traceId":"69573f7228fee2b1"}]
1
+ [{"name":"run-webpack","duration":89309476,"timestamp":638468,"id":14,"parentId":1,"tags":{},"startTime":1794542460297,"traceId":"bca5bd694dff8acf"},{"name":"run-typescript","duration":20173436,"timestamp":90366247,"id":11363,"parentId":1,"tags":{},"startTime":1794542550025,"traceId":"bca5bd694dff8acf"},{"name":"static-check","duration":2955799,"timestamp":110620256,"id":11366,"parentId":1,"tags":{},"startTime":1794542570279,"traceId":"bca5bd694dff8acf"},{"name":"static-generation","duration":9346951,"timestamp":113670523,"id":11572,"parentId":1,"tags":{},"startTime":1794542573329,"traceId":"bca5bd694dff8acf"},{"name":"collect-build-traces","duration":19535447,"timestamp":113649279,"id":11569,"parentId":1,"tags":{},"startTime":1794542573308,"traceId":"bca5bd694dff8acf"},{"name":"telemetry-flush","duration":69,"timestamp":133189508,"id":11581,"parentId":1,"tags":{},"startTime":1794542592848,"traceId":"bca5bd694dff8acf"},{"name":"next-build","duration":132633350,"timestamp":556250,"id":1,"tags":{"buildMode":"default","version":"16.2.12","bundler":"webpack","has-custom-webpack-config":"true","use-build-worker":"false"},"startTime":1794542460215,"traceId":"bca5bd694dff8acf"}]
@@ -9,7 +9,7 @@ const MEMORY_RE = /(const phase1Model = await resolveMemoryModel\(\{[^}]*?fallba
9
9
  const MEMORY_DONE = /const phase1Model = await resolveMemoryModel\(\{[^}]*?fallbackRole: "smol"/;
10
10
  const EXPECTED = {
11
11
  name: 'cuelo',
12
- version: '0.10.232',
12
+ version: '0.10.233',
13
13
  distribution: 'cuelo',
14
14
  coreVersion: '18.20.0',
15
15
  };
@@ -578,15 +578,16 @@ function createControlFacade(getControl, invalidate = invalidateUsage, { now = D
578
578
  const status = live.statuses.find(value => value.credentialId === id);
579
579
  if (!status || status.error) throw controlError(502, 'credit_list_failed');
580
580
  const credit = savedReset(status, live.at, entry.provider).credits.find(value => value.id === creditId);
581
- if (!credit || (entry.provider === 'anthropic' && status.nextCreditId !== creditId)) {
581
+ if (!credit || (entry.provider === 'anthropic' && (status.eligible !== true || credit.usable !== true))) {
582
582
  throw controlError(409, 'credit_unavailable');
583
583
  }
584
584
  // 전송한 결과는 그 권리 실체에 묶어 보관한다. 불확실한 결과를 다시 보내지 않고,
585
585
  // 새로 발급된 같은 id의 권리나 남은 다음 회차에는 지난 결과를 돌려주지 않는다.
586
586
  const grant = resetGrant(entry.provider, id, credit);
587
587
  const retained = settledResets.get(grantKey(grant));
588
- // provider가 소비하지 않았다고 확정한 결과(DEFINITE_NOT_CONSUMED)만 자동·수동 모두 보관 결과를 넘어 fresh 상태로 다시 판단한다.
589
- if (retained && autoFinal(retained)) {
588
+ // A confirmed mismatch may leave the requested grant untouched. A new manual confirmation
589
+ // may try it again; automatic expiry sweeps must never repeat that mutation.
590
+ if (retained && autoFinal(retained) && (auto || !retained.result?.consumedCreditIds?.length)) {
590
591
  if (retained.error) throw retained.error;
591
592
  return retained.result;
592
593
  }
@@ -615,7 +616,10 @@ function createControlFacade(getControl, invalidate = invalidateUsage, { now = D
615
616
  const code = known.includes(outcome.code) || /^http_[1-5]\d\d$/.test(outcome.code)
616
617
  ? outcome.code : 'unknown_outcome';
617
618
  result = { ok: code === 'reset', credentialId: id, creditId, code,
618
- ...(code === 'unknown_outcome' || /^http_5/.test(code) ? { outcomeUnknown: true } : {}) };
619
+ ...(code === 'unknown_outcome' || /^http_5/.test(code) ? { outcomeUnknown: true } : {}),
620
+ ...(entry.provider === 'anthropic' && typeof outcome.reason === 'string' ? { reason: outcome.reason } : {}),
621
+ ...(entry.provider === 'anthropic' && Array.isArray(outcome.consumedCreditIds)
622
+ ? { consumedCreditIds: outcome.consumedCreditIds } : {}) };
619
623
  } catch {
620
624
  error = controlError(502, 'reset_outcome_unknown', true);
621
625
  }
@@ -7,7 +7,7 @@ import { findPdfBackend, renderPdf } from "./draft/pdf";
7
7
  import { collect, completeRole, HelperCallError, resolveDraftFallback, secretFileName, toolResult, withFallback, type HelperAnswer, type HelperModel, type HelperResult } from "./skim";
8
8
  // 런타임 패키지는 legacy-pi 확장 loader가 host SDK 경로로 재작성하므로 skim.ts 안에서 지연 import한다.
9
9
 
10
- // 문서 한 편을 통째로 받는다. 출력 상한은 모델 최대치(Gemini 4 Argon 65,536토큰)라 우리 상한 때문에 잘리지
10
+ // 문서 한 편을 통째로 받는다. 출력 상한은 모델 최대치(Gemini 4 Hydrogen·Argon 모두 65,536토큰)라 우리 상한 때문에 잘리지
11
11
  // 않는다. 그래도 모델 최대치에서 잘린 응답(stopReason length)은 반쪽 문서라 저장하지 않고 실패로 돌린다.
12
12
  // 최대 출력을 다 쓰는 초안도 끝날 시간을 준다.
13
13
  const TIMEOUT_MS = 600_000;
@@ -201,7 +201,7 @@ export default function draft(pi: ExtensionAPI): void {
201
201
  const z = pi.zod;
202
202
  pi.registerTool({
203
203
  name: "draft", label: "Draft", loadMode: "essential", approval: "write",
204
- description: "Has the draft role model (default Vertex Gemini 4 Argon) write a document draft (md, txt, csv, xlsx, docx, pdf) and saves it at output inside the cwd. On failure it falls back once to the model modelRoles.draftFallback names (source-profile default: GPT-6.1 Terra via Codex). Installs without draftFallback fall back to DeepSeek 1017 on Hive; a draftFallback that is set but fails resolution, credentials or input fails under that model's name without falling through to DeepSeek. A fallback equal to the draft model is not called again. The output extension sets the format (xlsx/docx built by the tool; pdf printed through an ego lite TaskSpace on WSL, through Windows Edge only on PCs without ego lite; csv as UTF-8 BOM). Reference text in paths passes the same filter as skim and goes to that model's provider (default Google; the fallback goes to the configured model's provider). An existing file is overwritten only with overwrite: true. Returns the actual model, saved path, size and outline; if both models fail or conversion/saving fails, no file is created and an error result returns. The caller must review the result file. Use edit/write for code, configuration, rules and exact-line edits. New or paragraph-level rewritten prose is a draft target even in HANDOFF and doc/history records.",
204
+ description: "Has the draft role model (source-profile default: Gemini 4 Hydrogen via the AI Studio relay) write a document draft (md, txt, csv, xlsx, docx, pdf) and saves it at output inside the cwd. On failure it falls back once to the model modelRoles.draftFallback names (source-profile default: Gemini 4 Argon via the AI Studio relay). Installs without draftFallback fall back to DeepSeek 1017 on Hive; a draftFallback that is set but fails resolution, credentials or input fails under that model's name without falling through to DeepSeek. A fallback equal to the draft model is not called again. The output extension sets the format (xlsx/docx built by the tool; pdf printed through an ego lite TaskSpace on WSL, through Windows Edge only on PCs without ego lite; csv as UTF-8 BOM). Reference text in paths passes the same filter as skim and goes to that model's provider (default Google; the fallback goes to the configured model's provider). An existing file is overwritten only with overwrite: true. Returns the actual model, saved path, size and outline; if both models fail or conversion/saving fails, no file is created and an error result returns. The caller must review the result file. Use edit/write for code, configuration, rules and exact-line edits. New or paragraph-level rewritten prose is a draft target even in HANDOFF and doc/history records.",
205
205
  parameters: z.object({
206
206
  instruction: z.string().describe("What to write: purpose, audience, structure, length, language"),
207
207
  output: z.string().describe("Save path inside cwd: relative to cwd, or an absolute path inside cwd. The extension sets the format: .md .txt .csv .xlsx .docx .pdf"),
@@ -25,11 +25,11 @@ description: SubAgent 위임 판단, 병렬 실행, 검수 계약과 Git·통신
25
25
  편집 대상의 정확한 줄은 `read`로 다시 확인한다.
26
26
  - 글씨가 들어가는 콘텐츠를 새로 쓰거나 한 문단 이상 다시 쓸 때(README·CHANGELOG·`docs/`·보고서·소개 글, `HANDOFF.md`·작업
27
27
  기록의 서술, md·csv·Excel·Word·PDF 보고서·표, PPT 슬라이드·HTML·UI 문구)는 Main·Maker 모두 먼저
28
- `draft(instruction, output, paths?)`로 `modelRoles.draft` 모델(PC별: AI Studio 중계기 또는 Vertex의 Gemini 4 Argon)에 쓰게 한다(2026-10-25 사용자 결정, 실패 시 `modelRoles.draftFallback`이 가리키는
29
- 모델 — 소스 프로필은 GPT-6.1 Terra, 미설정 설치는 Hive의 DeepSeek 1017 — 로 한 번 대체하고 설정한 대체가 실패해도 DeepSeek로 넘어가지 않는다, 참고 텍스트는 Google 또는 대체 모델의 제공자로 전송). 사실·수치·경로는 지시나 `paths`로 넘기고, 결과를 직접 검토한 뒤
28
+ `draft(instruction, output, paths?)`로 `modelRoles.draft` 모델(소스 프로필: AI Studio 중계기의 Gemini 4 Hydrogen, 2026-11-13 사용자 결정)에 쓰게 한다(2026-10-25 사용자 결정, 실패 시 `modelRoles.draftFallback`이 가리키는
29
+ 모델 — 소스 프로필은 AI Studio 중계기의 Gemini 4 Argon, 미설정 설치는 Hive의 DeepSeek 1017 — 로 한 번 대체하고 설정한 대체가 실패해도 DeepSeek로 넘어가지 않는다, 참고 텍스트는 Google 또는 대체 모델의 제공자로 전송). 사실·수치·경로는 지시나 `paths`로 넘기고, 결과를 직접 검토한 뒤
30
30
  AI 슬롭 점검(한국어 `humanizer`, 영어 `stop-slop`, 화면 문구 `kill-ai-slop`)을 거쳐 반영한다. 코드·설정·규칙 파일,
31
31
  몇 줄 이하의 정확한 수정, 대화 답변은 대상이 아니다. Vertex Argon 호출은 Google Cloud 크레딧으로 과금되며 OCR 역할과
32
- 같은 프로젝트를 쓴다(2026-10-26 사용자 결정). 집(2026-11-07)과 사무실(2026-11-08)은 사용자 결정으로 draft·OCR을 AI Studio 중계기 Argon으로 쓴다.
32
+ 같은 프로젝트를 쓴다(2026-10-26 사용자 결정). 집(2026-11-07)과 사무실(2026-11-08)은 사용자 결정으로 draft·OCR을 AI Studio 중계기로 쓰고, 2026-11-13 사용자 결정으로 두 자리 모두 Argon에서 Hydrogen으로 옮겼다.
33
33
  일부 문단만 draft로 쓴 뒤 나머지 설명을 직접 작성하지 않는다. 새로 쓰거나 문단 단위로 다시 쓰는 각 블록을 반영 전에 draft로 작성하며, 초안 밖의 설명·예시·결론 추가는 사실·슬롭 교정 예외가 아니다. 짧은 호출 여러 번이나 HTML 한 줄로 나눠도 동일하다. 기존 문구의 정확한 사실·오탈자 교정과 문구가 그대로인 코드·레이아웃 변경은 허용한다. 반영할 문구를 초안과 대조해 빠진 블록만 다시 작성한다.
34
34
  - 문서의 `slop_check`는 사람이 실제로 보는 산출물(슬라이드·HTML·Office·PDF·보고서 csv·UI 문구·매뉴얼)에 적용한다(2026-10-26 사용자 지시,
35
35
  2026-10-29 범위 축소). 마크다운(README·CHANGELOG·`docs/`·문서 지도)은 `.slop-gate.json` `visible`이 선언하지 않으면 대상이 아니다. 공개 저장소
@@ -76,7 +76,7 @@ description: SubAgent 위임 판단, 병렬 실행, 검수 계약과 Git·통신
76
76
  - 한도 여유 비교나 과거 성공률만으로 후보를 바꾸지 않는다. Anthropic 하루 몫 소진도 Maker 후보를 바꾸는 근거가 아니며, 미관측은 소진이 아니고 해당 결정의 후보가 없으면 null과 Main 재판단 사유를 돌려준다. Sonnet 기본값은 유지하고 Sol 또는 Opus 후보가 없다고 다른 모델로 자동 대체하지 않는다.
77
77
  Sol(openai-codex)은 관측 사용률이나 계정 신호로 소진 판정하지 않는다(2026-11-11 사용자 결정: 「sol 한도도 크레딧이있으니까 실제 발주가 나갔다가 거절되면 돌리는걸로하자」). 구독 한도를 넘겨도 크레딧으로 이어지므로 추천 조건이면 그대로 추천·발주하고, 실제 사용 한도 거절은 `retry.fallbackOn: usage-limit`과 `openai-codex/gpt-6.1-sol` fallback 체인(Sonnet)이 받는다. 거절 뒤 다음 발주도 다시 Sol을 시도하며, core의 계정 차단(`autoBlockedUntil`)과 쿨다운은 그대로다.
78
78
  - `HARD_CODE_OPUS`, `HARD_CODE_TERRA`, `NORMAL_DEEPSEEK`, `HARD_CODE_DEEPSEEK`는 명시 선택 전용이다. `NORMAL_OPUS`와 `HARD_UI_OPUS`는 어려운 UI에서만, `NORMAL_SONNET`·`HARD_CODE_SONNET`은 일반 구현에서, `NORMAL_SONNET`·`HARD_UI_SONNET`은 보통 UI에서 추천하고 그 밖의 선택은 명시 전용이다. Gemini와 GLM은 2026-11-11 사용자 결정으로 Maker 후보가 아니다. `implGemini`는 HIKARI 호출과 사전 점검에만 쓰고, 두 모델로 발주하면 후보 밖이라 근거를 적어도 거절된다. 추천과 다른 의도한 예외는 `ROUTING_REASON`을 남긴다. Sol의 `NORMAL_SOL`과 `HARD_CODE_SOL61`은 위 추천 조건에서 자동 추천한다.
79
- Sol 식별자는 기존 계약으로 유지하고 그 슬롯의 실제 모델은 `config.yml`이 정한다(`skim`·`draftFallback`의 Terra는 그대로다). GPT-6 Astra는 YUKI 및 교차검토 slot `crossReviewOpenAI`에 쓰며 일반 Maker 추천 후보는 아니다. 다른 모델의 과거 평가 수치를 이 슬롯의 성능 증거로 옮기지 않는다.
79
+ Sol 식별자는 기존 계약으로 유지하고 그 슬롯의 실제 모델은 `config.yml`이 정한다(`skim`의 Terra는 그대로다). GPT-6 Astra는 YUKI 및 교차검토 slot `crossReviewOpenAI`에 쓰며 일반 Maker 추천 후보는 아니다. 다른 모델의 과거 평가 수치를 이 슬롯의 성능 증거로 옮기지 않는다.
80
80
  추천과 다른 후보를 고르면 `ROUTING_REASON`이 필요하다.
81
81
  - 기존 eval은 소표본(n=1)과 오래된 Main 벤치라 어느 쪽도 우월하다는 근거가 아니며 자동 승격·상시 게이트를 만들지 않는다.
82
82
  강도 하한·상한은 정책에 두지 않는다(child 하한은 core 설정 overlay가 건다). 별도 접근 모드는 쓰지 않는다. 구체적인 독립 판단이 필요한 cross-frontier 선택은 그 근거를 남긴다.
@@ -6,9 +6,9 @@ description: 새 글·문단 초안, 문서·UI 문구의 draft 및 slop_check
6
6
  이상 다시 쓰는 글은 Main·Maker 모두 먼저 `draft`로 쓴다. README·CHANGELOG·`docs/`·보고서·안내서·소개 글·게시물,
7
7
  `HANDOFF.md`·`doc/history` 작업 기록의 서술, md·csv·Excel·Word·PDF 보고서·표, PPT 슬라이드 문구, HTML·웹 화면과
8
8
  UI의 문구가 모두 대상이다. 사실·수치·경로·명령·커밋은 `instruction`이나 `paths`로 넘겨 모델이 지어내지 않게 한다.
9
- Gemini가 작성해 cwd 안에 저장하고, 실패하면 `modelRoles.draftFallback`이 가리키는 모델(소스 프로필은 GPT-6.1 Terra, 미설정 설치는
9
+ Gemini가 작성해 cwd 안에 저장하고, 실패하면 `modelRoles.draftFallback`이 가리키는 모델(소스 프로필은 AI Studio 중계기의 Gemini 4 Argon, 미설정 설치는
10
10
  Hive의 DeepSeek 1017)로 한 번 대체한다. 주 모델이 사용량 한도로 막혔고 프로필 `retry.fallbackChains`의 그 모델 항목에 같은 모델의 다른
11
- 경로(집과 사무실은 Vertex Argon)가 있으면 대체 모델보다 그 경로를 먼저 한 번 시도한다(2026-11-11 사용자 결정).
11
+ 경로(집과 사무실은 Vertex Hydrogen)가 있으면 대체 모델보다 그 경로를 먼저 한 번 시도한다(2026-11-11 사용자 결정).
12
12
  설정한 대체가 실패하면 DeepSeek로 넘어가지 않는다(참고 텍스트는 Google 또는 대체 모델의 제공자로
13
13
  전송). 결과는 직접 열어 사실·형식을 검토하고, 반영하기 전에 AI 슬롭 점검을 같은 작업에서 돌린다: 한국어 글은
14
14
  `humanizer`, 영어 글은 `stop-slop`, 화면·UI 문구는 `kill-ai-slop` 스킬 절차를 따른다. 틀린 사실과 슬롭만 고쳐
@@ -1531,6 +1531,168 @@ const ANTHROPIC_LOWEST_WEEKLY_SELECTION = ` // CUELO: fresh Anthropic sessions
1531
1531
 
1532
1532
  /** 각 항목: 원본 앵커를 찾아 patched 로 바꾼다. marker 가 있으면 이미 적용된 것으로 본다. */
1533
1533
  const EDITS = [
1534
+ // Claude 18.20.0 Cedar grants: next_grant_id is a suggestion, not a redemption restriction.
1535
+ {
1536
+ file: "../pi-ai/src/usage/claude-reset.ts",
1537
+ requires: "function normalizeCedarList(status: CedarStatus",
1538
+ marker: "let redeemableCount = 0; // CUELO: all usable Cedar grants",
1539
+ anchor: "\tlet selectedCredit: UsageResetCredit | undefined;",
1540
+ patched: "\tlet redeemableCount = 0; // CUELO: all usable Cedar grants",
1541
+ },
1542
+ {
1543
+ file: "../pi-ai/src/usage/claude-reset.ts",
1544
+ requires: "function normalizeCedarList(status: CedarStatus",
1545
+ marker: "\t\tconst usable =\n\t\t\tstatus.eligible &&\n\t\t\tgrant.usableNow",
1546
+ anchor: "\t\tconst selected = grant.id === status.nextGrantId;\n\t\tconst usable =\n\t\t\tstatus.eligible &&\n\t\t\tselected &&\n\t\t\tgrant.usableNow",
1547
+ patched: "\t\tconst usable =\n\t\t\tstatus.eligible &&\n\t\t\tgrant.usableNow",
1548
+ },
1549
+ {
1550
+ file: "../pi-ai/src/usage/claude-reset.ts",
1551
+ requires: "function normalizeCedarList(status: CedarStatus",
1552
+ marker: "\t\tif (usable) redeemableCount += grant.remainingCount;",
1553
+ anchor: "\t\tif (selected) selectedCredit = credit;",
1554
+ patched: "\t\tif (usable) redeemableCount += grant.remainingCount;",
1555
+ },
1556
+ {
1557
+ file: "../pi-ai/src/usage/claude-reset.ts",
1558
+ requires: "function normalizeCedarList(status: CedarStatus",
1559
+ marker: "\t\tredeemableCount,\n\t\t...(status.nextGrantId",
1560
+ anchor: "\t\tredeemableCount: selectedCredit?.usable ? (selectedCredit.remainingCount ?? 0) : 0,",
1561
+ patched: "\t\tredeemableCount,",
1562
+ },
1563
+ {
1564
+ file: "../pi-ai/src/usage/claude-reset.ts",
1565
+ requires: "const CEDAR_PROGRAM = \"cedar_ember\";",
1566
+ marker: "/** Spend exactly the requested usable Claude reset.",
1567
+ anchor: "/** Spend exactly the server-selected Claude reset. Mutation requests are never retried. */",
1568
+ patched: "/** Spend exactly the requested usable Claude reset. Mutation requests are never retried. */",
1569
+ },
1570
+ {
1571
+ file: "../pi-ai/src/auth/resets.ts",
1572
+ requires: "#pendingClaudeResets",
1573
+ marker: "// CUELO: reconcile the pending grant before choosing another usable grant.",
1574
+ anchor: ` const selected = list.credits.find(credit => credit.id === list.nextCreditId);
1575
+ if (creditId && creditId !== list.nextCreditId) {
1576
+ return { ...identity, ok: false, code: "offer_changed", creditId };
1577
+ }
1578
+ if (!list.eligible || !selected || !selected.usable || (list.redeemableCount ?? 0) < 1) {
1579
+ return {
1580
+ ...identity,
1581
+ ok: false,
1582
+ code: list.availableCount > 0 ? "ineligible" : "no_credit",
1583
+ reason: list.reason,
1584
+ };
1585
+ }
1586
+ creditId = selected.id;
1587
+ let pending = this.#pendingClaudeResets.get(accountKey);
1588
+ const pendingCreditId = pending?.creditId;
1589
+ // The ambiguous claim's credit left the live offer: it was consumed or
1590
+ // expired. Either way its idempotency key can never settle, and the
1591
+ // account is at a wall again now, so a new offer is a fresh claim.
1592
+ if (pendingCreditId !== undefined && !list.credits.some(credit => credit.id === pendingCreditId)) {
1593
+ this.#pendingClaudeResets.delete(accountKey);
1594
+ pending = undefined;
1595
+ }
1596
+ if (pending) {
1597
+ if (pending.creditId !== creditId) return { ...identity, ok: false, code: "reset_unconfirmed", creditId };
1598
+ if (
1599
+ pending.remainingCount !== undefined &&
1600
+ selected.remainingCount !== undefined &&
1601
+ selected.remainingCount < pending.remainingCount
1602
+ ) {
1603
+ this.#pendingClaudeResets.delete(accountKey);
1604
+ this.#deps.usageCache.invalidateAfterReset(provider, options.baseUrl, {
1605
+ resetSpentCredentialId: access.credentialId,
1606
+ });
1607
+ return { ...identity, ok: false, code: "already_redeemed", creditId };
1608
+ }
1609
+ if (pending.program === "juniper_tide") {
1610
+ return { ...identity, ok: false, code: "reset_unconfirmed", creditId };
1611
+ }
1612
+ }`,
1613
+ patched: ` // CUELO: reconcile the pending grant before choosing another usable grant.
1614
+ let pending = this.#pendingClaudeResets.get(accountKey);
1615
+ if (pending) {
1616
+ const previous = list.credits.find(credit => credit.id === pending!.creditId);
1617
+ const spent = previous !== undefined && pending.remainingCount !== undefined &&
1618
+ previous.remainingCount !== undefined && previous.remainingCount < pending.remainingCount;
1619
+ if (!previous || spent) {
1620
+ this.#pendingClaudeResets.delete(accountKey);
1621
+ // Absence can also mean expiry; do not claim a spend or POST another grant.
1622
+ if (!previous && (!creditId || creditId === pending.creditId)) {
1623
+ return { ...identity, ok: false, code: "reset_unconfirmed", creditId: pending.creditId };
1624
+ }
1625
+ if (spent) {
1626
+ this.#deps.usageCache.invalidateAfterReset(provider, options.baseUrl, {
1627
+ resetSpentCredentialId: access.credentialId,
1628
+ });
1629
+ if (!creditId || creditId === pending.creditId) {
1630
+ return { ...identity, ok: false, code: "already_redeemed", creditId: pending.creditId };
1631
+ }
1632
+ }
1633
+ pending = undefined;
1634
+ }
1635
+ }
1636
+ const selected = list.credits.find(credit => credit.id === (creditId ?? list.nextCreditId));
1637
+ if (creditId && (!list.eligible || !selected?.usable)) {
1638
+ return { ...identity, ok: false, code: "offer_changed", creditId };
1639
+ }
1640
+ if (!list.eligible || !selected?.usable) {
1641
+ return { ...identity, ok: false, code: list.availableCount > 0 ? "ineligible" : "no_credit",
1642
+ reason: list.reason };
1643
+ }
1644
+ creditId = selected.id;
1645
+ if (pending && (pending.creditId !== creditId || pending.program === "juniper_tide")) {
1646
+ return { ...identity, ok: false, code: "reset_unconfirmed", creditId };
1647
+ }`,
1648
+ },
1649
+ {
1650
+ file: "../pi-ai/src/auth/resets.ts",
1651
+ requires: "#pendingClaudeResets",
1652
+ marker: "// CUELO: observe which grant dropped; never repeat a successful mutation.",
1653
+ anchor: ` result = {
1654
+ ...identity,
1655
+ ok: consumed.ok,
1656
+ code: consumed.code,
1657
+ reason: consumed.reason,
1658
+ cleared: consumed.cleared,
1659
+ creditId,
1660
+ };`,
1661
+ patched: ` // CUELO: observe which grant dropped; never repeat a successful mutation.
1662
+ let consumedCreditIds: string[] | undefined;
1663
+ if (consumed.ok) {
1664
+ const after = await listClaudeResetCredits(auth).catch(() => null);
1665
+ if (after) {
1666
+ const dropped = list.credits.filter(before => {
1667
+ const current = after.credits.find(credit => credit.id === before.id);
1668
+ const expired = before.expiresAt !== undefined && Date.parse(before.expiresAt) <= Date.now();
1669
+ return !expired && before.remainingCount !== undefined &&
1670
+ (current?.remainingCount ?? 0) < before.remainingCount;
1671
+ });
1672
+ if (dropped.some(credit => credit.id !== creditId)) {
1673
+ consumedCreditIds = dropped.map(credit => credit.id);
1674
+ consumed.cleared = [...new Set(dropped.flatMap(credit => credit.clears ?? []))];
1675
+ }
1676
+ }
1677
+ }
1678
+ result = {
1679
+ ...identity,
1680
+ ok: consumed.ok,
1681
+ code: consumed.code,
1682
+ reason: consumed.reason ?? (/^http_4/.test(consumed.code) && consumed.raw !== undefined
1683
+ ? JSON.stringify(consumed.raw).slice(0, 1000) : undefined),
1684
+ cleared: consumed.cleared,
1685
+ creditId,
1686
+ ...(consumedCreditIds ? { consumedCreditIds } : {}),
1687
+ };`,
1688
+ },
1689
+ {
1690
+ file: "../pi-ai/src/auth/types.ts",
1691
+ requires: "export interface ResetCreditRedeemOutcome",
1692
+ marker: "\tconsumedCreditIds?: string[];",
1693
+ anchor: "\t/** The credit that was spent (when one was). */\n\tcreditId?: string;",
1694
+ patched: "\t/** Requested credit (or the default next credit). */\n\tcreditId?: string;\n\t/** Observed count drops when the provider consumed a different grant. */\n\tconsumedCreditIds?: string[];",
1695
+ },
1534
1696
  {
1535
1697
  file: "src/session/agent-session.ts",
1536
1698
  marker: "async replayRevivedSystemPrompt(): Promise<void>",
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "cuelo",
3
- "version": "0.10.232",
3
+ "version": "0.10.233",
4
4
  "description": "CUELO — open-source AI coding agent workspace and harness for omp (oh-my-pi)",
5
5
  "homepage": "https://github.com/gim47656-ship-it/CUELO#readme",
6
6
  "repository": {