@hachej/boring-agent 0.1.111 → 0.2.1
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/LICENSE +1 -1
- package/README.md +262 -51
- package/dist/agents.d.ts +75 -0
- package/dist/agents.js +91 -0
- package/dist/approval.d.ts +71 -0
- package/dist/approval.js +126 -0
- package/dist/artifacts.d.ts +53 -0
- package/dist/artifacts.js +129 -0
- package/dist/ask-user.d.ts +40 -0
- package/dist/ask-user.js +134 -0
- package/dist/attachment.d.ts +5 -0
- package/dist/attachment.js +4 -0
- package/dist/browser-task.d.ts +32 -0
- package/dist/browser-task.js +119 -0
- package/dist/chat-transport.d.ts +80 -0
- package/dist/chat-transport.js +306 -0
- package/dist/contracts.d.ts +40 -0
- package/dist/contracts.js +1 -0
- package/dist/conversations.d.ts +136 -0
- package/dist/conversations.js +366 -0
- package/dist/definitions.d.ts +37 -0
- package/dist/definitions.js +99 -0
- package/dist/delivery-input.d.ts +35 -0
- package/dist/delivery-input.js +56 -0
- package/dist/delivery.d.ts +33 -0
- package/dist/delivery.js +154 -0
- package/dist/durable-wait.d.ts +23 -0
- package/dist/durable-wait.js +79 -0
- package/dist/file-convert.d.ts +46 -0
- package/dist/file-convert.js +159 -0
- package/dist/file-guard.d.ts +50 -0
- package/dist/file-guard.js +177 -0
- package/dist/file-types.d.ts +17 -0
- package/dist/file-types.js +95 -0
- package/dist/gateway-provider.d.ts +24 -0
- package/dist/gateway-provider.js +42 -0
- package/dist/git.d.ts +34 -0
- package/dist/git.js +79 -0
- package/dist/harness-pool.d.ts +38 -0
- package/dist/harness-pool.js +134 -0
- package/dist/index.d.ts +4 -0
- package/dist/index.js +1 -0
- package/dist/json-schema-tool.d.ts +25 -0
- package/dist/json-schema-tool.js +19 -0
- package/dist/memory/optchat-core.d.ts +118 -0
- package/dist/memory/optchat-core.js +317 -0
- package/dist/memory/optchat.d.ts +156 -0
- package/dist/memory/optchat.js +432 -0
- package/dist/mentions.d.ts +56 -0
- package/dist/mentions.js +140 -0
- package/dist/metering.d.ts +183 -0
- package/dist/metering.js +443 -0
- package/dist/model-gateway.d.ts +86 -0
- package/dist/model-gateway.js +241 -0
- package/dist/native-version.d.ts +9 -0
- package/dist/native-version.js +7 -0
- package/dist/native.d.ts +4 -0
- package/dist/native.js +1 -0
- package/dist/presentation.d.ts +17 -0
- package/dist/presentation.js +39 -0
- package/dist/projection-format.d.ts +68 -0
- package/dist/projection-format.js +118 -0
- package/dist/projection-window.d.ts +9 -0
- package/dist/projection-window.js +93 -0
- package/dist/projection.d.ts +22 -0
- package/dist/projection.js +153 -0
- package/dist/question-response.d.ts +20 -0
- package/dist/question-response.js +75 -0
- package/dist/questions.d.ts +74 -0
- package/dist/questions.js +199 -0
- package/dist/self-evolving.d.ts +55 -0
- package/dist/self-evolving.js +239 -0
- package/dist/skills.d.ts +15 -0
- package/dist/skills.js +51 -0
- package/dist/tool-evidence.d.ts +14 -0
- package/dist/tool-evidence.js +54 -0
- package/dist/validation.d.ts +38 -0
- package/dist/validation.js +68 -0
- package/dist/workspaces.d.ts +107 -0
- package/dist/workspaces.js +212 -0
- package/package.json +145 -150
- package/dist/DebugDrawer-JNA43SVR.js +0 -8
- package/dist/admin-DORVQfLn.d.ts +0 -340
- package/dist/chunk-2BGLZZ7T.js +0 -10
- package/dist/chunk-42D6KAQV.js +0 -2882
- package/dist/chunk-4XOW57KJ.js +0 -343
- package/dist/chunk-72KT6VWV.js +0 -1338
- package/dist/chunk-7XAOVFSN.js +0 -28
- package/dist/chunk-KJIEMSQP.js +0 -198
- package/dist/chunk-KN72XWP7.js +0 -394
- package/dist/chunk-N6THTH7P.js +0 -110
- package/dist/chunk-V3H5A3BR.js +0 -22501
- package/dist/chunk-YGRQ4Q5P.js +0 -20
- package/dist/chunk-YTUZFKB3.js +0 -78
- package/dist/core/index.d.ts +0 -28
- package/dist/core/index.js +0 -617
- package/dist/createHarness-DOLOHA62.js +0 -18
- package/dist/eval/index.d.ts +0 -247
- package/dist/eval/index.js +0 -541
- package/dist/file-search-BUgMSKZE.d.ts +0 -289
- package/dist/front/artifacts.d.ts +0 -34
- package/dist/front/artifacts.js +0 -21
- package/dist/front/index.d.ts +0 -1082
- package/dist/front/index.js +0 -12912
- package/dist/front/styles.css +0 -5380
- package/dist/harness-qHlMJhZo.d.ts +0 -276
- package/dist/middleware-CaAEXpi5.d.ts +0 -115
- package/dist/piChatEvent-DpE0lIb9.d.ts +0 -450
- package/dist/piChatSessionService-CBct-hmz.d.ts +0 -86
- package/dist/sandbox-BMhut3kh.d.ts +0 -317
- package/dist/server/agent-host/testing/compositionRouteProof.d.ts +0 -8
- package/dist/server/agent-host/testing/compositionRouteProof.js +0 -78
- package/dist/server/agent-host/testing/gatewayConformance.d.ts +0 -43
- package/dist/server/agent-host/testing/gatewayConformance.js +0 -605
- package/dist/server/index.d.ts +0 -2278
- package/dist/server/index.js +0 -274
- package/dist/server/pi-session-readability.d.ts +0 -12
- package/dist/server/pi-session-readability.js +0 -23
- package/dist/server/worker/index.d.ts +0 -68
- package/dist/server/worker/index.js +0 -377
- package/dist/share-entry-CxS6UJ_L.d.ts +0 -330
- package/dist/shared/index.d.ts +0 -2111
- package/dist/shared/index.js +0 -262
- package/dist/types-DcWoQMn8.d.ts +0 -1377
- package/docs/ACCESSIBILITY.md +0 -52
- package/docs/AGENT_GATEWAY_V0.md +0 -212
- package/docs/AGENT_PACKAGES.md +0 -90
- package/docs/API.md +0 -123
- package/docs/AUTHORING.md +0 -68
- package/docs/CSP.md +0 -41
- package/docs/ERROR_CODES.md +0 -229
- package/docs/KNOWN_LIMITATIONS.md +0 -100
- package/docs/MIGRATION.md +0 -50
- package/docs/PERFORMANCE.md +0 -68
- package/docs/PLUGINS.md +0 -138
- package/docs/README.md +0 -98
- package/docs/RISKS-MULTI-TAB.md +0 -46
- package/docs/SESSION_IDENTITY.md +0 -91
- package/docs/STYLING.md +0 -73
- package/docs/UI-SHADCN.md +0 -56
- package/docs/VERCEL_COSTS.md +0 -103
- package/docs/plans/archive/AGENT_EVAL_FRAMEWORK.md +0 -466
- package/docs/plans/archive/agent-package-spec.md +0 -1777
- package/docs/plans/archive/harness-followup-capabilities.md +0 -440
- package/docs/plans/archive/harness-tool-ui-capabilities.md +0 -144
- package/docs/plans/archive/pi-followup-history-projection.md +0 -229
- package/docs/plans/archive/pi-tools-migration.md +0 -1061
- package/docs/plans/archive/reviews/pi-followup-history-codex-review.md +0 -11
- package/docs/plans/archive/reviews/pi-followup-history-gpt-review.md +0 -64
- package/docs/plans/archive/reviews/pi-followup-history-opus-review.md +0 -43
- package/docs/plans/archive/reviews/pi-followup-history-xai-review.md +0 -43
- package/docs/plans/archive/vercel-base-snapshot-template-plan.md +0 -527
- package/docs/plans/archive/vercel-persistent-sandbox-adapter.md +0 -553
- package/docs/runtime-provisioning.md +0 -157
- package/docs/runtime.md +0 -296
- package/docs/tools.md +0 -102
|
@@ -1,330 +0,0 @@
|
|
|
1
|
-
import { C as CredentialConsumerBindingId, P as ProviderId, a as CredentialFieldId, b as ProviderRegistryV1, c as ProviderDefinitionV1, d as CredentialFieldDefinitionV1, A as AuthorizedWorkspaceCredentialScopeV1 } from './file-search-BUgMSKZE.js';
|
|
2
|
-
import { z } from 'zod';
|
|
3
|
-
import { A as AgentDefinitionErrorCode, p as AgentDeploymentErrorCode } from './piChatEvent-DpE0lIb9.js';
|
|
4
|
-
import { b as Workspace } from './sandbox-BMhut3kh.js';
|
|
5
|
-
|
|
6
|
-
type CredentialConsumerKindV1 = "model-provider" | "first-party-tool" | "plugin-server" | "mcp-server" | "tenant-custom-tool";
|
|
7
|
-
type CredentialDeliveryV1 = "host-only" | "sandbox-pipe" | "sandbox-tmpfs";
|
|
8
|
-
/** Immutable authority registered by the host beside the tool/provider catalog. */
|
|
9
|
-
interface CredentialConsumerBindingV1 {
|
|
10
|
-
readonly contractVersion: "boring.credential-consumer-binding.v1";
|
|
11
|
-
readonly id: CredentialConsumerBindingId;
|
|
12
|
-
readonly providerId: ProviderId;
|
|
13
|
-
readonly consumer: Readonly<{
|
|
14
|
-
id: string;
|
|
15
|
-
kind: CredentialConsumerKindV1;
|
|
16
|
-
trust: "trusted" | "untrusted";
|
|
17
|
-
}>;
|
|
18
|
-
readonly purpose: string;
|
|
19
|
-
readonly allowedFieldIds: readonly CredentialFieldId[];
|
|
20
|
-
readonly delivery: CredentialDeliveryV1;
|
|
21
|
-
readonly sandbox?: Readonly<{
|
|
22
|
-
credentialChannel: "fd-3" | "tmpfs-v1";
|
|
23
|
-
egressOrigins: readonly `https://${string}`[];
|
|
24
|
-
}>;
|
|
25
|
-
}
|
|
26
|
-
interface CredentialConsumerBindingRegistryV1 {
|
|
27
|
-
readonly contractVersion: "boring.credential-consumer-bindings.v1";
|
|
28
|
-
require(bindingId: CredentialConsumerBindingId): CredentialConsumerBindingV1;
|
|
29
|
-
}
|
|
30
|
-
declare function providerCredentialFieldsV1(provider: ProviderDefinitionV1): readonly CredentialFieldDefinitionV1[];
|
|
31
|
-
declare function createCredentialConsumerBindingRegistryV1(bindings: readonly CredentialConsumerBindingV1[], providerRegistry: ProviderRegistryV1): CredentialConsumerBindingRegistryV1;
|
|
32
|
-
|
|
33
|
-
declare const PROVIDER_CREDENTIAL_REF_VERSION: "boring.provider-credential-ref.v1";
|
|
34
|
-
/** Constructed by a trusted factory from a registered binding. */
|
|
35
|
-
interface ProviderCredentialRefV1 {
|
|
36
|
-
readonly contractVersion: typeof PROVIDER_CREDENTIAL_REF_VERSION;
|
|
37
|
-
readonly providerId: ProviderId;
|
|
38
|
-
readonly executionId: string;
|
|
39
|
-
readonly bindingId: CredentialConsumerBindingId;
|
|
40
|
-
}
|
|
41
|
-
interface ProviderCredentialRefFactoryV1 {
|
|
42
|
-
readonly contractVersion: "boring.provider-credential-ref-factory.v1";
|
|
43
|
-
create(input: Readonly<{
|
|
44
|
-
providerId: ProviderId;
|
|
45
|
-
executionId: string;
|
|
46
|
-
bindingId: CredentialConsumerBindingId;
|
|
47
|
-
}>): ProviderCredentialRefV1;
|
|
48
|
-
}
|
|
49
|
-
declare function createProviderCredentialRefFactoryV1(bindingRegistry: CredentialConsumerBindingRegistryV1): ProviderCredentialRefFactoryV1;
|
|
50
|
-
|
|
51
|
-
type ResolvedCredentialMaterialV1 = Readonly<{
|
|
52
|
-
kind: "field-set";
|
|
53
|
-
fields: ReadonlyMap<CredentialFieldId, Uint8Array>;
|
|
54
|
-
}> | Readonly<{
|
|
55
|
-
kind: "external-managed-account";
|
|
56
|
-
custodianAdapterId: string;
|
|
57
|
-
opaqueAccountReference: Uint8Array;
|
|
58
|
-
}> | Readonly<{
|
|
59
|
-
kind: "none";
|
|
60
|
-
}>;
|
|
61
|
-
interface ResolvedCredentialLeaseV1 {
|
|
62
|
-
readonly contractVersion: "boring.resolved-credential.v1";
|
|
63
|
-
readonly workspaceId: string;
|
|
64
|
-
readonly providerId: ProviderId;
|
|
65
|
-
readonly credentialVersion: number;
|
|
66
|
-
readonly executionId: string;
|
|
67
|
-
/** Server implementation may use a Node byte array; shared stays Uint8Array. */
|
|
68
|
-
readonly material: ResolvedCredentialMaterialV1;
|
|
69
|
-
readonly expiresAt: string;
|
|
70
|
-
/** Idempotent best-effort overwrite and reference release. */
|
|
71
|
-
dispose(): void;
|
|
72
|
-
}
|
|
73
|
-
interface WorkspaceCredentialResolverV1 {
|
|
74
|
-
readonly contractVersion: "boring.workspace-credential-resolver.v1";
|
|
75
|
-
resolve(workspace: AuthorizedWorkspaceCredentialScopeV1, ref: ProviderCredentialRefV1): Promise<ResolvedCredentialLeaseV1>;
|
|
76
|
-
}
|
|
77
|
-
|
|
78
|
-
interface SandboxHandleRecord {
|
|
79
|
-
workspaceId: string;
|
|
80
|
-
sandboxId: string;
|
|
81
|
-
snapshotId?: string;
|
|
82
|
-
createdAt: string;
|
|
83
|
-
lastUsedAt: string;
|
|
84
|
-
}
|
|
85
|
-
interface SandboxHandleStore {
|
|
86
|
-
get(workspaceId: string): Promise<SandboxHandleRecord | null>;
|
|
87
|
-
put(record: SandboxHandleRecord): Promise<void>;
|
|
88
|
-
delete(workspaceId: string): Promise<void>;
|
|
89
|
-
list(): Promise<SandboxHandleRecord[]>;
|
|
90
|
-
}
|
|
91
|
-
|
|
92
|
-
type Sha256Digest = `sha256:${string}`;
|
|
93
|
-
|
|
94
|
-
interface AgentSchemaIssue<Code extends string> {
|
|
95
|
-
code: Code;
|
|
96
|
-
field: string;
|
|
97
|
-
message: string;
|
|
98
|
-
}
|
|
99
|
-
type AgentSchemaValidationResult<T, Code extends string> = {
|
|
100
|
-
valid: true;
|
|
101
|
-
value: T;
|
|
102
|
-
} | {
|
|
103
|
-
valid: false;
|
|
104
|
-
issues: AgentSchemaIssue<Code>[];
|
|
105
|
-
};
|
|
106
|
-
declare abstract class SchemaValidationError<Code extends string> extends Error {
|
|
107
|
-
readonly code: "CONFIG_INVALID";
|
|
108
|
-
readonly field: string;
|
|
109
|
-
readonly validationCode: Code;
|
|
110
|
-
constructor(issue: AgentSchemaIssue<Code>);
|
|
111
|
-
}
|
|
112
|
-
|
|
113
|
-
interface AgentDefinition {
|
|
114
|
-
schemaVersion: 1;
|
|
115
|
-
definitionId: string;
|
|
116
|
-
version: string;
|
|
117
|
-
label?: string;
|
|
118
|
-
description?: string;
|
|
119
|
-
instructionsRef: string;
|
|
120
|
-
}
|
|
121
|
-
interface AgentDefinitionReference {
|
|
122
|
-
definitionId: string;
|
|
123
|
-
version: string;
|
|
124
|
-
digest: Sha256Digest;
|
|
125
|
-
}
|
|
126
|
-
interface AgentDeployment {
|
|
127
|
-
deploymentId: string;
|
|
128
|
-
version: string;
|
|
129
|
-
agentId: string;
|
|
130
|
-
definition: AgentDefinitionReference;
|
|
131
|
-
}
|
|
132
|
-
interface AgentDefinitionDigestAsset {
|
|
133
|
-
path: string;
|
|
134
|
-
digest: Sha256Digest;
|
|
135
|
-
content: string;
|
|
136
|
-
}
|
|
137
|
-
type CompiledAgentDefinition = {
|
|
138
|
-
readonly [Key in keyof AgentDefinition]: AgentDefinition[Key] extends readonly string[] | undefined ? readonly string[] | undefined : AgentDefinition[Key];
|
|
139
|
-
};
|
|
140
|
-
interface CompiledAgentBundle {
|
|
141
|
-
readonly definition: CompiledAgentDefinition;
|
|
142
|
-
readonly definitionDigest: Sha256Digest;
|
|
143
|
-
readonly assets: readonly Readonly<AgentDefinitionDigestAsset>[];
|
|
144
|
-
/**
|
|
145
|
-
* Host path of the package's optional `knowledge/` folder. Present only
|
|
146
|
-
* when the compiled package ships knowledge; the folder's file bytes are
|
|
147
|
-
* already folded into `definitionDigest` via `assets`.
|
|
148
|
-
*/
|
|
149
|
-
readonly knowledgeDir?: string;
|
|
150
|
-
}
|
|
151
|
-
declare const OpaqueRefSchema: z.ZodEffects<z.ZodString, string, string>;
|
|
152
|
-
declare const Sha256DigestSchema: z.ZodEffects<z.ZodString, `sha256:${string}`, string>;
|
|
153
|
-
declare function validateAgentDefinition(raw: unknown): AgentSchemaValidationResult<AgentDefinition, AgentDefinitionErrorCode>;
|
|
154
|
-
declare function validateAgentDeployment(raw: unknown): AgentSchemaValidationResult<AgentDeployment, AgentDeploymentErrorCode>;
|
|
155
|
-
declare function createAgentAssetDigest(content: string): Promise<Sha256Digest>;
|
|
156
|
-
declare class AgentDefinitionValidationError extends SchemaValidationError<AgentDefinitionErrorCode> {
|
|
157
|
-
constructor(issue: AgentSchemaIssue<AgentDefinitionErrorCode>);
|
|
158
|
-
}
|
|
159
|
-
declare class AgentDeploymentValidationError extends SchemaValidationError<AgentDeploymentErrorCode> {
|
|
160
|
-
constructor(issue: AgentSchemaIssue<AgentDeploymentErrorCode>);
|
|
161
|
-
}
|
|
162
|
-
declare function createAgentDefinitionDigest(input: {
|
|
163
|
-
definition: CompiledAgentDefinition;
|
|
164
|
-
assets: readonly AgentDefinitionDigestAsset[];
|
|
165
|
-
}): Promise<Sha256Digest>;
|
|
166
|
-
declare function createAgentDeploymentDigest(deployment: AgentDeployment): Promise<Sha256Digest>;
|
|
167
|
-
|
|
168
|
-
declare const OpaqueShareLocatorIdSchema: z.ZodEffects<z.ZodString, string, string>;
|
|
169
|
-
interface ShareEntryProvenance {
|
|
170
|
-
producerPrincipalRef: string;
|
|
171
|
-
createdAt: string;
|
|
172
|
-
}
|
|
173
|
-
declare const ShareEntryProvenanceSchema: z.ZodObject<{
|
|
174
|
-
producerPrincipalRef: z.ZodString;
|
|
175
|
-
createdAt: z.ZodString;
|
|
176
|
-
}, "strict", z.ZodTypeAny, {
|
|
177
|
-
createdAt: string;
|
|
178
|
-
producerPrincipalRef: string;
|
|
179
|
-
}, {
|
|
180
|
-
createdAt: string;
|
|
181
|
-
producerPrincipalRef: string;
|
|
182
|
-
}>;
|
|
183
|
-
/**
|
|
184
|
-
* Lane W same-workspace share entry (AR1-001-SPEC.md §3.1): a live reference
|
|
185
|
-
* to a file in the SAME workspace the consumer already belongs to. No blob
|
|
186
|
-
* capture — nothing crosses a workspace boundary. `path` is SERVER-INTERNAL
|
|
187
|
-
* and MUST NOT be emitted in any URL/API/audit surface a later bead builds.
|
|
188
|
-
*/
|
|
189
|
-
interface ShareEntryV1 {
|
|
190
|
-
schemaVersion: 1;
|
|
191
|
-
id: string;
|
|
192
|
-
workspaceId: string;
|
|
193
|
-
/** SERVER-INTERNAL live path; never emitted in URL/API/audit. */
|
|
194
|
-
path: string;
|
|
195
|
-
provenance: ShareEntryProvenance;
|
|
196
|
-
}
|
|
197
|
-
declare const ShareEntryV1Schema: z.ZodObject<{
|
|
198
|
-
schemaVersion: z.ZodLiteral<1>;
|
|
199
|
-
id: z.ZodEffects<z.ZodString, string, string>;
|
|
200
|
-
workspaceId: z.ZodEffects<z.ZodString, string, string>;
|
|
201
|
-
path: z.ZodString;
|
|
202
|
-
provenance: z.ZodObject<{
|
|
203
|
-
producerPrincipalRef: z.ZodString;
|
|
204
|
-
createdAt: z.ZodString;
|
|
205
|
-
}, "strict", z.ZodTypeAny, {
|
|
206
|
-
createdAt: string;
|
|
207
|
-
producerPrincipalRef: string;
|
|
208
|
-
}, {
|
|
209
|
-
createdAt: string;
|
|
210
|
-
producerPrincipalRef: string;
|
|
211
|
-
}>;
|
|
212
|
-
}, "strict", z.ZodTypeAny, {
|
|
213
|
-
id: string;
|
|
214
|
-
path: string;
|
|
215
|
-
workspaceId: string;
|
|
216
|
-
schemaVersion: 1;
|
|
217
|
-
provenance: {
|
|
218
|
-
createdAt: string;
|
|
219
|
-
producerPrincipalRef: string;
|
|
220
|
-
};
|
|
221
|
-
}, {
|
|
222
|
-
id: string;
|
|
223
|
-
path: string;
|
|
224
|
-
workspaceId: string;
|
|
225
|
-
schemaVersion: 1;
|
|
226
|
-
provenance: {
|
|
227
|
-
createdAt: string;
|
|
228
|
-
producerPrincipalRef: string;
|
|
229
|
-
};
|
|
230
|
-
}>;
|
|
231
|
-
/**
|
|
232
|
-
* Refusal codes for Lane W share resolution (AR1-001-SPEC.md §3.3/§5).
|
|
233
|
-
* Graduated into the public {@link ErrorCode}/`ERROR_CODES` registry (and
|
|
234
|
-
* `docs/ERROR_CODES.md`) by AR1-003, the first runtime route
|
|
235
|
-
* (`GET /a/:id`, `server/http/routes/deepLink.ts`) that surfaces these over
|
|
236
|
-
* an API boundary — following the same registry precedent used for
|
|
237
|
-
* `MCP_AGENT_ARTIFACT_*` (graduated when `managedAgentDelegate.ts` started
|
|
238
|
-
* surfacing them). These are the ONLY two AR1-specific codes for Lane W:
|
|
239
|
-
* "Access denial is the existing generic membership denial, not an AR1
|
|
240
|
-
* code" (spec §3.3) — this module does not invent a third.
|
|
241
|
-
*/
|
|
242
|
-
declare const ShareEntryErrorCode: z.ZodEnum<["AR1_SHARE_NOT_FOUND", "AR1_SHARE_TOMBSTONED"]>;
|
|
243
|
-
type ShareEntryErrorCode = z.infer<typeof ShareEntryErrorCode>;
|
|
244
|
-
/**
|
|
245
|
-
* Input-validation failures for {@link ShareEntryStore.create}. Deliberately
|
|
246
|
-
* NOT an `AR1_*` code (the spec's §5 table names exactly two Lane W codes for
|
|
247
|
-
* resolution outcomes; this reuses the existing generic `CONFIG_INVALID`
|
|
248
|
-
* taxonomy for malformed create-input, the same way `SchemaValidationError`
|
|
249
|
-
* subclasses elsewhere in this package do).
|
|
250
|
-
*/
|
|
251
|
-
declare const ShareEntryValidationCode: z.ZodEnum<["SHARE_ENTRY_INPUT_INVALID"]>;
|
|
252
|
-
type ShareEntryValidationCode = z.infer<typeof ShareEntryValidationCode>;
|
|
253
|
-
declare class ShareEntryValidationError extends Error {
|
|
254
|
-
readonly code: "CONFIG_INVALID";
|
|
255
|
-
readonly field: string;
|
|
256
|
-
constructor(issue: AgentSchemaIssue<ShareEntryValidationCode>);
|
|
257
|
-
}
|
|
258
|
-
interface CreateShareEntryInput {
|
|
259
|
-
workspaceId: string;
|
|
260
|
-
/** SERVER-INTERNAL live path. Never persist/return this in a public surface. */
|
|
261
|
-
path: string;
|
|
262
|
-
provenance: {
|
|
263
|
-
producerPrincipalRef: string;
|
|
264
|
-
/** Defaults to the store's creation time when omitted. */
|
|
265
|
-
createdAt?: string;
|
|
266
|
-
};
|
|
267
|
-
}
|
|
268
|
-
interface ShareEntryStore {
|
|
269
|
-
/** Validates `input`, mints a fresh opaque `id`, and persists the entry. */
|
|
270
|
-
create(input: CreateShareEntryInput): Promise<ShareEntryV1>;
|
|
271
|
-
get(id: string): Promise<ShareEntryV1 | null>;
|
|
272
|
-
delete(id: string): Promise<void>;
|
|
273
|
-
/** Lists entries scoped to one workspace (never leaks across workspaces). */
|
|
274
|
-
list(workspaceId: string): Promise<ShareEntryV1[]>;
|
|
275
|
-
}
|
|
276
|
-
/**
|
|
277
|
-
* In-memory reference implementation. Lane W has no durability requirement
|
|
278
|
-
* beyond "the repo's existing persistence seam" named by this bead (a simple
|
|
279
|
-
* keyed-record store, mirroring `SandboxHandleStore`/`SessionStore` in this
|
|
280
|
-
* same package) — a durable adapter is a swap-in behind the same interface
|
|
281
|
-
* when a later bead needs one; this store does not invent a new store
|
|
282
|
-
* technology.
|
|
283
|
-
*/
|
|
284
|
-
declare class InMemoryShareEntryStore implements ShareEntryStore {
|
|
285
|
-
private readonly entries;
|
|
286
|
-
create(input: CreateShareEntryInput): Promise<ShareEntryV1>;
|
|
287
|
-
get(id: string): Promise<ShareEntryV1 | null>;
|
|
288
|
-
delete(id: string): Promise<void>;
|
|
289
|
-
list(workspaceId: string): Promise<ShareEntryV1[]>;
|
|
290
|
-
}
|
|
291
|
-
/** Redacted, path-free projection of a tombstoned entry (spec §3.3/§1: no path in any error surface). */
|
|
292
|
-
interface ShareEntryTombstone {
|
|
293
|
-
id: string;
|
|
294
|
-
workspaceId: string;
|
|
295
|
-
provenance: ShareEntryProvenance;
|
|
296
|
-
}
|
|
297
|
-
type ShareEntryResolution = {
|
|
298
|
-
status: 'ok';
|
|
299
|
-
entry: ShareEntryV1;
|
|
300
|
-
} | {
|
|
301
|
-
status: 'not_found';
|
|
302
|
-
code: typeof ShareEntryErrorCode.enum.AR1_SHARE_NOT_FOUND;
|
|
303
|
-
} | {
|
|
304
|
-
status: 'tombstoned';
|
|
305
|
-
code: typeof ShareEntryErrorCode.enum.AR1_SHARE_TOMBSTONED;
|
|
306
|
-
tombstone: ShareEntryTombstone;
|
|
307
|
-
};
|
|
308
|
-
/**
|
|
309
|
-
* Resolves a share entry against the CURRENT state of the workspace file
|
|
310
|
-
* (live-reference semantics, spec §3.2 — deliberately not a snapshot). The
|
|
311
|
-
* caller must already have resolved and authorized `workspace` for
|
|
312
|
-
* `entry.workspaceId`; this function performs no membership check itself
|
|
313
|
-
* (spec §3.3: "Access denial is the existing generic membership denial, not
|
|
314
|
-
* an AR1 code").
|
|
315
|
-
*
|
|
316
|
-
* - No such entry -> `not_found` (`AR1_SHARE_NOT_FOUND`).
|
|
317
|
-
* - Entry exists but the target file is gone -> `tombstoned`
|
|
318
|
-
* (`AR1_SHARE_TOMBSTONED`), carrying provenance + last-known metadata and
|
|
319
|
-
* NEVER the path (never a bare 404, never source state).
|
|
320
|
-
* - Entry exists and the target file stats successfully -> `ok`, with the
|
|
321
|
-
* full (server-internal) entry for the caller to act on.
|
|
322
|
-
*
|
|
323
|
-
* Any `workspace.stat` rejection (not just a "does not exist" error) is
|
|
324
|
-
* treated as "target gone" — the spec's fail-safe is to render a tombstone,
|
|
325
|
-
* never a bare 404; a later bead may narrow this to distinguish stat
|
|
326
|
-
* failure causes if that proves necessary.
|
|
327
|
-
*/
|
|
328
|
-
declare function resolveShareEntry(store: ShareEntryStore, id: string, workspace: Workspace): Promise<ShareEntryResolution>;
|
|
329
|
-
|
|
330
|
-
export { type AgentSchemaIssue as A, type ShareEntryTombstone as B, type CompiledAgentBundle as C, type ShareEntryV1 as D, ShareEntryV1Schema as E, ShareEntryValidationError as F, createAgentAssetDigest as G, createAgentDefinitionDigest as H, InMemoryShareEntryStore as I, createAgentDeploymentDigest as J, createCredentialConsumerBindingRegistryV1 as K, createProviderCredentialRefFactoryV1 as L, providerCredentialFieldsV1 as M, resolveShareEntry as N, OpaqueRefSchema as O, type ProviderCredentialRefV1 as P, validateAgentDefinition as Q, type ResolvedCredentialLeaseV1 as R, SchemaValidationError as S, validateAgentDeployment as T, type WorkspaceCredentialResolverV1 as W, type Sha256Digest as a, type AgentSchemaValidationResult as b, type AgentDefinition as c, type AgentDefinitionDigestAsset as d, type AgentDefinitionReference as e, AgentDefinitionValidationError as f, type AgentDeployment as g, AgentDeploymentValidationError as h, type CompiledAgentDefinition as i, type CreateShareEntryInput as j, type CredentialConsumerBindingRegistryV1 as k, type CredentialConsumerBindingV1 as l, type CredentialConsumerKindV1 as m, type CredentialDeliveryV1 as n, OpaqueShareLocatorIdSchema as o, PROVIDER_CREDENTIAL_REF_VERSION as p, type ProviderCredentialRefFactoryV1 as q, type ResolvedCredentialMaterialV1 as r, type SandboxHandleRecord as s, type SandboxHandleStore as t, Sha256DigestSchema as u, ShareEntryErrorCode as v, type ShareEntryProvenance as w, ShareEntryProvenanceSchema as x, type ShareEntryResolution as y, type ShareEntryStore as z };
|