Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 0 additions & 6 deletions apps/loopover-ui/src/lib/ams-env-reference.ts
Original file line number Diff line number Diff line change
Expand Up @@ -151,11 +151,6 @@ export const AMS_ENV_REFERENCE_ROWS: MinerEnvReferenceRow[] = [
firstReference: "lib/replay-snapshot.js",
defaultValue: null,
},
{
name: "LOOPOVER_MINER_REPO_CLONE_DIR",
firstReference: "lib/repo-clone.js",
defaultValue: "",
},
{
name: "LOOPOVER_MINER_RUN_STATE_DB",
firstReference: "lib/run-state.js",
Expand Down Expand Up @@ -249,7 +244,6 @@ export const AMS_ENV_REFERENCE_MARKDOWN = [
"| `LOOPOVER_MINER_PREDICTION_LEDGER_DB` | `lib/prediction-ledger.js` | (none) |",
"| `LOOPOVER_MINER_RANKED_CANDIDATES_DB` | `lib/ranked-candidates.js` | (none) |",
"| `LOOPOVER_MINER_REPLAY_SNAPSHOT_DB` | `lib/replay-snapshot.js` | (none) |",
'| `LOOPOVER_MINER_REPO_CLONE_DIR` | `lib/repo-clone.js` | `""` |',
"| `LOOPOVER_MINER_RUN_STATE_DB` | `lib/run-state.js` | (none) |",
"| `LOOPOVER_MINER_SENTRY_DSN` | `lib/sentry.js` | (none) |",
'| `LOOPOVER_MINER_SENTRY_ENVIRONMENT` | `lib/sentry.js` | `"production"` |',
Expand Down
1 change: 0 additions & 1 deletion packages/loopover-miner/docs/env-reference.md
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,6 @@ Generated by `npm run miner:env-reference`. Do not edit manually.
| `LOOPOVER_MINER_PREDICTION_LEDGER_DB` | `lib/prediction-ledger.js` | (none) |
| `LOOPOVER_MINER_RANKED_CANDIDATES_DB` | `lib/ranked-candidates.js` | (none) |
| `LOOPOVER_MINER_REPLAY_SNAPSHOT_DB` | `lib/replay-snapshot.js` | (none) |
| `LOOPOVER_MINER_REPO_CLONE_DIR` | `lib/repo-clone.js` | `""` |
| `LOOPOVER_MINER_RUN_STATE_DB` | `lib/run-state.js` | (none) |
| `LOOPOVER_MINER_SENTRY_DSN` | `lib/sentry.js` | (none) |
| `LOOPOVER_MINER_SENTRY_ENVIRONMENT` | `lib/sentry.js` | `"production"` |
Expand Down
61 changes: 31 additions & 30 deletions packages/loopover-miner/lib/chat-action-registry.d.ts
Original file line number Diff line number Diff line change
@@ -1,42 +1,43 @@
export type ChatActionRequest = {
action?: string;
params?: unknown;
governorInput?: unknown;
action?: string;
params?: unknown;
governorInput?: unknown;
};

/** A handler produced by {@link governorGatedHandler}; the only shape {@link ChatActionRegistry.register} accepts. */
export type GovernorGatedHandler = (request: ChatActionRequest) => Promise<Record<string, unknown>>;

export type ChatActionDefinition = {
paramsValidator: (params: unknown) => boolean;
handler: GovernorGatedHandler;
paramsValidator: (params: unknown) => boolean;
handler: GovernorGatedHandler;
};

export type ChatActionEntry = {
paramsValidator: (params: unknown) => boolean;
handler: GovernorGatedHandler;
paramsValidator: (params: unknown) => boolean;
handler: GovernorGatedHandler;
};

export type ChatActionRegistry = {
register(name: string, definition: ChatActionDefinition): ChatActionEntry;
get(name: string): ChatActionEntry | undefined;
has(name: string): boolean;
names(): string[];
readonly size: number;
register(name: string, definition: ChatActionDefinition): ChatActionEntry;
get(name: string): ChatActionEntry | undefined;
has(name: string): boolean;
names(): string[];
readonly size: number;
};

export function governorGatedHandler(
run: (request: ChatActionRequest, gate: unknown) => unknown,
options?: {
/**
* Wrap a local-write `run` function into a Governor-gated chat-action handler. The returned handler
* evaluates the write against the full precedence ladder (via `evaluateGovernorChokepointGate`) BEFORE
* running `run`, and only invokes `run` on a final `"allow"` verdict -- any other stage returns a gated
* result and `run` never executes. This is the ONLY factory that produces a handler `register` accepts.
*/
export declare function governorGatedHandler(run: (request: ChatActionRequest, gate: unknown) => unknown, options?: {
evaluateGate?: (input: unknown, gateOptions?: unknown) => unknown;
gateOptions?: unknown;
},
): GovernorGatedHandler;

export function isGovernorGatedHandler(handler: unknown): boolean;

export function createChatActionRegistry(): ChatActionRegistry;

export const chatActionRegistry: ChatActionRegistry;

export function registerChatAction(name: string, definition: ChatActionDefinition): ChatActionEntry;
}): GovernorGatedHandler;
/** True only for a handler produced by {@link governorGatedHandler}. */
export declare function isGovernorGatedHandler(handler: unknown): boolean;
/**
* Build an isolated chat-action registry. Child issues register into the shared {@link chatActionRegistry};
* this factory exists so tests (and any future multi-registry consumer) can register without polluting it.
*/
export declare function createChatActionRegistry(): ChatActionRegistry;
/** The single shared registry the dispatch layer reads. Ships EMPTY (#6519); child issues register into it. */
export declare const chatActionRegistry: ChatActionRegistry;
/** Register a chat action on the shared {@link chatActionRegistry}. */
export declare function registerChatAction(name: string, definition: ChatActionDefinition): ChatActionEntry;
111 changes: 49 additions & 62 deletions packages/loopover-miner/lib/chat-action-registry.js

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Loading
Loading