stitchkit 0.68.0 → 0.68.2
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/agent-runtime/admission-lanes.d.ts +1 -1
- package/dist/agent-runtime/compaction.d.ts +2 -2
- package/dist/agent-runtime/events.d.ts +1 -1
- package/dist/agent-runtime/history.d.ts +1 -1
- package/dist/agent-runtime/history.d.ts.map +1 -1
- package/dist/agent-runtime/injection.d.ts +1 -1
- package/dist/agent-runtime/managed-tools.d.ts +3 -3
- package/dist/agent-runtime/models.d.ts +1 -1
- package/dist/agent-runtime/observability.d.ts +1 -1
- package/dist/agent-runtime/prompt.d.ts +1 -1
- package/dist/agent-runtime/prompt.d.ts.map +1 -1
- package/dist/agent-runtime/protocol.d.ts +19 -1
- package/dist/agent-runtime/protocol.d.ts.map +1 -1
- package/dist/agent-runtime/run-execution.d.ts +5 -5
- package/dist/agent-runtime/run-execution.d.ts.map +1 -1
- package/dist/agent-runtime/runtime-internals.d.ts +1 -1
- package/dist/agent-runtime/runtime-result.d.ts +1 -1
- package/dist/agent-runtime/runtime.d.ts +14 -12
- package/dist/agent-runtime/runtime.d.ts.map +1 -1
- package/dist/agent-runtime/store-driver.d.ts +2 -2
- package/dist/agent-runtime/store.d.ts +2 -2
- package/dist/agent-runtime/terminal-commit.d.ts +2 -2
- package/dist/agent-runtime/terminal-status.d.ts +1 -1
- package/dist/agent-runtime-openrouter.d.ts +1 -1
- package/dist/agent-runtime.d.ts +15 -15
- package/dist/agent-runtime.d.ts.map +1 -1
- package/dist/agent-runtime.js +87 -26
- package/dist/application/admission.d.ts +1 -1
- package/dist/application/events.d.ts +2 -2
- package/dist/application/grammy.d.ts +2 -2
- package/dist/application/graph.d.ts +1 -1
- package/dist/application/health.d.ts +1 -1
- package/dist/application/kernel.d.ts +3 -3
- package/dist/application/opentelemetry.d.ts +3 -3
- package/dist/application/resource.d.ts +1 -1
- package/dist/application/schedule.d.ts +1 -1
- package/dist/application/server-resource.d.ts +7 -9
- package/dist/application/server-resource.d.ts.map +1 -1
- package/dist/application-grammy.d.ts +1 -1
- package/dist/application-opentelemetry.d.ts +1 -1
- package/dist/application.d.ts +11 -11
- package/dist/application.js +7 -7
- package/dist/browser/client-multipart.d.ts +1 -1
- package/dist/browser/client-url.d.ts +2 -2
- package/dist/browser/client.d.ts +4 -4
- package/dist/browser/client.d.ts.map +1 -1
- package/dist/browser/contract-stream.d.ts +1 -1
- package/dist/browser/http.d.ts +7 -7
- package/dist/browser/http.d.ts.map +1 -1
- package/dist/browser/socket-io.d.ts +12 -31
- package/dist/browser/socket-io.d.ts.map +1 -1
- package/dist/browser/stream.d.ts +2 -2
- package/dist/cli.d.ts +6 -6
- package/dist/cli.js +4 -3
- package/dist/contract/errors-factory.d.ts +1 -1
- package/dist/contract/factory.d.ts +1 -1
- package/dist/contract/index.d.ts +7 -7
- package/dist/files/boundary.d.ts +1 -1
- package/dist/files.d.ts +2 -2
- package/dist/{index-zd4v31v2.js → index-2ve29dzn.js} +3 -3
- package/dist/{index-nymn7wbg.js → index-3vq6we8m.js} +29 -17
- package/dist/index-7etq650s.js +75 -0
- package/dist/{index-7pn02bgv.js → index-cszjsxy5.js} +22 -83
- package/dist/index-g2j2m6vv.js +63 -0
- package/dist/index.d.ts +10 -10
- package/dist/index.js +4 -4
- package/dist/internal/errors.d.ts +1 -1
- package/dist/internal/observability-sink.d.ts +1 -1
- package/dist/node.d.ts +11 -11
- package/dist/node.d.ts.map +1 -1
- package/dist/node.js +2 -2
- package/dist/observability/audit.d.ts +5 -5
- package/dist/observability/context.d.ts +2 -2
- package/dist/observability/event.d.ts +2 -2
- package/dist/observability/index.d.ts +6 -6
- package/dist/react/entity-cache.d.ts +26 -1
- package/dist/react/entity-cache.d.ts.map +1 -1
- package/dist/react.d.ts +3 -3
- package/dist/react.d.ts.map +1 -1
- package/dist/react.js +136 -38
- package/dist/realtime/contract.d.ts +1 -1
- package/dist/realtime/index.d.ts +4 -4
- package/dist/realtime/rejection.d.ts +1 -1
- package/dist/realtime/request.d.ts +1 -1
- package/dist/realtime/socket.d.ts +2 -2
- package/dist/remote.d.ts +1 -1
- package/dist/remote.js +1 -1
- package/dist/server/bun.d.ts +3 -3
- package/dist/server/context-contribution.d.ts +1 -1
- package/dist/server/context.d.ts +4 -4
- package/dist/server/contract-stream.d.ts +2 -2
- package/dist/server/create.d.ts +1 -1
- package/dist/server/error-hook.d.ts +3 -3
- package/dist/server/file.d.ts +1 -1
- package/dist/server/implement.d.ts +2 -2
- package/dist/server/index.d.ts +31 -31
- package/dist/server/index.d.ts.map +1 -1
- package/dist/server/index.js +9 -9
- package/dist/server/lifecycle.d.ts +1 -1
- package/dist/server/logging.d.ts +1 -1
- package/dist/server/middleware/auth.d.ts +2 -2
- package/dist/server/multipart.d.ts +2 -2
- package/dist/server/node.d.ts +2 -2
- package/dist/server/openapi.d.ts +1 -1
- package/dist/server/process-signal-common.d.ts +1 -1
- package/dist/server/process-signals.d.ts +1 -1
- package/dist/server/realtime.d.ts +4 -4
- package/dist/server/response-metadata.d.ts +1 -1
- package/dist/server/router.d.ts +1 -1
- package/dist/server/shutdown.d.ts +1 -1
- package/dist/server/socket-io-node.d.ts +3 -3
- package/dist/server/socket-io.d.ts +6 -6
- package/dist/server/streaming-route.d.ts +2 -2
- package/dist/server/types.d.ts +6 -6
- package/dist/server/unix-client-body.d.ts +1 -1
- package/dist/server/unix-client-body.d.ts.map +1 -1
- package/dist/server/unix-client-bun.d.ts +1 -1
- package/dist/server/unix-client-bun.d.ts.map +1 -1
- package/dist/server/unix-client.d.ts +16 -5
- package/dist/server/unix-client.d.ts.map +1 -1
- package/dist/testing/agent-store-conformance.d.ts +1 -1
- package/dist/testing/managed-resource-conformance-contract.d.ts +1 -1
- package/dist/testing/managed-resource-conformance-driver.d.ts +2 -2
- package/dist/testing/managed-resource-conformance-scenarios.d.ts +2 -2
- package/dist/testing/managed-resource-conformance.d.ts +2 -2
- package/dist/testing/surface-conformance.d.ts +3 -3
- package/dist/testing/surface-manifest.d.ts +5 -5
- package/dist/testing.d.ts +8 -8
- package/dist/testing.js +1 -1
- package/dist/tool-invoker.d.ts +9 -0
- package/dist/tool-invoker.d.ts.map +1 -0
- package/dist/tool-invoker.js +16 -0
- package/dist/tools/agent.d.ts +4 -4
- package/dist/tools/async-operation.d.ts +3 -3
- package/dist/tools/cli-command.d.ts +3 -3
- package/dist/tools/cli-format.d.ts +1 -1
- package/dist/tools/cli-policy.d.ts +1 -1
- package/dist/tools/cli-wait.d.ts +1 -1
- package/dist/tools/cli.d.ts +7 -7
- package/dist/tools/define-download-tool.d.ts +4 -4
- package/dist/tools/define-upload-tool.d.ts +3 -3
- package/dist/tools/define-view-file-tool.d.ts +3 -3
- package/dist/tools/define-wait-tool.d.ts +2 -2
- package/dist/tools/download-core.d.ts +2 -2
- package/dist/tools/execute.d.ts +2 -2
- package/dist/tools/flatten-join.d.ts +1 -1
- package/dist/tools/internal/surface-projector.d.ts +3 -3
- package/dist/tools/invoker.d.ts +4 -4
- package/dist/tools/lifecycle.d.ts +1 -1
- package/dist/tools/list-names.d.ts +2 -2
- package/dist/tools/managed-file-error.d.ts +1 -1
- package/dist/tools/manifest.d.ts +3 -3
- package/dist/tools/mcp-handler.d.ts +4 -4
- package/dist/tools/mcp-prepare.d.ts +8 -8
- package/dist/tools/mcp-round-policy.d.ts +1 -1
- package/dist/tools/mcp-round.d.ts +3 -3
- package/dist/tools/mcp-stdio-signals.d.ts +2 -2
- package/dist/tools/mcp-stdio.d.ts +3 -3
- package/dist/tools/mcp.d.ts +7 -7
- package/dist/tools/mount-download.d.ts +1 -1
- package/dist/tools/mount-upload.d.ts +1 -1
- package/dist/tools/mount.d.ts +5 -5
- package/dist/tools/native-definition.d.ts +2 -2
- package/dist/tools/native-mcp.d.ts +3 -3
- package/dist/tools/oauth-metadata.d.ts +1 -1
- package/dist/tools/oauth-provider.d.ts +1 -1
- package/dist/tools/presentation.d.ts +1 -1
- package/dist/tools/remote.d.ts +3 -3
- package/dist/tools/runtime-tool.d.ts +2 -2
- package/dist/tools/surface.d.ts +5 -5
- package/dist/tools/tool-logger.d.ts +1 -1
- package/dist/tools/toolkit.d.ts +7 -7
- package/dist/tools/transports.d.ts +2 -2
- package/dist/tools/upload-core.d.ts +1 -1
- package/dist/tools/view-file.d.ts +1 -1
- package/dist/tools.d.ts +42 -42
- package/dist/tools.js +18 -61
- package/llms-full.txt +196 -20
- package/package.json +8 -4
- package/dist/{index-avjd67h6.js → index-cz32amcb.js} +3 -3
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import type { z } from 'zod';
|
|
2
|
-
import { AppError } from '../contract/errors';
|
|
3
|
-
import type { ManagedResource } from './resource';
|
|
4
|
-
import { type ApplicationResourceShutdown, type ApplicationShutdownResult, type ApplicationSnapshot } from './schemas';
|
|
2
|
+
import { AppError } from '../contract/errors.js';
|
|
3
|
+
import type { ManagedResource } from './resource.js';
|
|
4
|
+
import { type ApplicationResourceShutdown, type ApplicationShutdownResult, type ApplicationSnapshot } from './schemas.js';
|
|
5
5
|
/** The phase a managed resource failed in — the vocabulary of `failures`. */
|
|
6
6
|
export type ApplicationResourcePhase = ApplicationResourceShutdown['failures'][number];
|
|
7
7
|
/** One resource failure with the cause the phase label cannot carry. */
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import type { Attributes, MetricOptions, ObservableGauge } from '@opentelemetry/api';
|
|
2
|
-
import type { ActivityProjection } from './activity';
|
|
3
|
-
import type { ApplicationHandle } from './kernel';
|
|
4
|
-
import type { ManagedSchedule } from './schedule';
|
|
2
|
+
import type { ActivityProjection } from './activity.js';
|
|
3
|
+
import type { ApplicationHandle } from './kernel.js';
|
|
4
|
+
import type { ManagedSchedule } from './schedule.js';
|
|
5
5
|
export interface ApplicationTelemetryMeter {
|
|
6
6
|
createObservableGauge(name: string, options?: MetricOptions): ObservableGauge<Attributes>;
|
|
7
7
|
}
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { z } from 'zod';
|
|
2
|
-
import type { ManagedResource } from './resource';
|
|
2
|
+
import type { ManagedResource } from './resource.js';
|
|
3
3
|
export declare const ManagedScheduleOverlapSchema: z.ZodDiscriminatedUnion<[z.ZodReadonly<z.ZodObject<{
|
|
4
4
|
mode: z.ZodLiteral<"skip">;
|
|
5
5
|
}, z.core.$strip>>, z.ZodReadonly<z.ZodObject<{
|
|
@@ -1,18 +1,16 @@
|
|
|
1
|
-
import type { ManagedServerHandle } from '../server/shutdown';
|
|
2
|
-
import { type ManagedResource, type ManagedResourceContext, type ManagedResourceDependency } from './resource';
|
|
1
|
+
import type { ManagedServerHandle } from '../server/shutdown.js';
|
|
2
|
+
import { type ManagedResource, type ManagedResourceContext, type ManagedResourceDependency } from './resource.js';
|
|
3
3
|
export interface ManagedServerResourceConfig<TRuntime> {
|
|
4
4
|
readonly id: string;
|
|
5
5
|
/**
|
|
6
6
|
* The server, or how to make one.
|
|
7
7
|
*
|
|
8
|
-
* A handle is adopted as it is. A
|
|
9
|
-
*
|
|
10
|
-
*
|
|
11
|
-
*
|
|
12
|
-
* `healthy`, and had nothing listening on the port; the failure surfaced as a
|
|
13
|
-
* request that never arrived.
|
|
8
|
+
* A handle is adopted as it is. A factory is called during `start`, after its
|
|
9
|
+
* declared dependencies are ready, and receives the resource context. That
|
|
10
|
+
* context is the supported way to read dependency values and the startup
|
|
11
|
+
* signal while constructing routes and adapters.
|
|
14
12
|
*/
|
|
15
|
-
readonly server: ManagedServerHandle<TRuntime> | (() => ManagedServerHandle<TRuntime> | Promise<ManagedServerHandle<TRuntime>>);
|
|
13
|
+
readonly server: ManagedServerHandle<TRuntime> | ((context: ManagedResourceContext) => ManagedServerHandle<TRuntime> | Promise<ManagedServerHandle<TRuntime>>);
|
|
16
14
|
readonly dependsOn?: readonly ManagedResourceDependency[];
|
|
17
15
|
readonly required?: boolean;
|
|
18
16
|
readonly retryAfterSeconds?: number;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"server-resource.d.ts","sourceRoot":"","sources":["../../src/application/server-resource.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,mBAAmB,EAAmC,MAAM,oBAAoB,CAAC;AAC/F,OAAO,EAEL,KAAK,eAAe,EACpB,KAAK,sBAAsB,EAC3B,KAAK,yBAAyB,EAC/B,MAAM,YAAY,CAAC;AAEpB,MAAM,WAAW,2BAA2B,CAAC,QAAQ;IACnD,QAAQ,CAAC,EAAE,EAAE,MAAM,CAAC;IACpB
|
|
1
|
+
{"version":3,"file":"server-resource.d.ts","sourceRoot":"","sources":["../../src/application/server-resource.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,mBAAmB,EAAmC,MAAM,oBAAoB,CAAC;AAC/F,OAAO,EAEL,KAAK,eAAe,EACpB,KAAK,sBAAsB,EAC3B,KAAK,yBAAyB,EAC/B,MAAM,YAAY,CAAC;AAEpB,MAAM,WAAW,2BAA2B,CAAC,QAAQ;IACnD,QAAQ,CAAC,EAAE,EAAE,MAAM,CAAC;IACpB;;;;;;;OAOG;IACH,QAAQ,CAAC,MAAM,EACX,mBAAmB,CAAC,QAAQ,CAAC,GAC7B,CAAC,CACC,OAAO,EAAE,sBAAsB,KAC5B,mBAAmB,CAAC,QAAQ,CAAC,GAAG,OAAO,CAAC,mBAAmB,CAAC,QAAQ,CAAC,CAAC,CAAC,CAAC;IACjF,QAAQ,CAAC,SAAS,CAAC,EAAE,SAAS,yBAAyB,EAAE,CAAC;IAC1D,QAAQ,CAAC,QAAQ,CAAC,EAAE,OAAO,CAAC;IAC5B,QAAQ,CAAC,iBAAiB,CAAC,EAAE,MAAM,CAAC;CACrC;AAED;;;;;GAKG;AACH,MAAM,WAAW,qBAAqB,CAAC,QAAQ,CAAE,SAAQ,eAAe;IACtE,KAAK,CACH,OAAO,EAAE,sBAAsB,GAC9B,OAAO,CAAC;QAAE,QAAQ,CAAC,KAAK,EAAE,mBAAmB,CAAC,QAAQ,CAAC,CAAA;KAAE,CAAC,CAAC;CAC/D;AAED,uFAAuF;AACvF,wBAAgB,qBAAqB,CAAC,QAAQ,EAC5C,MAAM,EAAE,2BAA2B,CAAC,QAAQ,CAAC,GAC5C,qBAAqB,CAAC,QAAQ,CAAC,CAwIjC"}
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
export { createGrammyWebhookResource, type GrammyPollingResourceConfig, type GrammyUpdate, type GrammyWebhookResource, type GrammyWebhookResourceConfig, GrammyWebhookUnavailableError, grammyPollingResource, } from './application/grammy';
|
|
1
|
+
export { createGrammyWebhookResource, type GrammyPollingResourceConfig, type GrammyUpdate, type GrammyWebhookResource, type GrammyWebhookResourceConfig, GrammyWebhookUnavailableError, grammyPollingResource, } from './application/grammy.js';
|
|
2
2
|
//# sourceMappingURL=application-grammy.d.ts.map
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
export { type ApplicationOpenTelemetryBinding, type ApplicationOpenTelemetryCollectionError, type ApplicationOpenTelemetryConfig, type ApplicationTelemetryMeter, createApplicationOpenTelemetry, } from './application/opentelemetry';
|
|
1
|
+
export { type ApplicationOpenTelemetryBinding, type ApplicationOpenTelemetryCollectionError, type ApplicationOpenTelemetryConfig, type ApplicationTelemetryMeter, createApplicationOpenTelemetry, } from './application/opentelemetry.js';
|
|
2
2
|
//# sourceMappingURL=application-opentelemetry.d.ts.map
|
package/dist/application.d.ts
CHANGED
|
@@ -1,12 +1,12 @@
|
|
|
1
|
-
export { type ActivityId, ActivityIdSchema, type ActivityLiveState, ActivityLiveStateSchema, type ActivityProjection, type ActivityProjectionConfig, type ActivityProjectionSubscriberError, type ActivitySnapshot, ActivitySnapshotSchema, type ActivityStageId, ActivityStageIdSchema, type ActivityStageSnapshot, ActivityStageSnapshotSchema, type ActivityToken, ActivityTokenBrand, type ActivityTransition, createActivityProjection, } from './application/activity';
|
|
2
|
-
export { type BoundedAdmission, type BoundedAdmissionClock, type BoundedAdmissionConfig, type BoundedAdmissionDrainOptions, type BoundedAdmissionDrainResult, type BoundedAdmissionForceResult, type BoundedAdmissionLeaseResult, type BoundedAdmissionPolicy, BoundedAdmissionPolicySchema, BoundedAdmissionRefusalError, type BoundedAdmissionRefusalReason, BoundedAdmissionRefusalReasonSchema, type BoundedAdmissionRefusedResult, type BoundedAdmissionResult, type BoundedAdmissionSnapshot, BoundedAdmissionSnapshotSchema, type BoundedAdmissionState, BoundedAdmissionStateSchema, type BoundedOperationLease, type BoundedOperationRunContext, type BoundedOperationRunOptions, BoundedOperationWaitError, type BoundedRateBudget, BoundedRateBudgetSchema, createBoundedAdmission, } from './application/admission';
|
|
3
|
-
export { type BoundedChannel, type BoundedChannelCloseOptions, type BoundedChannelConfig, type BoundedChannelOfferResult, type BoundedChannelPolicy, BoundedChannelPolicySchema, BoundedChannelReaderError, type BoundedChannelSnapshot, BoundedChannelSnapshotSchema, type BoundedChannelState, BoundedChannelStateSchema, type CreditAcquireResult, type CreditLease, type CreditWindow, type CreditWindowSnapshot, CreditWindowSnapshotSchema, createBoundedChannel, createCreditWindow, } from './application/channel';
|
|
4
|
-
export { type ApplicationEventSink, type ApplicationEventSinkConfig, type ApplicationLifecycleEvent, ApplicationLifecycleEventSchema, applicationLifecycleEvent, createApplicationEventSink, } from './application/events';
|
|
5
|
-
export { type ApplicationHealthHandlerOptions, ApplicationHealthHandlerOptionsSchema, type ApplicationOperationalHandlers, type ApplicationOperationalHandlersOptions, ApplicationOperationalHandlersOptionsSchema, createApplicationHealthHandler, createApplicationOperationalHandlers, } from './application/health';
|
|
6
|
-
export { type ApplicationAdmission, ApplicationAdmissionError, type ApplicationConfig, type ApplicationHandle, type ApplicationOperationLease, type ApplicationResourceFailure, type ApplicationResourcePhase, type ApplicationShutdownBudget, ApplicationShutdownBudgetSchema, type ApplicationShutdownOptions, ApplicationShutdownOptionsSchema, createApplication, } from './application/kernel';
|
|
7
|
-
export { type ApplicationSnapshotSink, type ApplicationSnapshotSinkConfig, type ApplicationSnapshotSinkError, type ApplicationSnapshotSinkStatus, ApplicationSnapshotSinkStatusSchema, createApplicationSnapshotSink, type RevisionedApplicationSnapshot, } from './application/latest-sink';
|
|
8
|
-
export { defineManagedResource, type ManagedResource, type ManagedResourceContext, type ManagedResourceDependency, type ManagedResourcePublished, type ManagedResourcePublishesNoValue, type ManagedResourceStartResult, managedResourceDependencyId, } from './application/resource';
|
|
9
|
-
export { createManagedSchedule, type ManagedSchedule, type ManagedScheduleClock, type ManagedScheduleConfig, type ManagedScheduleDescriptor, ManagedScheduleDescriptorSchema, type ManagedScheduleErrorPolicy, ManagedScheduleErrorPolicySchema, type ManagedScheduleOverlap, ManagedScheduleOverlapSchema, type ManagedScheduleRunContext, type ManagedScheduleStatus, ManagedScheduleStatusSchema, type ManagedScheduleTimer, } from './application/schedule';
|
|
10
|
-
export { type ApplicationAdmissionSnapshot, ApplicationAdmissionSnapshotSchema, type ApplicationHealth, ApplicationHealthSchema, type ApplicationId, ApplicationIdSchema, type ApplicationLifecycle, ApplicationLifecycleSchema, type ApplicationResourceShutdown, ApplicationResourceShutdownSchema, type ApplicationShutdownResult, ApplicationShutdownResultSchema, type ApplicationSnapshot, ApplicationSnapshotSchema, type ApplicationStatusProjection, ApplicationStatusProjectionSchema, type ManagedResourceSnapshot, ManagedResourceSnapshotSchema, type ManagedResourceState, ManagedResourceStateSchema, projectApplicationStatus, } from './application/schemas';
|
|
11
|
-
export { type ManagedServerResource, type ManagedServerResourceConfig, managedServerResource, } from './application/server-resource';
|
|
1
|
+
export { type ActivityId, ActivityIdSchema, type ActivityLiveState, ActivityLiveStateSchema, type ActivityProjection, type ActivityProjectionConfig, type ActivityProjectionSubscriberError, type ActivitySnapshot, ActivitySnapshotSchema, type ActivityStageId, ActivityStageIdSchema, type ActivityStageSnapshot, ActivityStageSnapshotSchema, type ActivityToken, ActivityTokenBrand, type ActivityTransition, createActivityProjection, } from './application/activity.js';
|
|
2
|
+
export { type BoundedAdmission, type BoundedAdmissionClock, type BoundedAdmissionConfig, type BoundedAdmissionDrainOptions, type BoundedAdmissionDrainResult, type BoundedAdmissionForceResult, type BoundedAdmissionLeaseResult, type BoundedAdmissionPolicy, BoundedAdmissionPolicySchema, BoundedAdmissionRefusalError, type BoundedAdmissionRefusalReason, BoundedAdmissionRefusalReasonSchema, type BoundedAdmissionRefusedResult, type BoundedAdmissionResult, type BoundedAdmissionSnapshot, BoundedAdmissionSnapshotSchema, type BoundedAdmissionState, BoundedAdmissionStateSchema, type BoundedOperationLease, type BoundedOperationRunContext, type BoundedOperationRunOptions, BoundedOperationWaitError, type BoundedRateBudget, BoundedRateBudgetSchema, createBoundedAdmission, } from './application/admission.js';
|
|
3
|
+
export { type BoundedChannel, type BoundedChannelCloseOptions, type BoundedChannelConfig, type BoundedChannelOfferResult, type BoundedChannelPolicy, BoundedChannelPolicySchema, BoundedChannelReaderError, type BoundedChannelSnapshot, BoundedChannelSnapshotSchema, type BoundedChannelState, BoundedChannelStateSchema, type CreditAcquireResult, type CreditLease, type CreditWindow, type CreditWindowSnapshot, CreditWindowSnapshotSchema, createBoundedChannel, createCreditWindow, } from './application/channel.js';
|
|
4
|
+
export { type ApplicationEventSink, type ApplicationEventSinkConfig, type ApplicationLifecycleEvent, ApplicationLifecycleEventSchema, applicationLifecycleEvent, createApplicationEventSink, } from './application/events.js';
|
|
5
|
+
export { type ApplicationHealthHandlerOptions, ApplicationHealthHandlerOptionsSchema, type ApplicationOperationalHandlers, type ApplicationOperationalHandlersOptions, ApplicationOperationalHandlersOptionsSchema, createApplicationHealthHandler, createApplicationOperationalHandlers, } from './application/health.js';
|
|
6
|
+
export { type ApplicationAdmission, ApplicationAdmissionError, type ApplicationConfig, type ApplicationHandle, type ApplicationOperationLease, type ApplicationResourceFailure, type ApplicationResourcePhase, type ApplicationShutdownBudget, ApplicationShutdownBudgetSchema, type ApplicationShutdownOptions, ApplicationShutdownOptionsSchema, createApplication, } from './application/kernel.js';
|
|
7
|
+
export { type ApplicationSnapshotSink, type ApplicationSnapshotSinkConfig, type ApplicationSnapshotSinkError, type ApplicationSnapshotSinkStatus, ApplicationSnapshotSinkStatusSchema, createApplicationSnapshotSink, type RevisionedApplicationSnapshot, } from './application/latest-sink.js';
|
|
8
|
+
export { defineManagedResource, type ManagedResource, type ManagedResourceContext, type ManagedResourceDependency, type ManagedResourcePublished, type ManagedResourcePublishesNoValue, type ManagedResourceStartResult, managedResourceDependencyId, } from './application/resource.js';
|
|
9
|
+
export { createManagedSchedule, type ManagedSchedule, type ManagedScheduleClock, type ManagedScheduleConfig, type ManagedScheduleDescriptor, ManagedScheduleDescriptorSchema, type ManagedScheduleErrorPolicy, ManagedScheduleErrorPolicySchema, type ManagedScheduleOverlap, ManagedScheduleOverlapSchema, type ManagedScheduleRunContext, type ManagedScheduleStatus, ManagedScheduleStatusSchema, type ManagedScheduleTimer, } from './application/schedule.js';
|
|
10
|
+
export { type ApplicationAdmissionSnapshot, ApplicationAdmissionSnapshotSchema, type ApplicationHealth, ApplicationHealthSchema, type ApplicationId, ApplicationIdSchema, type ApplicationLifecycle, ApplicationLifecycleSchema, type ApplicationResourceShutdown, ApplicationResourceShutdownSchema, type ApplicationShutdownResult, ApplicationShutdownResultSchema, type ApplicationSnapshot, ApplicationSnapshotSchema, type ApplicationStatusProjection, ApplicationStatusProjectionSchema, type ManagedResourceSnapshot, ManagedResourceSnapshotSchema, type ManagedResourceState, ManagedResourceStateSchema, projectApplicationStatus, } from './application/schemas.js';
|
|
11
|
+
export { type ManagedServerResource, type ManagedServerResourceConfig, managedServerResource, } from './application/server-resource.js';
|
|
12
12
|
//# sourceMappingURL=application.d.ts.map
|
package/dist/application.js
CHANGED
|
@@ -1,3 +1,6 @@
|
|
|
1
|
+
import {
|
|
2
|
+
createBoundedSinkManager
|
|
3
|
+
} from "./index-a59da114.js";
|
|
1
4
|
import {
|
|
2
5
|
ActivityIdSchema,
|
|
3
6
|
ActivityLiveStateSchema,
|
|
@@ -45,9 +48,6 @@ import {
|
|
|
45
48
|
projectApplicationStatus
|
|
46
49
|
} from "./index-8eywc9zv.js";
|
|
47
50
|
import"./index-dk6e56g0.js";
|
|
48
|
-
import {
|
|
49
|
-
createBoundedSinkManager
|
|
50
|
-
} from "./index-a59da114.js";
|
|
51
51
|
import"./index-0w9abg87.js";
|
|
52
52
|
// src/application/admission.ts
|
|
53
53
|
import { z } from "zod";
|
|
@@ -476,7 +476,7 @@ function managedServerResource(config) {
|
|
|
476
476
|
let shutdownPromise;
|
|
477
477
|
let started;
|
|
478
478
|
let startAttempted = false;
|
|
479
|
-
const resolveServer = () => typeof config.server === "function" ? config.server() : config.server;
|
|
479
|
+
const resolveServer = (context) => typeof config.server === "function" ? config.server(context) : config.server;
|
|
480
480
|
const isHandle = (value) => ("shutdown" in value);
|
|
481
481
|
const whole = (milliseconds, round) => Number.isFinite(milliseconds) ? Math.max(0, round(milliseconds)) : milliseconds;
|
|
482
482
|
const grace = (milliseconds) => whole(milliseconds, Math.floor);
|
|
@@ -487,7 +487,7 @@ function managedServerResource(config) {
|
|
|
487
487
|
const now = context.now();
|
|
488
488
|
const gracePeriodMs = phase === "force" ? 0 : context.deadlineAt === undefined ? undefined : grace(context.deadlineAt - now);
|
|
489
489
|
const forceTimeoutMs = context.forceDeadlineAt === undefined ? undefined : phase === "force" ? force(context.forceDeadlineAt - now) : force(context.forceDeadlineAt - (context.deadlineAt ?? now));
|
|
490
|
-
const server = started ?? (startAttempted ? undefined : resolveServer());
|
|
490
|
+
const server = started ?? (startAttempted ? undefined : resolveServer(context));
|
|
491
491
|
if (server === undefined) {
|
|
492
492
|
shutdownPromise = Promise.resolve(undefined);
|
|
493
493
|
return shutdownPromise;
|
|
@@ -508,9 +508,9 @@ function managedServerResource(config) {
|
|
|
508
508
|
id: config.id,
|
|
509
509
|
...config.dependsOn && { dependsOn: config.dependsOn },
|
|
510
510
|
...config.required !== undefined && { required: config.required },
|
|
511
|
-
async start() {
|
|
511
|
+
async start(context) {
|
|
512
512
|
startAttempted = true;
|
|
513
|
-
started = await resolveServer();
|
|
513
|
+
started = await resolveServer(context);
|
|
514
514
|
return { value: started };
|
|
515
515
|
},
|
|
516
516
|
stopAdmission(context) {
|
|
@@ -6,7 +6,7 @@
|
|
|
6
6
|
* the only genuinely subtle part, and keeping it together with its two guards
|
|
7
7
|
* makes that subtlety readable in one screen.
|
|
8
8
|
*/
|
|
9
|
-
import type { MultipartDescriptor, MultipartFile } from '../contract';
|
|
9
|
+
import type { MultipartDescriptor, MultipartFile } from '../contract/index.js';
|
|
10
10
|
/** A multipart file field — a `Blob` (web / Bun) or a platform descriptor (RN). */
|
|
11
11
|
export declare function isMultipartFile(value: unknown): value is MultipartFile;
|
|
12
12
|
/**
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import type { EndpointDef } from '../contract';
|
|
2
|
-
import type { ContractClientConfig } from './client';
|
|
1
|
+
import type { EndpointDef } from '../contract/index.js';
|
|
2
|
+
import type { ContractClientConfig } from './client.js';
|
|
3
3
|
export interface ClientRequestPlan {
|
|
4
4
|
relativeUrl: string;
|
|
5
5
|
remainingArgs: Record<string, unknown>;
|
package/dist/browser/client.d.ts
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
import type { ContractDef, EndpointDef, ScopedHttpClient, ScopedUrlBuilder } from '../contract';
|
|
2
|
-
import { type HttpClient as HttpAdapter, type UnauthorizedMatcher } from './http';
|
|
3
|
-
import type { ClientFetch } from './transport';
|
|
4
|
-
export type { ClientFetch } from './transport';
|
|
1
|
+
import type { ContractDef, EndpointDef, ScopedHttpClient, ScopedUrlBuilder } from '../contract/index.js';
|
|
2
|
+
import { type HttpClient as HttpAdapter, type UnauthorizedMatcher } from './http.js';
|
|
3
|
+
import type { ClientFetch } from './transport.js';
|
|
4
|
+
export type { ClientFetch } from './transport.js';
|
|
5
5
|
export interface ClientConfig {
|
|
6
6
|
baseUrl: string;
|
|
7
7
|
/** Override Web Fetch delivery while preserving the complete client pipeline. */
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"client.d.ts","sourceRoot":"","sources":["../../src/browser/client.ts"],"names":[],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CAOtC"}
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import type { ZodType } from 'zod';
|
|
2
|
-
import { type EndpointStreamDescriptor } from '../contract';
|
|
2
|
+
import { type EndpointStreamDescriptor } from '../contract/index.js';
|
|
3
3
|
/** Convert protocol frames into an immediately-owned schema-derived iterator. */
|
|
4
4
|
export declare function parseContractStream<T>(response: Response, descriptor: EndpointStreamDescriptor<ZodType<T>>, abort: () => void): AsyncIterableIterator<T>;
|
|
5
5
|
//# sourceMappingURL=contract-stream.d.ts.map
|
package/dist/browser/http.d.ts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import type { ErrorEnvelope } from '../contract';
|
|
2
|
-
import type { ClientFetch } from './transport';
|
|
1
|
+
import type { ErrorEnvelope } from '../contract/index.js';
|
|
2
|
+
import type { ClientFetch } from './transport.js';
|
|
3
3
|
export type ApiEvent = {
|
|
4
4
|
type: 'unauthorized';
|
|
5
5
|
} | {
|
|
@@ -16,7 +16,7 @@ export declare class ApiError extends Error {
|
|
|
16
16
|
readonly details?: unknown;
|
|
17
17
|
readonly hint?: string | undefined;
|
|
18
18
|
readonly traceId?: string | undefined;
|
|
19
|
-
constructor(code: string, status?: number, details?: unknown, message?: string, hint?: string | undefined, traceId?: string | undefined);
|
|
19
|
+
constructor(code: string, status?: number, details?: unknown, message?: string, hint?: string | undefined, traceId?: string | undefined, options?: ErrorOptions);
|
|
20
20
|
static is(error: unknown): error is ApiError;
|
|
21
21
|
}
|
|
22
22
|
/** @internal Narrow adapter for a Bun fetch error Ky does not classify. */
|
|
@@ -65,10 +65,10 @@ export interface HttpClientConfig {
|
|
|
65
65
|
/** Explicit Fetch-compatible transport, for example `createUnixClientTransport().fetch`. */
|
|
66
66
|
fetch?: ClientFetch;
|
|
67
67
|
/**
|
|
68
|
-
* Dial a unix domain socket instead of TCP (Bun runtime only
|
|
69
|
-
*
|
|
70
|
-
* required as the path/prefix source;
|
|
71
|
-
*
|
|
68
|
+
* Dial a unix domain socket instead of TCP (Bun runtime only). Other runtimes
|
|
69
|
+
* fail before dispatch; use `createUnixClientTransport().fetch` for the
|
|
70
|
+
* portable Bun/Node path. `baseUrl` stays required as the path/prefix source;
|
|
71
|
+
* its host is ignored by Bun's socket transport.
|
|
72
72
|
*/
|
|
73
73
|
unix?: string;
|
|
74
74
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"http.d.ts","sourceRoot":"","sources":["../../src/browser/http.ts"],"names":[],"mappings":"AAOA,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,aAAa,CAAC;AAKjD,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,aAAa,CAAC;AAE/C,MAAM,MAAM,QAAQ,GAChB;IAAE,IAAI,EAAE,cAAc,CAAA;CAAE,GACxB;IAAE,IAAI,EAAE,eAAe,CAAA;CAAE,GACzB;IAAE,IAAI,EAAE,QAAQ,CAAA;CAAE,CAAC;AAEvB,MAAM,MAAM,gBAAgB,GAAG,CAAC,KAAK,EAAE,QAAQ,KAAK,IAAI,CAAC;AAEzD,sEAAsE;AACtE,MAAM,MAAM,mBAAmB,GAAG,CAAC,QAAQ,EAAE,MAAM,KAAK,OAAO,CAAC;AAahE,qBAAa,QAAS,SAAQ,KAAK;aAEf,IAAI,EAAE,MAAM;aACZ,MAAM,EAAE,MAAM;aACd,OAAO,CAAC,EAAE,OAAO;aAEjB,IAAI,CAAC,EAAE,MAAM;aACb,OAAO,CAAC,EAAE,MAAM;IANlC,YACkB,IAAI,EAAE,MAAM,EACZ,MAAM,GAAE,MAAU,EAClB,OAAO,CAAC,EAAE,OAAO,EACjC,OAAO,CAAC,EAAE,MAAM,EACA,IAAI,CAAC,EAAE,MAAM,YAAA,EACb,OAAO,CAAC,EAAE,MAAM,YAAA,
|
|
1
|
+
{"version":3,"file":"http.d.ts","sourceRoot":"","sources":["../../src/browser/http.ts"],"names":[],"mappings":"AAOA,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,aAAa,CAAC;AA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client: `io()` config, connection-state machine, a typed
|
|
7
|
-
* `on/emit`, a connection-change subscription. `createSocketIOClient` is that
|
|
8
|
-
* shared kernel.
|
|
9
|
-
*
|
|
10
|
-
* Subscriptions are durable: `on()` registers a handler once and the client
|
|
11
|
-
* re-attaches it onto every socket it builds — so a handler survives an
|
|
12
|
-
* explicit `disconnect()` / `connect()` cycle, and (because re-attach happens
|
|
13
|
-
* before `socket.connect()`) no handshake-time event is ever missed. A thin
|
|
14
|
-
* per-project layer can therefore subscribe once at construction.
|
|
15
|
-
*
|
|
16
|
-
* Auth identity (`userId`, `clientId`) is project-specific — it arrives in an
|
|
17
|
-
* app `authenticated` event — so it stays in that per-project layer on top.
|
|
18
|
-
* This client owns only the transport: connection lifecycle + typed events.
|
|
19
|
-
*
|
|
20
|
-
* The returned client satisfies `CacheBridgeSocket` (`on()` returns an
|
|
21
|
-
* unsubscribe), so it plugs straight into `createCacheBridge`.
|
|
22
|
-
*/
|
|
23
|
-
import type { EventsMap } from '@socket.io/component-emitter';
|
|
24
|
-
import type { StitchLogger } from '../logger';
|
|
25
|
-
import type { RealtimeAcknowledgedEvent, RealtimeAcknowledgement, RealtimeContract, RealtimeEventRegistry, RealtimeRejectedEventHook, RealtimeRequestArguments } from '../realtime/contract';
|
|
26
|
-
import { type RealtimeRequestOptions } from '../realtime/request';
|
|
27
|
-
import { type ValidatedRealtimeSocket } from '../realtime/socket';
|
|
1
|
+
import type { StitchLogger } from '../logger.js';
|
|
2
|
+
import type { RealtimeAcknowledgedEvent, RealtimeAcknowledgement, RealtimeContract, RealtimeEventRegistry, RealtimeRejectedEventHook, RealtimeRequestArguments } from '../realtime/contract.js';
|
|
3
|
+
import { type RealtimeRequestOptions } from '../realtime/request.js';
|
|
4
|
+
import { type ValidatedRealtimeSocket } from '../realtime/socket.js';
|
|
28
5
|
/**
|
|
29
6
|
* How this project loads the optional Socket.IO **client** peer.
|
|
30
7
|
*
|
|
@@ -67,12 +44,16 @@ export interface SocketIOClientPeerLoaders {
|
|
|
67
44
|
}
|
|
68
45
|
/**
|
|
69
46
|
* Socket.IO event map — `{ event: (...args) => void }`. Aliases Socket.IO's
|
|
70
|
-
* own
|
|
47
|
+
* own event-map constraint, which intentionally maps to `any`: that is what
|
|
71
48
|
* lets a plain `interface ServerToClientEvents { … }` (no index signature) be
|
|
72
|
-
* passed as a type argument.
|
|
73
|
-
*
|
|
49
|
+
* passed as a type argument. The constraint lives here instead of importing
|
|
50
|
+
* Socket.IO's equivalent: the root HTTP client declarations must remain usable
|
|
51
|
+
* when no optional Socket.IO peer is installed. Per-event typing is fully
|
|
52
|
+
* preserved on the public `on` / `emit` signatures.
|
|
74
53
|
*/
|
|
75
|
-
export
|
|
54
|
+
export interface SocketEventMap {
|
|
55
|
+
[event: string]: any;
|
|
56
|
+
}
|
|
76
57
|
export interface SocketIOClientConfig<TServerEvents extends SocketEventMap = SocketEventMap> {
|
|
77
58
|
/** Server origin, e.g. `https://api.example.com`. */
|
|
78
59
|
url: string;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"socket-io.d.ts","sourceRoot":"","sources":["../../src/browser/socket-io.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"socket-io.d.ts","sourceRoot":"","sources":["../../src/browser/socket-io.ts"],"names":[],"mappings":"AAuBA,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,WAAW,CAAC;AAC9C,OAAO,KAAK,EACV,yBAAyB,EACzB,uBAAuB,EACvB,gBAAgB,EAChB,qBAAqB,EACrB,yBAAyB,EACzB,wBAAwB,EACzB,MAAM,sBAAsB,CAAC;AAC9B,OAAO,EAEL,KAAK,sBAAsB,EAE5B,MAAM,qBAAqB,CAAC;AAC7B,OAAO,EAIL,KAAK,uBAAuB,EAC7B,MAAM,oBAAoB,CAAC;AAkB5B;;;;;;;;;;;;;;;;;;;;;;;;GAwBG;AACH,MAAM,WAAW,yBAAyB;IACxC;;;;;;;;;;;OAWG;IACH,MAAM,CAAC,EAAE,MAA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,iGAAiG;AACjG,wBAAgB,kBAAkB,CAChC,KAAK,CAAC,eAAe,SAAS,qBAAqB,EACnD,KAAK,CAAC,eAAe,SAAS,qBAAqB,EAEnD,QAAQ,EAAE,gBAAgB,CAAC,eAAe,EAAE,eAAe,CAAC,EAC5D,SAAS,EAAE,uBAAuB,EAClC,EAAE,UAAU,EAAE,MAAM,EAAE,GAAE,yBAA8B,GACrD,mBAAmB,CAAC,eAAe,EAAE,eAAe,CAAC,CA2EvD;AAED,wBAAgB,oBAAoB,CAClC,KAAK,CAAC,eAAe,SAAS,qBAAqB,EACnD,KAAK,CAAC,eAAe,SAAS,qBAAqB,EAEnD,QAAQ,EAAE,gBAAgB,CAAC,eAAe,EAAE,eAAe,CAAC,EAC5D,EAAE,UAAU,EAAE,MAAM,EAAE,GAAG,MAAM,EAAE,EAAE,qBAAqB,CAAC,eAAe,CAAC,GACxE,cAAc,CAAC,eAAe,EAAE,eAAe,CAAC,CAWlD;AAED,wBAAgB,oBAAoB,CAClC,aAAa,SAAS,cAAc,EACpC,aAAa,SAAS,cAAc,EACpC,MAAM,EAAE,oBAAoB,CAAC,aAAa,CAAC,GAAG,cAAc,CAAC,aAAa,EAAE,aAAa,CAAC,CAgR3F"}
|
package/dist/browser/stream.d.ts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
export { type ParseSSEOptions, parseSSE } from '../server/stream';
|
|
2
|
-
export { DEFAULT_STREAM_LINE_BYTES } from '../internal/bounded-lines';
|
|
1
|
+
export { type ParseSSEOptions, parseSSE } from '../server/stream.js';
|
|
2
|
+
export { DEFAULT_STREAM_LINE_BYTES } from '../internal/bounded-lines.js';
|
|
3
3
|
/** Options for `parseNDJSON`. */
|
|
4
4
|
export interface ParseNDJSONOptions {
|
|
5
5
|
/** Maximum bytes retained for one line. Default 1 MiB. */
|
package/dist/cli.d.ts
CHANGED
|
@@ -16,10 +16,10 @@
|
|
|
16
16
|
*
|
|
17
17
|
* and point your app's `package.json` `bin` at it.
|
|
18
18
|
*/
|
|
19
|
-
export { type CliConfig, type CliSurfaceSource, createCli } from './tools/cli';
|
|
20
|
-
export { type CliRunOptions, type ParsedCliArgs, parseCliArgs } from './tools/cli-args';
|
|
21
|
-
export { type CliCommandContext, type CliCommandDefinition, type CliCommandDefinitionBase, type CliCommandDefinitionWithOutput, type CliCommandDefinitionWithoutOutput, defineCliCommand, } from './tools/cli-command';
|
|
22
|
-
export { type CliWriters, DEFAULT_EXIT_CODES, type EmitOptions, type ExitCodeMap, emitResult, } from './tools/cli-format';
|
|
23
|
-
export type { CliPresentationPolicyConfig } from './tools/cli-policy';
|
|
24
|
-
export { type CliWaitConfig, type PollParams, pollUntilDone } from './tools/cli-wait';
|
|
19
|
+
export { type CliConfig, type CliSurfaceSource, createCli } from './tools/cli.js';
|
|
20
|
+
export { type CliRunOptions, type ParsedCliArgs, parseCliArgs } from './tools/cli-args.js';
|
|
21
|
+
export { type CliCommandContext, type CliCommandDefinition, type CliCommandDefinitionBase, type CliCommandDefinitionWithOutput, type CliCommandDefinitionWithoutOutput, defineCliCommand, } from './tools/cli-command.js';
|
|
22
|
+
export { type CliWriters, DEFAULT_EXIT_CODES, type EmitOptions, type ExitCodeMap, emitResult, } from './tools/cli-format.js';
|
|
23
|
+
export type { CliPresentationPolicyConfig } from './tools/cli-policy.js';
|
|
24
|
+
export { type CliWaitConfig, type PollParams, pollUntilDone } from './tools/cli-wait.js';
|
|
25
25
|
//# sourceMappingURL=cli.d.ts.map
|
package/dist/cli.js
CHANGED
|
@@ -5,13 +5,14 @@ import {
|
|
|
5
5
|
emitResult,
|
|
6
6
|
parseCliArgs,
|
|
7
7
|
pollUntilDone
|
|
8
|
-
} from "./index-
|
|
9
|
-
import"./index-
|
|
8
|
+
} from "./index-cszjsxy5.js";
|
|
9
|
+
import"./index-7etq650s.js";
|
|
10
|
+
import"./index-cz32amcb.js";
|
|
11
|
+
import"./index-69m2278y.js";
|
|
10
12
|
import"./index-sbdmyz75.js";
|
|
11
13
|
import"./index-vkk06pv1.js";
|
|
12
14
|
import"./index-6djpbnda.js";
|
|
13
15
|
import"./index-cby4ar3v.js";
|
|
14
|
-
import"./index-69m2278y.js";
|
|
15
16
|
import"./index-9ky9hhg3.js";
|
|
16
17
|
import"./index-smpbdg6k.js";
|
|
17
18
|
import"./index-0w9abg87.js";
|
|
@@ -22,7 +22,7 @@
|
|
|
22
22
|
* ```
|
|
23
23
|
*/
|
|
24
24
|
import { z } from 'zod';
|
|
25
|
-
import { AppError } from './errors';
|
|
25
|
+
import { AppError } from './errors.js';
|
|
26
26
|
/** Supported structured-details schemas: a required or optional Zod object. */
|
|
27
27
|
export type ErrorDetailsSchema = z.ZodObject | z.ZodOptional<z.ZodObject>;
|
|
28
28
|
/**
|
|
@@ -20,7 +20,7 @@
|
|
|
20
20
|
* The returned contracts are ordinary `ContractDef`s — `implement`, `createClient`
|
|
21
21
|
* and the tool mounts treat them exactly as before.
|
|
22
22
|
*/
|
|
23
|
-
import type { ContractDef, ContractMeta, EndpointDef, Transport } from './define';
|
|
23
|
+
import type { ContractDef, ContractMeta, EndpointDef, Transport } from './define.js';
|
|
24
24
|
export type ContractFactoryToolExposure = 'explicit';
|
|
25
25
|
export interface ContractFactoryConfig {
|
|
26
26
|
/** Missing endpoint `expose` becomes HTTP-only; every tool surface is opt-in. */
|
package/dist/contract/index.d.ts
CHANGED
|
@@ -1,8 +1,8 @@
|
|
|
1
|
-
export { ALL_TRANSPORTS, type BodyHttpSuccessStatus, type ClientRequestOptions, type ContractDef, type ContractMeta, defineContract, type EndpointDef, type EndpointFn, type EndpointMcpInputRequired, type EndpointMcpPolicy, type EndpointResponseMeta, type EndpointStreamDescriptor, type EndpointToolAnnotations, type EndpointUiMeta, type FileDescriptor, type HandlerContext, type HeadEndpointDef, type HttpMethod, type HttpSuccessStatus, type McpCallContext, type McpClientInfo, type McpRoundOutcome, type MultipartBufferedFiles, type MultipartDescriptor, type MultipartFile, type MultipartFilePolicy, type ResponseMetadata, type RuntimeContext, type ScopedEndpointFn, type ScopedHttpClient, type ScopedUrlBuilder, type ScopedUrlFn, type Transport, type TransportSource, type TypedClient, type TypedHttpClient, type TypedUrlBuilder, } from './define';
|
|
2
|
-
export { AppError, appError, badRequest, conflict, type ErrorEnvelope, forbidden, isStitchErrorCode, notFound, rateLimited, STITCH_ERROR_STATUS, type StitchErrorCode, unauthorized, } from './errors';
|
|
3
|
-
export { type DefinedAppError, type DefinedErrors, defineErrors, type ErrorDefinition, type ErrorDefinitions, type ErrorDetailsOutput, type ErrorDetailsSchema, type ErrorFactories, type ErrorFactory, type ErrorFactoryArguments, type FrozenErrorDefinitions, } from './errors-factory';
|
|
4
|
-
export { type ContractFactoryConfig, type ContractFactoryToolExposure, createContractFactory, type ExplicitScopedDefineContract, type ExplicitToolExposureEndpoints, type FactoryScopedEndpoint, type ScopedContractDef, type ScopedDefineContract, } from './factory';
|
|
5
|
-
export { type ManagedFilePath, ManagedFilePathSchema, type ManagedFileRef, ManagedFileRefSchema, } from './file-ref';
|
|
6
|
-
export { decodeCursor, encodeCursor, type Paginated, paginatedSchema, } from './pagination';
|
|
7
|
-
export { type ContractStreamFrame, ContractStreamFrameSchema, DEFAULT_CONTRACT_STREAM_FRAME_BYTES, } from './stream';
|
|
1
|
+
export { ALL_TRANSPORTS, type BodyHttpSuccessStatus, type ClientRequestOptions, type ContractDef, type ContractMeta, defineContract, type EndpointDef, type EndpointFn, type EndpointMcpInputRequired, type EndpointMcpPolicy, type EndpointResponseMeta, type EndpointStreamDescriptor, type EndpointToolAnnotations, type EndpointUiMeta, type FileDescriptor, type HandlerContext, type HeadEndpointDef, type HttpMethod, type HttpSuccessStatus, type McpCallContext, type McpClientInfo, type McpRoundOutcome, type MultipartBufferedFiles, type MultipartDescriptor, type MultipartFile, type MultipartFilePolicy, type ResponseMetadata, type RuntimeContext, type ScopedEndpointFn, type ScopedHttpClient, type ScopedUrlBuilder, type ScopedUrlFn, type Transport, type TransportSource, type TypedClient, type TypedHttpClient, type TypedUrlBuilder, } from './define.js';
|
|
2
|
+
export { AppError, appError, badRequest, conflict, type ErrorEnvelope, forbidden, isStitchErrorCode, notFound, rateLimited, STITCH_ERROR_STATUS, type StitchErrorCode, unauthorized, } from './errors.js';
|
|
3
|
+
export { type DefinedAppError, type DefinedErrors, defineErrors, type ErrorDefinition, type ErrorDefinitions, type ErrorDetailsOutput, type ErrorDetailsSchema, type ErrorFactories, type ErrorFactory, type ErrorFactoryArguments, type FrozenErrorDefinitions, } from './errors-factory.js';
|
|
4
|
+
export { type ContractFactoryConfig, type ContractFactoryToolExposure, createContractFactory, type ExplicitScopedDefineContract, type ExplicitToolExposureEndpoints, type FactoryScopedEndpoint, type ScopedContractDef, type ScopedDefineContract, } from './factory.js';
|
|
5
|
+
export { type ManagedFilePath, ManagedFilePathSchema, type ManagedFileRef, ManagedFileRefSchema, } from './file-ref.js';
|
|
6
|
+
export { decodeCursor, encodeCursor, type Paginated, paginatedSchema, } from './pagination.js';
|
|
7
|
+
export { type ContractStreamFrame, ContractStreamFrameSchema, DEFAULT_CONTRACT_STREAM_FRAME_BYTES, } from './stream.js';
|
|
8
8
|
//# sourceMappingURL=index.d.ts.map
|
package/dist/files/boundary.d.ts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { type ManagedFileRef } from '../contract/file-ref';
|
|
1
|
+
import { type ManagedFileRef } from '../contract/file-ref.js';
|
|
2
2
|
export type ManagedFileErrorCode = 'FILE_INVALID_PATH' | 'FILE_NOT_FOUND' | 'FILE_NOT_REGULAR' | 'FILE_OUTSIDE_ROOT' | 'FILE_TOO_LARGE' | 'FILE_EXISTS' | 'FILE_INSPECTION_REJECTED' | 'FILE_IO_ERROR';
|
|
3
3
|
export declare class ManagedFileError extends Error {
|
|
4
4
|
readonly code: ManagedFileErrorCode;
|
package/dist/files.d.ts
CHANGED
|
@@ -1,3 +1,3 @@
|
|
|
1
|
-
export { type ManagedFilePath, ManagedFilePathSchema, type ManagedFileRef, ManagedFileRefSchema, } from './contract/file-ref';
|
|
2
|
-
export { createManagedFileBoundary, type ManagedFileBoundary, type ManagedFileBoundaryConfig, ManagedFileError, type ManagedFileErrorCode, type ManagedFileInspection, type ManagedFileInspectionInput, type ManagedFileInspector, type ManagedFileReadOptions, type ManagedFileSource, type ManagedFileWriteOptions, } from './files/boundary';
|
|
1
|
+
export { type ManagedFilePath, ManagedFilePathSchema, type ManagedFileRef, ManagedFileRefSchema, } from './contract/file-ref.js';
|
|
2
|
+
export { createManagedFileBoundary, type ManagedFileBoundary, type ManagedFileBoundaryConfig, ManagedFileError, type ManagedFileErrorCode, type ManagedFileInspection, type ManagedFileInspectionInput, type ManagedFileInspector, type ManagedFileReadOptions, type ManagedFileSource, type ManagedFileWriteOptions, } from './files/boundary.js';
|
|
3
3
|
//# sourceMappingURL=files.d.ts.map
|
|
@@ -255,8 +255,8 @@ class ApiError extends Error {
|
|
|
255
255
|
details;
|
|
256
256
|
hint;
|
|
257
257
|
traceId;
|
|
258
|
-
constructor(code, status = 0, details, message, hint, traceId) {
|
|
259
|
-
super(message ?? `API Error: ${code}
|
|
258
|
+
constructor(code, status = 0, details, message, hint, traceId, options) {
|
|
259
|
+
super(message ?? `API Error: ${code}`, options);
|
|
260
260
|
this.code = code;
|
|
261
261
|
this.status = status;
|
|
262
262
|
this.details = details;
|
|
@@ -547,7 +547,7 @@ function createFetchExecutor(endpoint, prefix, config, contractConfig) {
|
|
|
547
547
|
if (ApiError.is(error))
|
|
548
548
|
throw error;
|
|
549
549
|
const message = error instanceof Error ? error.message : undefined;
|
|
550
|
-
throw new ApiError("UNKNOWN_ERROR", 0, message ? { message } : undefined, message);
|
|
550
|
+
throw new ApiError("UNKNOWN_ERROR", 0, message ? { message } : undefined, message, undefined, undefined, { cause: error });
|
|
551
551
|
}
|
|
552
552
|
};
|
|
553
553
|
}
|