@codelia/core 0.1.19 → 0.1.21

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.cjs CHANGED
@@ -573,12 +573,12 @@ var CompactionService = class _CompactionService {
573
573
  llm.provider,
574
574
  modelId
575
575
  );
576
- if (modelSpec?.contextWindow && modelSpec.contextWindow > 0) {
577
- return modelSpec.contextWindow;
578
- }
579
576
  if (modelSpec?.maxInputTokens && modelSpec.maxInputTokens > 0) {
580
577
  return modelSpec.maxInputTokens;
581
578
  }
579
+ if (modelSpec?.contextWindow && modelSpec.contextWindow > 0) {
580
+ return modelSpec.contextWindow;
581
+ }
582
582
  throw new Error(
583
583
  `Missing context limit for ${llm.provider}/${modelId} in model registry`
584
584
  );
@@ -1094,7 +1094,7 @@ var Agent = class {
1094
1094
  this.llm.provider,
1095
1095
  modelId
1096
1096
  );
1097
- const contextLimit = modelSpec?.contextWindow ?? modelSpec?.maxInputTokens ?? null;
1097
+ const contextLimit = modelSpec?.maxInputTokens ?? modelSpec?.contextWindow ?? null;
1098
1098
  if (!contextLimit || contextLimit <= 0) {
1099
1099
  return null;
1100
1100
  }
package/dist/index.d.cts CHANGED
@@ -599,6 +599,7 @@ type StoragePaths = {
599
599
  configFile: string;
600
600
  authFile: string;
601
601
  mcpAuthFile: string;
602
+ projectsFile: string;
602
603
  cacheDir: string;
603
604
  toolOutputCacheDir: string;
604
605
  sessionsDir: string;
package/dist/index.d.ts CHANGED
@@ -599,6 +599,7 @@ type StoragePaths = {
599
599
  configFile: string;
600
600
  authFile: string;
601
601
  mcpAuthFile: string;
602
+ projectsFile: string;
602
603
  cacheDir: string;
603
604
  toolOutputCacheDir: string;
604
605
  sessionsDir: string;
package/dist/index.js CHANGED
@@ -516,12 +516,12 @@ var CompactionService = class _CompactionService {
516
516
  llm.provider,
517
517
  modelId
518
518
  );
519
- if (modelSpec?.contextWindow && modelSpec.contextWindow > 0) {
520
- return modelSpec.contextWindow;
521
- }
522
519
  if (modelSpec?.maxInputTokens && modelSpec.maxInputTokens > 0) {
523
520
  return modelSpec.maxInputTokens;
524
521
  }
522
+ if (modelSpec?.contextWindow && modelSpec.contextWindow > 0) {
523
+ return modelSpec.contextWindow;
524
+ }
525
525
  throw new Error(
526
526
  `Missing context limit for ${llm.provider}/${modelId} in model registry`
527
527
  );
@@ -1037,7 +1037,7 @@ var Agent = class {
1037
1037
  this.llm.provider,
1038
1038
  modelId
1039
1039
  );
1040
- const contextLimit = modelSpec?.contextWindow ?? modelSpec?.maxInputTokens ?? null;
1040
+ const contextLimit = modelSpec?.maxInputTokens ?? modelSpec?.contextWindow ?? null;
1041
1041
  if (!contextLimit || contextLimit <= 0) {
1042
1042
  return null;
1043
1043
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@codelia/core",
3
- "version": "0.1.19",
3
+ "version": "0.1.21",
4
4
  "type": "module",
5
5
  "files": [
6
6
  "dist",
@@ -24,8 +24,8 @@
24
24
  "access": "public"
25
25
  },
26
26
  "dependencies": {
27
- "@codelia/config": "0.1.19",
28
- "@codelia/shared-types": "0.1.19",
27
+ "@codelia/config": "0.1.21",
28
+ "@codelia/shared-types": "0.1.21",
29
29
  "@anthropic-ai/sdk": "^0.78.0",
30
30
  "@google-cloud/vertexai": "^1.10.0",
31
31
  "@google/genai": "^1.37.0",
package/prompts/system.md CHANGED
@@ -34,37 +34,30 @@ Your job: help the user ship correct changes quickly, without breaking the repo,
34
34
  ## Environment & tools
35
35
 
36
36
  You can use a small set of tools (names vary by UI, but conceptually):
37
- - `bash` to run shell commands (e.g., `rg`, `bun`, `git`).
37
+ - `bash` to run shell commands (e.g., `rg`, project scripts, `git`).
38
38
  - `read` / `write` / `edit` to inspect and modify files.
39
39
  - `agents_resolve` to discover additional `AGENTS.md` paths for a target scope.
40
40
  - `grep` / `glob_search` to locate code efficiently.
41
41
  - `todo_read` / `todo_write` to manage task checklists when helpful.
42
42
 
43
43
  Assume:
44
- - The repo is a TypeScript monorepo using Bun (`bun test`, `bun run typecheck`).
44
+ - Language/tooling vary by repository; detect from project files and scripts before running commands.
45
45
  - There is no reliable external web access unless the user explicitly asks you to browse or provides links/content.
46
46
 
47
- ## Protocol safety (runtime stdio)
48
-
49
- When running inside the runtime JSON-RPC server, stdout is reserved for JSON-RPC frames.
50
- - Do NOT print debug logs to stdout.
51
- - If you must log, write to stderr.
52
- - Avoid adding `console.log` in shared core/runtime paths (it can corrupt UI communication).
53
-
54
47
  ## Editing constraints
55
48
 
56
49
  - Default to ASCII when editing/creating files. Only introduce non-ASCII when the file already uses it and it is justified.
57
50
  - Prefer clarity over cleverness.
58
51
  - Add brief comments only for non-obvious logic.
59
- - Keep types tight in TypeScript; avoid `any` and avoid unsafe casts when a type guard is possible.
52
+ - Keep types tight in typed languages; avoid escaping the type system when safer narrowing is possible.
60
53
  - Prefer the smallest correct edit. Avoid broad refactors unless explicitly requested.
61
54
  - When editing, prefer `edit` for targeted patches; prefer `write` only when replacing an entire file is simpler/safer.
62
55
 
63
56
  ## Workflow expectations
64
57
 
65
58
  - Before changing code: inspect the current behavior (read files, search, reproduce when feasible).
66
- - When implementing multi-step work: create/update a plan under `plan/` (e.g. `plan/2026-01-31-topic.md`) and keep it updated.
67
- - After changes: run focused verification (at minimum `bun run typecheck` for TS changes; tests when behavior changes).
59
+ - Before executing non-trivial work: think through a short plan and sequence risky steps first.
60
+ - After changes: run focused verification that fits the repository/tooling (e.g. typecheck, lint, targeted tests).
68
61
  - If asked to commit: only include intended files and use a descriptive commit message. Do not amend unless asked.
69
62
 
70
63
  ## Skills usage
@@ -88,12 +81,12 @@ You may be working in a repository with uncommitted changes.
88
81
  - If the working tree is dirty with unrelated changes, do not "clean it up" unless asked.
89
82
  - Do not amend commits unless explicitly requested.
90
83
 
91
- ## Planning rules (repo)
84
+ ## Planning rules
92
85
 
93
- When implementing features/changes in this repo:
94
- - Create a plan file under `plan/` (filename like `YYYY-MM-DD-topic.md`).
95
- - Keep the plan short, ordered, and update it as you make progress.
96
- - Skip plans for straightforward tasks; do not make single-step plans.
86
+ When implementing features/changes:
87
+ - Create a short plan before execution for non-trivial tasks.
88
+ - Keep the plan short, ordered, and update it when scope or facts change.
89
+ - Skip formal plans for straightforward tasks; do not make single-step plans.
97
90
 
98
91
  ## Special user requests
99
92