opencode-codeops 2.2.1 → 2.4.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.
- package/CHANGELOG.md +45 -0
- package/README.md +53 -0
- package/_shared/discovery.md +92 -0
- package/_shared/zero-ambiguity-gate.md +4 -0
- package/bin/lib/discovery-rules.d.mts +228 -0
- package/bin/lib/discovery-rules.mjs +1213 -0
- package/bin/lib/discovery-server.d.mts +62 -0
- package/bin/lib/discovery-server.mjs +755 -0
- package/bin/lib/discovery-store.d.mts +224 -0
- package/bin/lib/discovery-store.mjs +1189 -0
- package/bin/lib/discovery-tools.d.mts +66 -0
- package/bin/lib/discovery-tools.mjs +540 -0
- package/discovery-ui/dist/assets/app.js +107 -0
- package/discovery-ui/dist/index.html +17 -0
- package/package.json +14 -2
- package/plugin/index.ts +45 -4
- package/schemas/codeops-config.schema.json +8 -0
- package/scripts/__pycache__/codeops_plan.cpython-312.pyc +0 -0
- package/scripts/__pycache__/install_agents.cpython-312.pyc +0 -0
- package/scripts/build-discovery-ui.mjs +59 -0
- package/skills/analyze-project/SKILL.md +19 -0
- package/skills/make-plan/SKILL.md +7 -1
- package/skills/preflight/SKILL.md +4 -0
- package/skills/preflight/report-format.md +4 -0
- package/skills/setup-codeops/SKILL.md +3 -0
- package/skills/setup-codeops/scaffold.md +2 -1
|
@@ -0,0 +1,62 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Type declarations for the CodeOps Discovery listener.
|
|
3
|
+
*
|
|
4
|
+
* The listener is plain JavaScript so `node --test` can exercise it directly;
|
|
5
|
+
* these declarations give the TypeScript plugin entry point typed access.
|
|
6
|
+
*/
|
|
7
|
+
|
|
8
|
+
import type { DiscoveryStore } from "./discovery-store.mjs"
|
|
9
|
+
|
|
10
|
+
/** The result of starting the listener. */
|
|
11
|
+
export interface ListeningResult {
|
|
12
|
+
url: string
|
|
13
|
+
fallback: boolean
|
|
14
|
+
}
|
|
15
|
+
|
|
16
|
+
/** The delivery outcome a registered project reports. */
|
|
17
|
+
export type DeliveryOutcome = "woken" | "pending" | "failed"
|
|
18
|
+
|
|
19
|
+
/** Options shared by runtime creation and lookup. */
|
|
20
|
+
export interface DiscoveryRuntimeOptions {
|
|
21
|
+
store: DiscoveryStore
|
|
22
|
+
assetsDir: string
|
|
23
|
+
version: string
|
|
24
|
+
port?: number
|
|
25
|
+
log?: (message: string) => void
|
|
26
|
+
}
|
|
27
|
+
|
|
28
|
+
/** The process-wide Discovery runtime. */
|
|
29
|
+
export interface DiscoveryRuntime {
|
|
30
|
+
/** Start the listener on demand; concurrent calls share one attempt. */
|
|
31
|
+
ensureListening(): Promise<ListeningResult | null>
|
|
32
|
+
/** Register one project's delivery callback; returns an identity-checked unregister. */
|
|
33
|
+
registerProject(
|
|
34
|
+
directory: string,
|
|
35
|
+
slug: string,
|
|
36
|
+
deliver: (planSlug: string) => Promise<DeliveryOutcome>
|
|
37
|
+
): () => void
|
|
38
|
+
/** True when an open page shows this plan. */
|
|
39
|
+
hasViewer(projectSlug: string, planSlug: string): boolean
|
|
40
|
+
/** Broadcast one live event to the plan's open pages. */
|
|
41
|
+
notify(
|
|
42
|
+
projectSlug: string,
|
|
43
|
+
planSlug: string,
|
|
44
|
+
event: "changed" | "delivered",
|
|
45
|
+
data: Record<string, unknown>
|
|
46
|
+
): void
|
|
47
|
+
/** End streams, close connections, and stop when no project remains. */
|
|
48
|
+
closeIfIdle(): Promise<void>
|
|
49
|
+
/** The absolute page URL, or null before the listener starts. */
|
|
50
|
+
planUrl(projectSlug: string, planSlug: string): string | null
|
|
51
|
+
/** The one store every handler uses. */
|
|
52
|
+
readonly store: DiscoveryStore
|
|
53
|
+
}
|
|
54
|
+
|
|
55
|
+
/** Resolve the listener port from the environment. */
|
|
56
|
+
export declare function resolvePort(env?: Record<string, string | undefined>): number
|
|
57
|
+
|
|
58
|
+
/** Create a runtime, installing it in the process-wide slot when empty. */
|
|
59
|
+
export declare function createDiscoveryRuntime(options: DiscoveryRuntimeOptions): DiscoveryRuntime
|
|
60
|
+
|
|
61
|
+
/** The process-wide runtime, created on first use. */
|
|
62
|
+
export declare function getDiscoveryRuntime(options: DiscoveryRuntimeOptions): DiscoveryRuntime
|