@squidcloud/backend 1.0.489 → 1.0.491

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 (39) hide show
  1. package/dist/backend/src/internal/source-code.d.ts +0 -2
  2. package/dist/backend/src/source-code/index.d.ts +1 -17
  3. package/dist/backend/src/source-code/source-provider-adapter.d.ts +9 -2
  4. package/dist/backend/src/source-code/trusted-executable.d.ts +3 -0
  5. package/dist/backend/src/workspace-client.d.ts +4 -3
  6. package/dist/cjs/index.js +1 -1
  7. package/dist/cjs/internal/source-code.js +1 -1
  8. package/dist/esm/index.js +1 -1
  9. package/dist/esm/internal/source-code.js +1 -1
  10. package/dist/internal-common/src/public-types-backend/ai-agent.public-context.d.ts +22 -0
  11. package/package.json +2 -2
  12. package/dist/backend/src/cli-agent/claude-code.adapter.d.ts +0 -79
  13. package/dist/backend/src/cli-agent/cli-agent-adapter.types.d.ts +0 -134
  14. package/dist/backend/src/cli-agent/cli-agent-process-launcher.d.ts +0 -22
  15. package/dist/backend/src/cli-agent/cli-agent-process-runner.d.ts +0 -35
  16. package/dist/backend/src/cli-agent/cli-agent-root-status.d.ts +0 -25
  17. package/dist/backend/src/cli-agent/cli-agent-status.utils.d.ts +0 -9
  18. package/dist/backend/src/cli-agent/cli-output-stream.utils.d.ts +0 -1
  19. package/dist/backend/src/cli-agent/codex.adapter.d.ts +0 -82
  20. package/dist/backend/src/cli-agent/index.d.ts +0 -10
  21. package/dist/backend/src/cli-agent/nsjail-source-process-launcher.d.ts +0 -43
  22. package/dist/backend/src/cli-agent/workspace.utils.d.ts +0 -20
  23. package/dist/backend/src/source-code/local-source-development-runner.d.ts +0 -10
  24. package/dist/backend/src/source-code/restricted-source-runner.d.ts +0 -87
  25. package/dist/backend/src/source-code/source-code-analyzer.d.ts +0 -58
  26. package/dist/backend/src/source-code/source-code-errors.d.ts +0 -13
  27. package/dist/backend/src/source-code/source-code-limits.d.ts +0 -23
  28. package/dist/backend/src/source-code/source-code-telemetry.d.ts +0 -31
  29. package/dist/backend/src/source-code/source-development-runtime.d.ts +0 -2
  30. package/dist/backend/src/source-code/source-egress-proxy.d.ts +0 -123
  31. package/dist/backend/src/source-code/source-evidence-verifier.d.ts +0 -110
  32. package/dist/backend/src/source-code/source-model-proxy.constants.d.ts +0 -6
  33. package/dist/backend/src/source-code/source-provider-operation-broker.d.ts +0 -111
  34. package/dist/backend/src/source-code/source-repository-snapshot.d.ts +0 -15
  35. package/dist/backend/src/source-code/source-socket-admission.d.ts +0 -17
  36. package/dist/backend/src/source-code/source-submodule-url.d.ts +0 -10
  37. package/dist/backend/src/source-code/source-workspace-manager.d.ts +0 -162
  38. package/dist/backend/src/source-code/source-workspace-manifest.d.ts +0 -43
  39. package/dist/backend/src/source-code/windows-local-cli-process-launcher.d.ts +0 -13
@@ -1,58 +0,0 @@
1
- import { type AiAgentSourceCodeIntegrationOptions, type AnalyzeCodeRequest, type AnalyzeCodeResult } from '@squidcloud/client';
2
- import type { CliAgentStatusUpdate } from '../cli-agent/cli-agent-adapter.types';
3
- import { RestrictedSourceRunRequest, RestrictedSourceRunResult } from './restricted-source-runner';
4
- import { SourceCodeLimits } from './source-code-limits';
5
- import { SourceCodeTelemetry } from './source-code-telemetry';
6
- import { SourceEvidenceVerifier } from './source-evidence-verifier';
7
- import type { SourceProviderAdapter } from './source-provider-adapter';
8
- import { SourceWorkspaceManager } from './source-workspace-manager';
9
- /** Supplies one complete source-analysis request and its trusted dependencies. */
10
- export interface SourceCodeAnalyzeInput {
11
- /** Identifies the application making the request. */
12
- appId: string;
13
- /** Identifies the connected source integration. */
14
- integrationId: string;
15
- /** Supplies the user question and optional source hints. */
16
- request: AnalyzeCodeRequest;
17
- /** Configures source analysis for the connected integration. */
18
- options: AiAgentSourceCodeIntegrationOptions;
19
- /** Supplies integration-scoped supplemental instructions. */
20
- connectedIntegrationInstructions?: string;
21
- /** Supplies the exact application-owned model credential to the outer proxy. */
22
- analyzerApiKey: string;
23
- /** Supplies repository authorization and provider reads. */
24
- adapter: SourceProviderAdapter;
25
- /** Publishes observable analyzer activity to the calling AI session. */
26
- publishStatus?: (update: CliAgentStatusUpdate) => void;
27
- }
28
- /** Represents the restricted runner boundary used by orchestration tests. */
29
- export interface RestrictedSourceRunnerLike {
30
- /** Executes one credential-isolated analyzer request. */
31
- run(request: RestrictedSourceRunRequest): Promise<RestrictedSourceRunResult>;
32
- }
33
- /** Configures testable source-analysis orchestration boundaries. */
34
- export interface SourceCodeAnalyzerOptions {
35
- /** Overrides trusted workspace preparation. */
36
- workspaceManager?: SourceWorkspaceManager;
37
- /** Overrides the isolated CLI runner. */
38
- restrictedRunner?: RestrictedSourceRunnerLike;
39
- /** Overrides strict Git provenance verification. */
40
- evidenceVerifier?: SourceEvidenceVerifier;
41
- /** Records bounded internal telemetry. */
42
- telemetry?: SourceCodeTelemetry;
43
- /** Overrides source-analysis limits. */
44
- limits?: SourceCodeLimits;
45
- }
46
- /** Coordinates trusted preparation, the isolated CLI, provenance validation, and telemetry. */
47
- export declare class SourceCodeAnalyzer {
48
- private readonly evidenceVerifier;
49
- private readonly limits;
50
- private readonly restrictedRunner;
51
- private readonly telemetry;
52
- private readonly workspaceManager;
53
- /** Creates production orchestration unless explicit test boundaries are supplied. */
54
- constructor(options?: SourceCodeAnalyzerOptions);
55
- /** Runs one source-code analysis and returns only provenance-validated evidence. */
56
- analyze(input: SourceCodeAnalyzeInput): Promise<AnalyzeCodeResult>;
57
- private recordTelemetry;
58
- }
@@ -1,13 +0,0 @@
1
- /** Lists stable source-analysis error categories exposed to applications. */
2
- export declare const SOURCE_CODE_ERROR_CODES: readonly ["SOURCE_CONFIGURATION_INVALID", "SOURCE_AUTHENTICATION_FAILED", "SOURCE_REPOSITORY_UNAVAILABLE", "SOURCE_WORKSPACE_BUSY", "SOURCE_RESOURCE_LIMIT", "SOURCE_SANDBOX_UNAVAILABLE", "SOURCE_ANALYZER_TIMEOUT", "SOURCE_ANALYZER_FAILED", "SOURCE_EVIDENCE_UNVERIFIED"];
3
- /** Identifies a stable source-analysis error category. */
4
- export type SourceCodeErrorCode = (typeof SOURCE_CODE_ERROR_CODES)[number];
5
- /** Carries a safe source-analysis category without provider or repository details. */
6
- export declare class SourceCodeError extends Error {
7
- readonly code: SourceCodeErrorCode;
8
- readonly name = "SourceCodeError";
9
- /** Creates a safe source-analysis error. */
10
- constructor(code: SourceCodeErrorCode);
11
- }
12
- /** Converts internal failures to the stable source-analysis error surface. */
13
- export declare function toSourceCodeError(error: unknown): SourceCodeError;
@@ -1,23 +0,0 @@
1
- /** Configures source-code preparation, analysis, and storage ceilings. */
2
- export interface SourceCodeLimits {
3
- /** Bounds repositories exposed to one analyzer run. */
4
- maxRepositories: number;
5
- /** Bounds persistent or disposable workspace bytes. */
6
- maxWorkspaceBytes: number;
7
- /** Bounds inodes in the quota-backed analyzer filesystem. */
8
- maxRunInodes: number;
9
- /** Bounds raw analyzer stdout bytes. */
10
- maxStdoutBytes: number;
11
- /** Bounds combined analyzer output bytes. */
12
- maxOutputBytes: number;
13
- /** Bounds trusted Git preparation wall-clock duration. */
14
- preparationTimeoutMs: number;
15
- /** Bounds analyzer wall-clock duration. */
16
- analyzerTimeoutMs: number;
17
- /** Bounds cached snapshot age during transient provider failures. */
18
- maxStaleAgeMs: number;
19
- }
20
- /** Supplies the production source-code limits. */
21
- export declare const DEFAULT_SOURCE_CODE_LIMITS: Readonly<SourceCodeLimits>;
22
- /** Resolves and validates deployment source-code limits. */
23
- export declare function resolveSourceCodeLimits(environment?: Readonly<Record<string, string | undefined>>): SourceCodeLimits;
@@ -1,31 +0,0 @@
1
- import type { SourceCodeAnalyzerModel, SourceControlProvider } from '@squidcloud/client';
2
- /** Lists bounded source-analysis outcomes. */
3
- export type SourceCodeOutcome = 'success' | 'stale-success' | 'persistence-warning' | 'configuration' | 'authentication' | 'repository-unavailable' | 'workspace-busy' | 'resource-limit' | 'sandbox-unavailable' | 'analyzer-timeout' | 'analyzer-failed' | 'evidence-unverified';
4
- /** Contains source-analysis metrics without repository or question content. */
5
- export interface SourceCodeTelemetryEvent {
6
- /** Identifies the source-control provider. */
7
- provider: SourceControlProvider;
8
- /** Identifies the isolated CLI analyzer. */
9
- analyzerModel: SourceCodeAnalyzerModel;
10
- /** Categorizes the bounded analysis result. */
11
- outcome: SourceCodeOutcome;
12
- /** Counts repositories exposed to the analyzer. */
13
- repositoryCount: number;
14
- /** Describes whether trusted caches were created or reused. */
15
- cacheState: 'first-clone' | 'reused' | 'mixed';
16
- /** Marks whether any analyzed snapshot was stale. */
17
- stale: boolean;
18
- /** Measures total analysis wall-clock duration. */
19
- analysisDurationMs: number;
20
- /** Measures trusted workspace bytes after preparation. */
21
- workspaceBytes: number;
22
- /** Counts model input tokens when reported by the CLI. */
23
- inputTokens: number;
24
- /** Counts model output tokens when reported by the CLI. */
25
- outputTokens: number;
26
- }
27
- /** Records bounded source-analysis telemetry. */
28
- export interface SourceCodeTelemetry {
29
- /** Records one completed source-analysis attempt. */
30
- record(event: SourceCodeTelemetryEvent): void;
31
- }
@@ -1,2 +0,0 @@
1
- /** Returns true only when local Windows explicitly opts into host-level analyzer access. */
2
- export declare function isLocalWindowsSourceRuntime(): boolean;
@@ -1,123 +0,0 @@
1
- import { SourceCodeAnalyzerModel } from '@squidcloud/client';
2
- import { IncomingHttpHeaders } from 'node:http';
3
- import { Readable, Writable } from 'node:stream';
4
- interface SourceModelAuthProxyDependencies {
5
- lookup(host: string, signal: AbortSignal): Promise<Array<{
6
- address: string;
7
- family: number;
8
- }>>;
9
- send(input: UpstreamRequest): Promise<UpstreamResponse>;
10
- }
11
- /** Describes one fixed model API route selected by trusted configuration. */
12
- export interface SourceModelProxyRoute {
13
- /** Selects the fixed upstream model host. */
14
- host: string;
15
- /** Selects the fixed upstream HTTP method. */
16
- method: 'HEAD' | 'POST';
17
- /** Selects the fixed upstream path and query. */
18
- path: string;
19
- }
20
- /** Configures the trusted reverse proxy for one selected analyzer model. */
21
- export interface SourceModelAuthProxyOptions {
22
- /** Selects the model-specific route allowlist. */
23
- analyzerModel: SourceCodeAnalyzerModel;
24
- /** Supplies the real credential retained outside the jail. */
25
- apiKey: string;
26
- }
27
- /** Defines aggregate ceilings shared by every model request in one source run. */
28
- export interface SourceModelProxyBudgetLimits {
29
- /** Bounds all provider output tokens reported or reserved by the run. */
30
- maxCumulativeOutputTokens: number;
31
- /** Bounds all primary request bytes accepted by the proxy. */
32
- maxCumulativeRequestBytes: number;
33
- /** Bounds all upstream response body bytes accepted by the proxy. */
34
- maxCumulativeResponseBytes: number;
35
- /** Bounds the output-token parameter on one primary request. */
36
- maxOutputTokensPerRequest: number;
37
- /** Bounds all allowed model endpoint operations. */
38
- maxRequests: number;
39
- }
40
- interface PreparedSourceModelProxyRequest {
41
- body: Buffer;
42
- reservation: SourceModelProxyTokenReservation;
43
- }
44
- declare class SourceModelProxyTokenReservation {
45
- readonly maximumOutputTokens: number;
46
- settled: boolean;
47
- constructor(maximumOutputTokens: number);
48
- }
49
- /** Accounts for aggregate model operations and binds one immutable provider wire model per run. */
50
- export declare class SourceModelProxyRunBudget {
51
- private boundWireModel;
52
- private consumedOutputTokens;
53
- private requestBytes;
54
- private requestCount;
55
- private reservedOutputTokens;
56
- private responseBytes;
57
- private readonly limits;
58
- /** Creates a budget with production ceilings unless trusted overrides are supplied. */
59
- constructor(overrides?: Partial<SourceModelProxyBudgetLimits>);
60
- /** Consumes one endpoint operation from the run-wide request budget. */
61
- beginRequest(): void;
62
- /** Consumes accepted primary request bytes from the run-wide byte budget. */
63
- recordRequestBytes(bytes: number): void;
64
- /** Consumes upstream response bytes from the run-wide byte budget. */
65
- recordResponseBytes(bytes: number): void;
66
- /**
67
- * Validates one primary request, binds the first valid CLI wire model, and reserves its bounded
68
- * output allowance. The primary CLI reaches this request before repository content can direct a
69
- * later tool call, and JavaScript performs the binding and comparison as one synchronous action.
70
- */
71
- preparePrimaryRequest(analyzerModel: SourceCodeAnalyzerModel, rawBody: Buffer): PreparedSourceModelProxyRequest;
72
- /** Replaces a request's reservation with trusted provider-reported output usage. */
73
- completePrimaryRequest(reservation: SourceModelProxyTokenReservation, reportedOutputTokens: number | undefined): void;
74
- }
75
- /** Owns the real model key and forwards only version-tested model API calls. */
76
- export declare class SourceModelAuthProxy {
77
- private readonly options;
78
- private readonly dependencies;
79
- private activeRequests;
80
- private readonly budget;
81
- private closePromise;
82
- private closing;
83
- private lifecycleController;
84
- private readonly pendingHandlers;
85
- private server;
86
- private readonly socketAdmission;
87
- private socketPath;
88
- /** Creates a proxy for exactly one model provider and credential. */
89
- constructor(options: SourceModelAuthProxyOptions, dependencies?: SourceModelAuthProxyDependencies);
90
- /** Starts the proxy on a private Unix socket. */
91
- start(socketPath: string): Promise<void>;
92
- /** Stops the proxy and removes its private socket. */
93
- close(): Promise<void>;
94
- private closeInternal;
95
- private handleRequest;
96
- }
97
- /** Resolves one allowed loopback request to its fixed upstream model route. */
98
- export declare function resolveSourceModelProxyRoute(analyzerModel: SourceCodeAnalyzerModel, method: string | undefined, requestUrl: string | undefined, headers: IncomingHttpHeaders): SourceModelProxyRoute;
99
- /** Streams a proxy body while enforcing its byte ceiling. */
100
- export declare function pipeSourceModelProxyBody(source: Readable, destination: Writable, maxBytes: number, limitError: string, signal?: AbortSignal, observeChunk?: (chunk: Buffer) => void): Promise<number>;
101
- /** Extracts the greatest cumulative output-token usage reported by one provider response. */
102
- export declare function extractSourceModelProxyOutputTokens(analyzerModel: SourceCodeAnalyzerModel, body: Buffer): number | undefined;
103
- interface UpstreamRequest {
104
- address: string;
105
- apiKey: string;
106
- body: Readable;
107
- family: number;
108
- headers: IncomingHttpHeaders;
109
- host: string;
110
- method: 'HEAD' | 'POST';
111
- model: SourceCodeAnalyzerModel;
112
- path: string;
113
- signal: AbortSignal;
114
- }
115
- interface UpstreamResponse {
116
- statusCode: number;
117
- headers: IncomingHttpHeaders;
118
- body: Readable;
119
- requestCompleted: Promise<number>;
120
- }
121
- /** Returns true only for addresses safe to use as fixed public model-provider destinations. */
122
- export declare function isPublicAddress(address: string): boolean;
123
- export {};
@@ -1,110 +0,0 @@
1
- import type { AnalyzeCodeResult } from '@squidcloud/client';
2
- import { SourceGitCommand } from './source-git-command';
3
- import type { PreparedSourceWorkspace } from './source-workspace-manager';
4
- /**
5
- * Constrains source analyzers to the evidence envelope accepted by the verifier. The
6
- * `parseAnalyzerOutput` implementation below remains authoritative for validation.
7
- */
8
- export declare const SOURCE_ANALYZER_OUTPUT_JSON_SCHEMA: {
9
- readonly additionalProperties: false;
10
- readonly properties: {
11
- readonly answer: {
12
- readonly type: "string";
13
- };
14
- readonly repositories: {
15
- readonly items: {
16
- readonly additionalProperties: false;
17
- readonly properties: {
18
- readonly commitSha: {
19
- readonly pattern: "^[a-f0-9]{40}$";
20
- readonly type: "string";
21
- };
22
- readonly paths: {
23
- readonly items: {
24
- readonly additionalProperties: false;
25
- readonly properties: {
26
- readonly lines: {
27
- readonly additionalProperties: false;
28
- readonly properties: {
29
- readonly end: {
30
- readonly minimum: 1;
31
- readonly type: "integer";
32
- };
33
- readonly start: {
34
- readonly minimum: 1;
35
- readonly type: "integer";
36
- };
37
- };
38
- readonly required: readonly ["end", "start"];
39
- readonly type: "object";
40
- };
41
- readonly path: {
42
- readonly type: "string";
43
- };
44
- };
45
- readonly required: readonly ["path"];
46
- readonly type: "object";
47
- };
48
- readonly minItems: 1;
49
- readonly type: "array";
50
- };
51
- readonly ref: {
52
- readonly additionalProperties: false;
53
- readonly properties: {
54
- readonly name: {
55
- readonly type: "string";
56
- };
57
- readonly type: {
58
- readonly enum: readonly ["branch", "tag", "commit"];
59
- readonly type: "string";
60
- };
61
- };
62
- readonly required: readonly ["name", "type"];
63
- readonly type: "object";
64
- };
65
- readonly repository: {
66
- readonly type: "string";
67
- };
68
- };
69
- readonly required: readonly ["commitSha", "paths", "ref", "repository"];
70
- readonly type: "object";
71
- };
72
- readonly type: "array";
73
- };
74
- readonly warnings: {
75
- readonly items: {
76
- readonly type: "string";
77
- };
78
- readonly type: "array";
79
- };
80
- };
81
- readonly required: readonly ["answer", "repositories", "warnings"];
82
- readonly type: "object";
83
- };
84
- /** Supplies trusted state and one bounded analyzer response for verification. */
85
- export interface VerifySourceEvidenceInput {
86
- /** Contains exactly one analyzer JSON object. */
87
- analyzerResponse: string;
88
- /** Supplies pre-run refs and trusted bare repositories. */
89
- preparedWorkspace: PreparedSourceWorkspace;
90
- }
91
- /** Configures the local Git boundary used for provenance validation. */
92
- export interface SourceEvidenceVerifierOptions {
93
- /** Overrides hardened Git execution. */
94
- gitCommand?: SourceGitCommand;
95
- }
96
- /** Strictly parses analyzer output and retains only evidence proven by trusted Git objects. */
97
- export declare class SourceEvidenceVerifier {
98
- private readonly git;
99
- /** Creates a verifier with ambient Git configuration disabled. */
100
- constructor(options?: SourceEvidenceVerifierOptions);
101
- /** Returns structured provenance only when at least one regular trusted blob is valid. */
102
- verify(input: VerifySourceEvidenceInput): Promise<AnalyzeCodeResult>;
103
- private verifyRepository;
104
- private verifySubmodule;
105
- private verifyPreparedSource;
106
- private assertCommitExists;
107
- private verifyRef;
108
- private verifyPath;
109
- private readBlob;
110
- }
@@ -1,6 +0,0 @@
1
- /** Authority accepted by the loopback source-model proxy. */
2
- export declare const SOURCE_MODEL_PROXY_AUTHORITY = "127.0.0.1:18080";
3
- /** Base URL used by restricted analyzers to reach the source-model proxy. */
4
- export declare const SOURCE_MODEL_PROXY_BASE_URL = "http://127.0.0.1:18080";
5
- /** OpenAI-compatible base URL exposed by the source-model proxy. */
6
- export declare const SOURCE_MODEL_PROXY_OPENAI_BASE_URL = "http://127.0.0.1:18080/v1";
@@ -1,111 +0,0 @@
1
- import { SourceControlProvider } from '@squidcloud/client';
2
- /** Identifies the deterministic provider-shim protocol. */
3
- export declare const SOURCE_PROVIDER_BROKER_PROTOCOL_VERSION: 1;
4
- /** Describes the closed provider-operation subset exposed to source analyzers. */
5
- export type SourceProviderOperation = {
6
- operation: 'repo-view';
7
- repository: string;
8
- } | {
9
- operation: 'pr-view';
10
- repository: string;
11
- pullRequestNumber: number;
12
- } | {
13
- operation: 'pr-list';
14
- repository: string;
15
- state: 'open' | 'closed' | 'all';
16
- limit: number;
17
- };
18
- /** Executes provider reads after the broker validates protocol, authorization, and budgets. */
19
- export interface SourceProviderReadAdapter {
20
- /** Identifies the adapter's source-control provider. */
21
- readonly provider: SourceControlProvider;
22
- /** Executes one already-authorized typed read. */
23
- executeReadOperation(operation: SourceProviderOperation, signal: AbortSignal): Promise<unknown>;
24
- /** Releases adapter child processes and credentials. */
25
- close(): Promise<void>;
26
- }
27
- /** Bounds all provider use during one analyzer run. */
28
- export interface SourceProviderBrokerBudgets {
29
- /** Bounds the number of operations in one run. */
30
- maxOperations: number;
31
- /** Bounds encoded response bytes across the run. */
32
- maxCumulativeResponseBytes: number;
33
- /** Bounds simultaneous provider operations. */
34
- maxConcurrentRequests: number;
35
- /** Bounds total broker lifetime. */
36
- maxElapsedMs: number;
37
- /** Bounds estimated provider rate-limit consumption. */
38
- maxProviderRateUnits: number;
39
- /** Bounds one encoded response frame. */
40
- maxResponseBytes: number;
41
- /** Bounds one provider operation. */
42
- requestDeadlineMs: number;
43
- }
44
- /** Configures one provider-neutral operation broker. */
45
- export interface SourceProviderOperationBrokerOptions {
46
- /** Supplies the credential-owning provider adapter. */
47
- adapter: SourceProviderReadAdapter;
48
- /** Lists the case-folded repository identities available to the run. */
49
- allowedRepositories: readonly string[];
50
- /** Overrides per-run broker budgets. */
51
- budgets?: Partial<SourceProviderBrokerBudgets>;
52
- }
53
- /** Validates and budgets provider reads over a strict framed Unix-socket protocol. */
54
- export declare class SourceProviderOperationBroker {
55
- private readonly options;
56
- private readonly allowedRepositories;
57
- private readonly activeControllers;
58
- private readonly budgets;
59
- private readonly inFlightHandlers;
60
- private readonly socketAdmission;
61
- private readonly startedAt;
62
- private activeRequests;
63
- private closing;
64
- private cumulativeResponseBytes;
65
- private operationCount;
66
- private providerRateUnits;
67
- private server;
68
- private socketPath;
69
- /** Creates a broker for one provider adapter and repository allowlist. */
70
- constructor(options: SourceProviderOperationBrokerOptions);
71
- /** Starts the versioned framed protocol on a private Unix socket. */
72
- start(socketPath: string): Promise<void>;
73
- /** Stops accepting operations, closes connections, and drains the provider adapter. */
74
- close(): Promise<void>;
75
- /** Executes one already-decoded operation through the same authorization and budget boundary. */
76
- execute(operation: SourceProviderOperation): Promise<unknown>;
77
- private acceptSocket;
78
- private handleFrame;
79
- private writeErrorAndClose;
80
- private validateOperation;
81
- private reserveOperation;
82
- private remainingElapsedMillis;
83
- }
84
- /** Executes GitHub reads with a short-lived credential and fixed host gh arguments. */
85
- export declare class GitHubCliReadAdapter implements SourceProviderReadAdapter {
86
- private readonly options;
87
- readonly provider = "github";
88
- private readonly activeChildren;
89
- private closing;
90
- /** Creates the GitHub adapter around an absolute, version-pinned gh executable. */
91
- constructor(options: {
92
- executable: string;
93
- credentialProvider(): Promise<string>;
94
- commandTimeoutMs?: number;
95
- });
96
- /** Executes one fixed GitHub read and returns parsed JSON. */
97
- executeReadOperation(operation: SourceProviderOperation, signal: AbortSignal): Promise<unknown>;
98
- /** Terminates active gh children and waits for their complete stream closure. */
99
- close(): Promise<void>;
100
- private run;
101
- }
102
- /** Provides an immediate typed failure while cached analysis has no live provider authorization. */
103
- export declare class UnavailableSourceProviderReadAdapter implements SourceProviderReadAdapter {
104
- readonly provider: SourceControlProvider;
105
- /** Creates an unavailable adapter for one provider. */
106
- constructor(provider: SourceControlProvider);
107
- /** Rejects immediately without opening a child process. */
108
- executeReadOperation(_operation: SourceProviderOperation, _signal: AbortSignal): Promise<never>;
109
- /** Completes without external resources. */
110
- close(): Promise<void>;
111
- }
@@ -1,15 +0,0 @@
1
- /** Captures trusted references before the analyzer can mutate its disposable copy. */
2
- export interface SourceRepositorySnapshot {
3
- /** Points to the trusted bare repository outside the analyzer mount. */
4
- trustedRepositoryDirectory: string;
5
- /** Maps canonical remote-branch and tag refs to commit SHAs. */
6
- refs: ReadonlyMap<string, string>;
7
- /** Stores the selected canonical default ref. */
8
- defaultRef: string;
9
- /** Stores the selected immutable commit SHA. */
10
- defaultCommitSha: string;
11
- /** Stores the last successful fetch time. */
12
- fetchedAt: string;
13
- /** Marks a transiently stale snapshot. */
14
- stale: boolean;
15
- }
@@ -1,17 +0,0 @@
1
- import { Socket } from 'node:net';
2
- /** Counts accepted sockets immediately and expires incomplete protocols on a fixed deadline. */
3
- export declare class SourceSocketAdmission {
4
- private readonly maxAcceptedConnections;
5
- private readonly protocolDeadlineMs;
6
- private readonly protocolTimers;
7
- private readonly sockets;
8
- /** Creates an admission boundary with positive connection and protocol-start limits. */
9
- constructor(maxAcceptedConnections: number, protocolDeadlineMs: number);
10
- /** Accepts a socket when capacity remains, otherwise destroys it immediately. */
11
- accept(socket: Socket): boolean;
12
- /** Clears the absolute protocol-start deadline while retaining the accepted connection slot. */
13
- markProtocolReady(socket: Socket): void;
14
- /** Destroys all admitted sockets and clears their timers. */
15
- destroyAll(): void;
16
- private release;
17
- }
@@ -1,10 +0,0 @@
1
- import type { SourceControlProvider, SourceRepository } from '@squidcloud/client';
2
- /** Identifies the provider repository addressed by a normalized submodule URL. */
3
- export interface SourceSubmoduleRepositoryIdentity {
4
- /** Contains the case-insensitive provider repository name. */
5
- fullName: string;
6
- /** Selects the source-control provider owning the repository. */
7
- provider: SourceControlProvider;
8
- }
9
- /** Resolves a supported absolute or safe relative submodule URL to provider repository identity. */
10
- export declare function normalizeSourceSubmoduleUrl(value: string, parentRepository: Pick<SourceRepository, 'fullName' | 'provider'>): SourceSubmoduleRepositoryIdentity | undefined;