@opencow-ai/opencow-agent-sdk 0.4.0 → 0.4.2-beta.0

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.
@@ -87,18 +87,37 @@ export declare function getNodeEnv(): string;
87
87
  export declare function getUserType(): string;
88
88
  export declare function isCustomTitleEnabled(): boolean;
89
89
  export declare const getProjectDir: any;
90
+ /**
91
+ * Drop the in-memory Project for a given sessionId. Called by
92
+ * `SessionRuntime.close()` after SessionEnd fires so the Map doesn't
93
+ * accumulate Project instances over the lifetime of a long-running host.
94
+ *
95
+ * Best-effort: callers should have already awaited any pending writes
96
+ * upstream. We intentionally don't await `flush()` here — close() needs
97
+ * to return promptly, and process-exit cleanup will catch any straggler.
98
+ */
99
+ export declare function clearProjectForSession(sessionId: string): void;
90
100
  /**
91
101
  * Reset the Project singleton's flush state for testing.
92
- * This ensures tests don't interfere with each other via shared counter state.
102
+ * Iterates every live Project so tests don't have to know which sessionId
103
+ * key is active.
93
104
  */
94
105
  export declare function resetProjectFlushStateForTesting(): void;
95
106
  /**
96
- * Reset the entire Project singleton for testing.
97
- * This ensures tests with different CLAUDE_CONFIG_DIR values
98
- * don't share stale sessionFile paths.
107
+ * Reset all Project state for testing.
108
+ * Clears the per-session Map AND process-level service slots so tests with
109
+ * different CLAUDE_CONFIG_DIR / writer / reader values don't share stale
110
+ * paths or callbacks across test cases.
99
111
  */
100
112
  export declare function resetProjectForTesting(): void;
101
113
  export declare function setSessionFileForTesting(path: string): void;
114
+ /**
115
+ * Read back the active ALS scope's Project.sessionFile for testing.
116
+ * Companion to setSessionFileForTesting — exposes the value the per-session
117
+ * Map is holding so concurrent-session isolation tests can assert that
118
+ * different sessionIds see different sessionFile values.
119
+ */
120
+ export declare function getProjectSessionFileForTesting(): string | null;
102
121
  type InternalEventWriter = (eventType: string, payload: Record<string, unknown>, options?: {
103
122
  isCompaction?: boolean;
104
123
  agentId?: string;
@@ -107,6 +126,10 @@ type InternalEventWriter = (eventType: string, payload: Record<string, unknown>,
107
126
  * Register a CCR v2 internal event writer for transcript persistence.
108
127
  * When set, transcript messages are written as internal worker events
109
128
  * instead of going through v1 Session Ingress.
129
+ *
130
+ * Process-level: the writer is recorded in a module-level slot AND
131
+ * broadcast to every live Project. New Projects created later (i.e.
132
+ * future sessions) inherit it via `getProject()` initialization.
110
133
  */
111
134
  export declare function setInternalEventWriter(writer: InternalEventWriter): void;
112
135
  type InternalEventReader = () => Promise<{
@@ -117,6 +140,8 @@ type InternalEventReader = () => Promise<{
117
140
  * Register a CCR v2 internal event reader for session resume.
118
141
  * When set, hydrateFromCCRv2InternalEvents() can fetch foreground and
119
142
  * subagent internal events to reconstruct conversation state on reconnection.
143
+ *
144
+ * Process-level: same broadcast pattern as setInternalEventWriter.
120
145
  */
121
146
  export declare function setInternalEventReader(reader: InternalEventReader, subagentReader: InternalEventReader): void;
122
147
  /**
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@opencow-ai/opencow-agent-sdk",
3
- "version": "0.4.0",
3
+ "version": "0.4.2-beta.0",
4
4
  "description": "Claude Code opened to any LLM — OpenAI, Gemini, DeepSeek, Ollama, and 200+ models",
5
5
  "type": "module",
6
6
  "main": "./dist/sdk.js",
@@ -86,12 +86,13 @@
86
86
  "release:patch": "bun run scripts/release.ts --bump patch",
87
87
  "release:minor": "bun run scripts/release.ts --bump minor",
88
88
  "release:major": "bun run scripts/release.ts --bump major",
89
- "release:prepatch": "bun run scripts/release.ts --bump prepatch --preid rc --tag next",
90
- "release:preminor": "bun run scripts/release.ts --bump preminor --preid rc --tag next",
91
- "release:premajor": "bun run scripts/release.ts --bump premajor --preid rc --tag next",
92
- "release:prerelease": "bun run scripts/release.ts --bump prerelease --preid rc --tag next",
93
- "release:dry": "bun run scripts/release.ts --dry-run",
89
+ "release:prepatch": "bun run scripts/release.ts --bump prepatch --preid rc",
90
+ "release:preminor": "bun run scripts/release.ts --bump preminor --preid rc",
91
+ "release:premajor": "bun run scripts/release.ts --bump premajor --preid rc",
92
+ "release:prerelease": "bun run scripts/release.ts --bump prerelease --preid rc",
93
+ "release:dry": "bun run scripts/release.ts --bump patch --dry-run",
94
94
  "release:check": "bun run typecheck && bun run smoke",
95
+ "release:ripgrep": "bun run scripts/release-ripgrep.ts",
95
96
  "prepack": "npm run build"
96
97
  },
97
98
  "dependencies": {
@@ -201,5 +202,6 @@
201
202
  "license": "Apache-2.0",
202
203
  "publishConfig": {
203
204
  "access": "public"
204
- }
205
+ },
206
+ "packageManager": "pnpm@10.32.1+sha512.a706938f0e89ac1456b6563eab4edf1d1faf3368d1191fc5c59790e96dc918e4456ab2e67d613de1043d2e8c81f87303e6b40d4ffeca9df15ef1ad567348f2be"
205
207
  }