@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.
- package/dist/backend/src/internal/source-code.d.ts +0 -2
- package/dist/backend/src/source-code/index.d.ts +1 -17
- package/dist/backend/src/source-code/source-provider-adapter.d.ts +9 -2
- package/dist/backend/src/source-code/trusted-executable.d.ts +3 -0
- package/dist/backend/src/workspace-client.d.ts +4 -3
- package/dist/cjs/index.js +1 -1
- package/dist/cjs/internal/source-code.js +1 -1
- package/dist/esm/index.js +1 -1
- package/dist/esm/internal/source-code.js +1 -1
- package/dist/internal-common/src/public-types-backend/ai-agent.public-context.d.ts +22 -0
- package/package.json +2 -2
- package/dist/backend/src/cli-agent/claude-code.adapter.d.ts +0 -79
- package/dist/backend/src/cli-agent/cli-agent-adapter.types.d.ts +0 -134
- package/dist/backend/src/cli-agent/cli-agent-process-launcher.d.ts +0 -22
- package/dist/backend/src/cli-agent/cli-agent-process-runner.d.ts +0 -35
- package/dist/backend/src/cli-agent/cli-agent-root-status.d.ts +0 -25
- package/dist/backend/src/cli-agent/cli-agent-status.utils.d.ts +0 -9
- package/dist/backend/src/cli-agent/cli-output-stream.utils.d.ts +0 -1
- package/dist/backend/src/cli-agent/codex.adapter.d.ts +0 -82
- package/dist/backend/src/cli-agent/index.d.ts +0 -10
- package/dist/backend/src/cli-agent/nsjail-source-process-launcher.d.ts +0 -43
- package/dist/backend/src/cli-agent/workspace.utils.d.ts +0 -20
- package/dist/backend/src/source-code/local-source-development-runner.d.ts +0 -10
- package/dist/backend/src/source-code/restricted-source-runner.d.ts +0 -87
- package/dist/backend/src/source-code/source-code-analyzer.d.ts +0 -58
- package/dist/backend/src/source-code/source-code-errors.d.ts +0 -13
- package/dist/backend/src/source-code/source-code-limits.d.ts +0 -23
- package/dist/backend/src/source-code/source-code-telemetry.d.ts +0 -31
- package/dist/backend/src/source-code/source-development-runtime.d.ts +0 -2
- package/dist/backend/src/source-code/source-egress-proxy.d.ts +0 -123
- package/dist/backend/src/source-code/source-evidence-verifier.d.ts +0 -110
- package/dist/backend/src/source-code/source-model-proxy.constants.d.ts +0 -6
- package/dist/backend/src/source-code/source-provider-operation-broker.d.ts +0 -111
- package/dist/backend/src/source-code/source-repository-snapshot.d.ts +0 -15
- package/dist/backend/src/source-code/source-socket-admission.d.ts +0 -17
- package/dist/backend/src/source-code/source-submodule-url.d.ts +0 -10
- package/dist/backend/src/source-code/source-workspace-manager.d.ts +0 -162
- package/dist/backend/src/source-code/source-workspace-manifest.d.ts +0 -43
- package/dist/backend/src/source-code/windows-local-cli-process-launcher.d.ts +0 -13
|
@@ -1,162 +0,0 @@
|
|
|
1
|
-
import type { SourceCodeRef, SourceRepository } from '@squidcloud/client';
|
|
2
|
-
import { WorkspaceMetadata } from '../workspace-client';
|
|
3
|
-
import { SourceCodeLimits } from './source-code-limits';
|
|
4
|
-
import { SourceGitCommand } from './source-git-command';
|
|
5
|
-
import { SourceGitCredentialHelper } from './source-git-credential-helper';
|
|
6
|
-
import type { SourceProviderAdapter, SourceProviderFailureClassification, TrustedGitTlsProvider } from './source-provider-adapter';
|
|
7
|
-
import type { SourceRepositorySnapshot } from './source-repository-snapshot';
|
|
8
|
-
/** Represents the shared workspace operations consumed by source orchestration. */
|
|
9
|
-
export interface SourceWorkspaceClient {
|
|
10
|
-
/** Pulls the latest shared cache to this pod. */
|
|
11
|
-
create(id: string, options?: {
|
|
12
|
-
signal?: AbortSignal;
|
|
13
|
-
}): Promise<WorkspaceMetadata>;
|
|
14
|
-
/** Publishes the refreshed trusted cache for the next run on any replica. */
|
|
15
|
-
push(id: string): Promise<WorkspaceMetadata>;
|
|
16
|
-
/** Removes a pod-local copy that must not be reused. */
|
|
17
|
-
discardLocal(id: string): Promise<void>;
|
|
18
|
-
}
|
|
19
|
-
/** Contains one repository prepared for an isolated analyzer. */
|
|
20
|
-
export interface PreparedSourceRepository {
|
|
21
|
-
/** Stores canonical provider repository metadata. */
|
|
22
|
-
repository: SourceRepository;
|
|
23
|
-
/** Points to the disposable repository inside the analyzer root. */
|
|
24
|
-
analyzerDirectory: string;
|
|
25
|
-
/** Identifies the repository directory relative to the analyzer root. */
|
|
26
|
-
workspacePath: string;
|
|
27
|
-
/** Stores the selected canonical reference. */
|
|
28
|
-
defaultRef: string;
|
|
29
|
-
/** Stores the selected cached commit when available. */
|
|
30
|
-
cachedCommitSha?: string;
|
|
31
|
-
/** Stores the latest successful fetch time. */
|
|
32
|
-
fetchedAt?: string;
|
|
33
|
-
/** Marks a snapshot retained after a transient provider failure. */
|
|
34
|
-
stale: boolean;
|
|
35
|
-
/** Captures immutable trusted refs before the analyzer starts. */
|
|
36
|
-
snapshot: SourceRepositorySnapshot;
|
|
37
|
-
}
|
|
38
|
-
/** Contains one allowlisted submodule materialized at its exact gitlink commit. */
|
|
39
|
-
export interface PreparedSourceSubmodule {
|
|
40
|
-
/** Stores canonical provider repository metadata. */
|
|
41
|
-
repository: SourceRepository;
|
|
42
|
-
/** Points to the disposable submodule inside the analyzer root. */
|
|
43
|
-
analyzerDirectory: string;
|
|
44
|
-
/** Identifies the immediate repository containing the gitlink. */
|
|
45
|
-
parentRepository: string;
|
|
46
|
-
/** Identifies the gitlink path relative to its immediate parent repository. */
|
|
47
|
-
submodulePath: string;
|
|
48
|
-
/** Identifies the submodule directory relative to the analyzer root. */
|
|
49
|
-
workspacePath: string;
|
|
50
|
-
/** Stores the exact commit selected by the parent gitlink. */
|
|
51
|
-
commitSha: string;
|
|
52
|
-
/** Exposes the exact commit reference required for analyzer evidence. */
|
|
53
|
-
ref: SourceCodeRef;
|
|
54
|
-
/** Marks a snapshot retained after a transient provider failure. */
|
|
55
|
-
stale: boolean;
|
|
56
|
-
/** Captures immutable trusted refs used to prove the gitlink commit. */
|
|
57
|
-
snapshot: SourceRepositorySnapshot;
|
|
58
|
-
}
|
|
59
|
-
/** Contains disposable repositories and trusted verification state for one run. */
|
|
60
|
-
export interface PreparedSourceWorkspace {
|
|
61
|
-
/** Points to the only source tree mounted into the analyzer sandbox. */
|
|
62
|
-
analyzerRootDirectory: string;
|
|
63
|
-
/** Points to the persistent trusted root used only by the verifier. */
|
|
64
|
-
trustedWorkspaceRootDirectory: string;
|
|
65
|
-
/** Lists prepared allowlisted repositories. */
|
|
66
|
-
repositories: readonly PreparedSourceRepository[];
|
|
67
|
-
/** Lists allowlisted submodules materialized below the selected repositories. */
|
|
68
|
-
submodules: readonly PreparedSourceSubmodule[];
|
|
69
|
-
/** Lists bounded preparation warnings. */
|
|
70
|
-
warnings: readonly string[];
|
|
71
|
-
/** Describes whether trusted caches were created or reused. */
|
|
72
|
-
cacheState: 'first-clone' | 'reused' | 'mixed';
|
|
73
|
-
/** Measures trusted cache bytes after preparation. */
|
|
74
|
-
workspaceBytes: number;
|
|
75
|
-
}
|
|
76
|
-
/** Selects the integration and optional requested ref for one prepared run. */
|
|
77
|
-
export interface PrepareSourceWorkspaceInput {
|
|
78
|
-
/** Identifies the application using the cache. */
|
|
79
|
-
appId: string;
|
|
80
|
-
/** Identifies the connected source integration. */
|
|
81
|
-
integrationId: string;
|
|
82
|
-
/** Supplies provider authorization and canonical repository metadata. */
|
|
83
|
-
adapter: SourceProviderAdapter;
|
|
84
|
-
/** Narrows preparation to exact allowlisted repository names or unique slugs. */
|
|
85
|
-
repositoryHints?: string;
|
|
86
|
-
/** Requests one captured branch, tag, or advertised commit. */
|
|
87
|
-
requestedRef?: string;
|
|
88
|
-
/** Reports coarse preparation stages without exposing credentials or local paths. */
|
|
89
|
-
reportProgress?: (progress: SourceWorkspacePreparationProgress) => void;
|
|
90
|
-
}
|
|
91
|
-
/** Names one user-visible stage in trusted repository preparation. */
|
|
92
|
-
export type SourceWorkspacePreparationStage = 'checking-access' | 'syncing-repositories' | 'saving-cache' | 'creating-checkout';
|
|
93
|
-
/** Describes one coarse repository-preparation transition. */
|
|
94
|
-
export interface SourceWorkspacePreparationProgress {
|
|
95
|
-
/** Lists canonical selected repository names when they are available. */
|
|
96
|
-
repositories?: readonly string[];
|
|
97
|
-
/** Identifies the current preparation stage. */
|
|
98
|
-
stage: SourceWorkspacePreparationStage;
|
|
99
|
-
}
|
|
100
|
-
/** Contains a callback value and a nonfatal shared-persistence warning. */
|
|
101
|
-
export interface PreparedSourceWorkspaceResult<T> {
|
|
102
|
-
/** Stores the verified callback value. */
|
|
103
|
-
value: T;
|
|
104
|
-
/** Warns when the trusted cache could not be synchronized. */
|
|
105
|
-
persistenceWarning?: string;
|
|
106
|
-
}
|
|
107
|
-
/** Classifies preparation failures for stale-cache authorization. */
|
|
108
|
-
export type SourceFetchFailureClassification = SourceProviderFailureClassification;
|
|
109
|
-
/** Configures testable boundaries for source workspace orchestration. */
|
|
110
|
-
export interface SourceWorkspaceManagerOptions {
|
|
111
|
-
/** Overrides the shared workspace client. */
|
|
112
|
-
workspaceClient?: SourceWorkspaceClient;
|
|
113
|
-
/** Overrides trusted Git limits. */
|
|
114
|
-
limits?: SourceCodeLimits;
|
|
115
|
-
/** Selects the private parent for disposable repositories. */
|
|
116
|
-
runtimeRootDirectory?: string;
|
|
117
|
-
/** Overrides the hardened Git command boundary. */
|
|
118
|
-
gitCommand?: SourceGitCommand;
|
|
119
|
-
/** Overrides the ephemeral HTTPS credential helper. */
|
|
120
|
-
credentialHelper?: SourceGitCredentialHelper;
|
|
121
|
-
/** Overrides the cancellation-aware cache-promotion copy boundary. */
|
|
122
|
-
copyDirectory?: (sourceDirectory: string, destinationDirectory: string, signal: AbortSignal) => Promise<void>;
|
|
123
|
-
/** Supplies trusted Git TLS material. */
|
|
124
|
-
tlsProvider?: TrustedGitTlsProvider;
|
|
125
|
-
/** Maps a canonical URL to a test remote without changing stored provenance. */
|
|
126
|
-
remoteUrlResolver?: (repository: SourceRepository) => string;
|
|
127
|
-
/** Overrides typed fetch-failure classification in integration tests. */
|
|
128
|
-
classifyFetchFailure?: (error: unknown) => SourceFetchFailureClassification;
|
|
129
|
-
/** Supplies a deterministic clock. */
|
|
130
|
-
now?: () => Date;
|
|
131
|
-
}
|
|
132
|
-
/** Owns trusted cache reconciliation, disposable clones, leases, and persistence. */
|
|
133
|
-
export declare class SourceWorkspaceManager {
|
|
134
|
-
private readonly classifyFetchFailure;
|
|
135
|
-
private readonly credentialHelper;
|
|
136
|
-
private readonly copyDirectory;
|
|
137
|
-
private readonly git;
|
|
138
|
-
private readonly limits;
|
|
139
|
-
private readonly now;
|
|
140
|
-
private readonly remoteUrlResolver;
|
|
141
|
-
private readonly runtimeRootDirectory;
|
|
142
|
-
private readonly tlsProvider;
|
|
143
|
-
private readonly workspaceClient?;
|
|
144
|
-
/** Creates a production manager unless explicit test boundaries are supplied. */
|
|
145
|
-
constructor(options?: SourceWorkspaceManagerOptions);
|
|
146
|
-
/** Runs a callback over disposable repositories and persists only trusted cache state. */
|
|
147
|
-
withPreparedWorkspace<T>(input: PrepareSourceWorkspaceInput, run: (workspace: PreparedSourceWorkspace) => Promise<T>): Promise<PreparedSourceWorkspaceResult<T>>;
|
|
148
|
-
private prepareTrustedWorkspace;
|
|
149
|
-
private prepareRepositoryBatch;
|
|
150
|
-
private prepareAllowlistedSubmoduleDependencies;
|
|
151
|
-
private prepareRepositories;
|
|
152
|
-
private fetchRepository;
|
|
153
|
-
private prepareStaleRepositories;
|
|
154
|
-
private prepareStaleRepository;
|
|
155
|
-
private populateDisposableWorkspace;
|
|
156
|
-
private materializeAllowlistedSubmodules;
|
|
157
|
-
private materializeRepository;
|
|
158
|
-
private withTrustedGitEnvironment;
|
|
159
|
-
private runGit;
|
|
160
|
-
private createWorkspaceClientRun;
|
|
161
|
-
private discardLocalSafely;
|
|
162
|
-
}
|
|
@@ -1,43 +0,0 @@
|
|
|
1
|
-
import type { SourceControlProvider, SourceRepository } from '@squidcloud/client';
|
|
2
|
-
/** Names the trusted workspace manifest. */
|
|
3
|
-
export declare const SOURCE_WORKSPACE_MANIFEST_FILENAME = ".squid-source-workspace.json";
|
|
4
|
-
/** Identifies the current trusted workspace manifest schema. */
|
|
5
|
-
export declare const SOURCE_WORKSPACE_MANIFEST_VERSION: 2;
|
|
6
|
-
/** Records one trusted repository without source content or credentials. */
|
|
7
|
-
export interface SourceWorkspaceManifestRepository {
|
|
8
|
-
/** Stores the provider's immutable repository identifier. */
|
|
9
|
-
providerRepositoryId: string;
|
|
10
|
-
/** Stores the canonical owner/repository name. */
|
|
11
|
-
fullName: string;
|
|
12
|
-
/** Stores the canonical HTTPS clone URL used by trusted Git. */
|
|
13
|
-
cloneUrl: string;
|
|
14
|
-
/** Stores the last provider-verified default branch. */
|
|
15
|
-
defaultBranch: string;
|
|
16
|
-
/** Stores the canonical provider web URL. */
|
|
17
|
-
webUrl: string;
|
|
18
|
-
/** Stores the deterministic trusted-cache directory name. */
|
|
19
|
-
directory: string;
|
|
20
|
-
/** Stores the selected commit from the latest successful fetch. */
|
|
21
|
-
lastFetchedSha?: string;
|
|
22
|
-
/** Stores the latest successful fetch timestamp. */
|
|
23
|
-
fetchedAt?: string;
|
|
24
|
-
/** Marks a snapshot retained after a transient provider failure. */
|
|
25
|
-
stale: boolean;
|
|
26
|
-
}
|
|
27
|
-
/** Records trusted source-cache identity and freshness. */
|
|
28
|
-
export interface SourceWorkspaceManifest {
|
|
29
|
-
/** Identifies the manifest schema. */
|
|
30
|
-
version: typeof SOURCE_WORKSPACE_MANIFEST_VERSION;
|
|
31
|
-
/** Identifies the source-control provider. */
|
|
32
|
-
provider: SourceControlProvider;
|
|
33
|
-
/** Stores a one-way integration identity. */
|
|
34
|
-
integrationIdHash: string;
|
|
35
|
-
/** Lists trusted repository cache records. */
|
|
36
|
-
repositories: SourceWorkspaceManifestRepository[];
|
|
37
|
-
}
|
|
38
|
-
/** Derives a filesystem-safe repository directory with an immutable identity suffix. */
|
|
39
|
-
export declare function sourceRepositoryDirectory(repository: SourceRepository): string;
|
|
40
|
-
/** Hashes an integration identifier before it enters a shared source manifest. */
|
|
41
|
-
export declare function sourceIntegrationIdHash(integrationId: string): string;
|
|
42
|
-
/** Parses a trusted source manifest and rejects unknown or unsafe fields. */
|
|
43
|
-
export declare function parseSourceWorkspaceManifest(value: unknown, provider: SourceControlProvider, integrationId: string): SourceWorkspaceManifest;
|
|
@@ -1,13 +0,0 @@
|
|
|
1
|
-
import { ChildProcess } from 'node:child_process';
|
|
2
|
-
import type { CliAgentLaunchRequest, CliAgentProcessLauncher } from '../cli-agent/cli-agent-process-launcher';
|
|
3
|
-
/** Launches a local Windows analyzer without interpolating its arguments through a command shell. */
|
|
4
|
-
export declare class WindowsLocalCliProcessLauncher implements CliAgentProcessLauncher {
|
|
5
|
-
private readonly workingDirectory;
|
|
6
|
-
private readonly sensitiveFiles;
|
|
7
|
-
/** Creates a launcher fixed to one prepared source directory. */
|
|
8
|
-
constructor(workingDirectory: string, sensitiveFiles?: readonly string[]);
|
|
9
|
-
/** Launches a native executable or PowerShell shim with literal arguments. */
|
|
10
|
-
launch(request: CliAgentLaunchRequest): Promise<ChildProcess>;
|
|
11
|
-
}
|
|
12
|
-
/** Replaces inherited file permissions with full control for only the current Windows identity. */
|
|
13
|
-
export declare function restrictWindowsFileToCurrentUser(filePath: string): Promise<void>;
|