@kitman-sh/sdk 0.0.0-stage → 0.7.0
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/build/index.js +215 -0
- package/dist/chunk-7hwhxthh.js +1055 -0
- package/dist/chunk-zp7s46pz.js +3966 -0
- package/dist/loop/index.js +193 -0
- package/dist/program/index.js +30 -0
- package/package.json +29 -4
- package/types/packages/core/src/a2a.d.ts +577 -0
- package/types/packages/core/src/agent-capabilities.d.ts +1434 -0
- package/types/packages/core/src/agent-environment.d.ts +2429 -0
- package/types/packages/core/src/agent-launch-snapshot.d.ts +44 -0
- package/types/packages/core/src/agent-sandbox-policy.d.ts +33 -0
- package/types/packages/core/src/approval-queue.d.ts +126 -0
- package/types/packages/core/src/audit.d.ts +52 -0
- package/types/packages/core/src/change-delivery.d.ts +39 -0
- package/types/packages/core/src/change-request-review.d.ts +146 -0
- package/types/packages/core/src/change-request.d.ts +432 -0
- package/types/packages/core/src/common.d.ts +6 -0
- package/types/packages/core/src/connection.d.ts +33 -0
- package/types/packages/core/src/context-feedback.d.ts +89 -0
- package/types/packages/core/src/context-pack.d.ts +182 -0
- package/types/packages/core/src/crypto.d.ts +11 -0
- package/types/packages/core/src/data-lifecycle.d.ts +195 -0
- package/types/packages/core/src/decision.d.ts +48 -0
- package/types/packages/core/src/delivery-operation.d.ts +125 -0
- package/types/packages/core/src/delivery-policy.d.ts +174 -0
- package/types/packages/core/src/engineering-resources.d.ts +26 -0
- package/types/packages/core/src/enterprise-code-host.d.ts +18 -0
- package/types/packages/core/src/epic-delivery.d.ts +38 -0
- package/types/packages/core/src/extension.d.ts +35 -0
- package/types/packages/core/src/external-effect.d.ts +313 -0
- package/types/packages/core/src/fix-flow.d.ts +149 -0
- package/types/packages/core/src/following.d.ts +59 -0
- package/types/packages/core/src/github-delivery-fixtures.d.ts +28 -0
- package/types/packages/core/src/github-delivery.d.ts +78 -0
- package/types/packages/core/src/gitlab-delivery-fixtures.d.ts +26 -0
- package/types/packages/core/src/gitlab-delivery.d.ts +76 -0
- package/types/packages/core/src/global-search.d.ts +42 -0
- package/types/packages/core/src/id.d.ts +1 -0
- package/types/packages/core/src/index.d.ts +74 -0
- package/types/packages/core/src/integration.d.ts +255 -0
- package/types/packages/core/src/intent.d.ts +260 -0
- package/types/packages/core/src/json.d.ts +10 -0
- package/types/packages/core/src/kit-taxonomy.d.ts +21 -0
- package/types/packages/core/src/kit.d.ts +1489 -0
- package/types/packages/core/src/live.d.ts +8309 -0
- package/types/packages/core/src/loop-layers.d.ts +59 -0
- package/types/packages/core/src/loop-version.d.ts +59 -0
- package/types/packages/core/src/loop.d.ts +3076 -0
- package/types/packages/core/src/me.d.ts +31 -0
- package/types/packages/core/src/memory.d.ts +88 -0
- package/types/packages/core/src/my-teams.d.ts +1230 -0
- package/types/packages/core/src/notification.d.ts +181 -0
- package/types/packages/core/src/observability.d.ts +175 -0
- package/types/packages/core/src/package-declarations.d.ts +435 -0
- package/types/packages/core/src/package.d.ts +369 -0
- package/types/packages/core/src/personal-development-profile.d.ts +11 -0
- package/types/packages/core/src/platform-release.d.ts +60 -0
- package/types/packages/core/src/program-credential.d.ts +10 -0
- package/types/packages/core/src/project.d.ts +66 -0
- package/types/packages/core/src/proposal.d.ts +292 -0
- package/types/packages/core/src/provider-safe-text.d.ts +2 -0
- package/types/packages/core/src/redaction.d.ts +73 -0
- package/types/packages/core/src/repo-binding.d.ts +131 -0
- package/types/packages/core/src/run-journal.d.ts +28 -0
- package/types/packages/core/src/run-launch.d.ts +67 -0
- package/types/packages/core/src/run.d.ts +566 -0
- package/types/packages/core/src/runner-eligibility.d.ts +43 -0
- package/types/packages/core/src/runner-routing.d.ts +11 -0
- package/types/packages/core/src/runner-trust.d.ts +67 -0
- package/types/packages/core/src/runner.d.ts +3750 -0
- package/types/packages/core/src/runtime-type.d.ts +36 -0
- package/types/packages/core/src/schedule.d.ts +136 -0
- package/types/packages/core/src/schema.d.ts +89 -0
- package/types/packages/core/src/scope-directory.d.ts +100 -0
- package/types/packages/core/src/secret.d.ts +37 -0
- package/types/packages/core/src/session.d.ts +90 -0
- package/types/packages/core/src/step-brief.d.ts +50 -0
- package/types/packages/core/src/sync-kit.d.ts +587 -0
- package/types/packages/core/src/task-detail.d.ts +491 -0
- package/types/packages/core/src/task-execution-record.d.ts +620 -0
- package/types/packages/core/src/task-key.d.ts +9 -0
- package/types/packages/core/src/task.d.ts +543 -0
- package/types/packages/core/src/trigger-dispatch.d.ts +421 -0
- package/types/packages/core/src/work-unit.d.ts +740 -0
- package/types/packages/core/src/workspace.d.ts +96 -0
- package/types/packages/live/src/rpc/runner-client.d.ts +947 -0
- package/types/packages/live/src/rpc/runner-group.d.ts +733 -0
- package/types/packages/sdk/src/build/index.d.ts +45 -0
- package/types/packages/sdk/src/loop/activities.d.ts +187 -0
- package/types/packages/sdk/src/loop/check.d.ts +39 -0
- package/types/packages/sdk/src/loop/config.d.ts +68 -0
- package/types/packages/sdk/src/loop/define.d.ts +76 -0
- package/types/packages/sdk/src/loop/evidence.d.ts +66 -0
- package/types/packages/sdk/src/loop/index.d.ts +9 -0
- package/types/packages/sdk/src/loop/plan.d.ts +43 -0
- package/types/packages/sdk/src/loop/review.d.ts +86 -0
- package/types/packages/sdk/src/loop/steps.d.ts +224 -0
- package/types/packages/sdk/src/loop/test-loop.d.ts +112 -0
- package/types/packages/sdk/src/program/engine.d.ts +144 -0
- package/types/packages/sdk/src/program/host.d.ts +70 -0
- package/types/packages/sdk/src/program/index.d.ts +2 -0
- package/README.md +0 -3
|
@@ -0,0 +1,36 @@
|
|
|
1
|
+
type RuntimeTypeName = 'bigint' | 'boolean' | 'function' | 'number' | 'object' | 'string' | 'symbol' | 'undefined';
|
|
2
|
+
type JsonPrimitive = null | boolean | number | string;
|
|
3
|
+
export type JsonValue = JsonPrimitive | readonly JsonValue[] | JsonObject;
|
|
4
|
+
export type JsonObject = {
|
|
5
|
+
readonly [key: string]: JsonValue;
|
|
6
|
+
};
|
|
7
|
+
/** In-memory structured data, before normalization for a JSON boundary. */
|
|
8
|
+
export type StructuredValue = JsonValue | undefined | Date | readonly StructuredValue[] | StructuredObject;
|
|
9
|
+
export type StructuredObject = {
|
|
10
|
+
readonly [key: string]: StructuredValue;
|
|
11
|
+
};
|
|
12
|
+
/** Normalize a JavaScript value into data that serializes without information loss. */
|
|
13
|
+
export declare function toJsonValue<ValueType>(value: ValueType): JsonValue;
|
|
14
|
+
/** Narrow a value to one member of a readonly literal list. */
|
|
15
|
+
export declare function isOneOf<const Literal extends string | number, Value>(values: readonly Literal[], value: Value): value is Value & Literal;
|
|
16
|
+
/** Narrow a value to one member of a readonly literal set. */
|
|
17
|
+
export declare function isMemberOf<const Literal extends string | number, Value>(values: ReadonlySet<Literal>, value: Value): value is Value & Literal;
|
|
18
|
+
/** Narrow a property key to an own key of a lookup record. */
|
|
19
|
+
export declare function isKeyOf<Lookup extends object>(record: Lookup, key: PropertyKey): key is keyof Lookup;
|
|
20
|
+
/** Read an own data property of untrusted input as JSON; undefined when missing or not JSON. */
|
|
21
|
+
export declare function jsonProperty<Value extends object>(value: Value, key: string): JsonValue | undefined;
|
|
22
|
+
export declare function toJsonObject<ValueType>(value: ValueType): JsonObject;
|
|
23
|
+
type RuntimeNarrow<Value, Target, Fallback = Target> = [Extract<Value, Target>] extends [never] ? Value & Fallback : Extract<Value, Target>;
|
|
24
|
+
/** Runtime predicates for values entering an untyped boundary. */
|
|
25
|
+
export declare function isBigInt<Value>(value: Value): value is RuntimeNarrow<Value, bigint>;
|
|
26
|
+
export declare function isBoolean<Value>(value: Value): value is RuntimeNarrow<Value, boolean>;
|
|
27
|
+
export declare function isFunction<Value>(value: Value): value is RuntimeNarrow<Value, globalThis.Function>;
|
|
28
|
+
export declare function isNumber<Value>(value: Value): value is RuntimeNarrow<Value, number>;
|
|
29
|
+
export declare function isObject<Value>(value: Value): value is Value & object;
|
|
30
|
+
export declare function isJsonObject(value: JsonValue | undefined): value is JsonObject;
|
|
31
|
+
export declare function isString<Value>(value: Value): value is RuntimeNarrow<Value, string>;
|
|
32
|
+
export declare function isSymbol<Value>(value: Value): value is RuntimeNarrow<Value, symbol>;
|
|
33
|
+
export declare function isUndefined<Value>(value: Value): value is RuntimeNarrow<Value, undefined>;
|
|
34
|
+
/** Return the ECMAScript runtime category after checking every primitive schema. */
|
|
35
|
+
export declare function kindOf<Value>(value: Value): RuntimeTypeName;
|
|
36
|
+
export {};
|
|
@@ -0,0 +1,136 @@
|
|
|
1
|
+
import * as Schema from 'effect/Schema';
|
|
2
|
+
import type { TriggerIngress } from './trigger-dispatch';
|
|
3
|
+
import { SafeJson } from './run';
|
|
4
|
+
export declare const ScheduleMisfirePolicies: readonly ['skip', 'fire_once', 'catch_up'];
|
|
5
|
+
export type ScheduleMisfirePolicy = (typeof ScheduleMisfirePolicies)[number];
|
|
6
|
+
export declare const ScheduleOverlapPolicies: readonly ['allow', 'skip', 'coalesce'];
|
|
7
|
+
export type ScheduleOverlapPolicy = (typeof ScheduleOverlapPolicies)[number];
|
|
8
|
+
export declare const ScheduleVersionStatuses: readonly ['draft', 'published', 'disabled', 'archived'];
|
|
9
|
+
declare const ScheduleDispositions: readonly ['on_time', 'catch_up', 'catch_up_bounded', 'misfire_skipped', 'dst_gap_skipped', 'overlap_skipped', 'overlap_coalesced'];
|
|
10
|
+
export type ScheduleDisposition = (typeof ScheduleDispositions)[number];
|
|
11
|
+
export declare const ScheduleRule: Schema.Union<readonly [Schema.Struct<{
|
|
12
|
+
readonly frequency: Schema.Literals<readonly ["daily", "weekly"]>;
|
|
13
|
+
readonly hour: Schema.Int;
|
|
14
|
+
readonly minute: Schema.Int;
|
|
15
|
+
readonly second: Schema.optionalKey<Schema.Int>;
|
|
16
|
+
readonly daysOfWeek: Schema.optionalKey<Schema.$Array<Schema.Int>>;
|
|
17
|
+
}>, Schema.Struct<{
|
|
18
|
+
readonly cron: Schema.String;
|
|
19
|
+
}>]>;
|
|
20
|
+
export type ScheduleRule = (typeof ScheduleRule)['Type'];
|
|
21
|
+
/** Whether `value` is a Schedule rule: a calendar rule, or cron whose every field is in range. */
|
|
22
|
+
export declare function isScheduleRule(value: unknown): value is ScheduleRule;
|
|
23
|
+
export declare const ScheduleVersion: Schema.Struct<{
|
|
24
|
+
readonly contractVersion: Schema.Literal<"schedule.v1">;
|
|
25
|
+
readonly id: Schema.String;
|
|
26
|
+
readonly scheduleId: Schema.String;
|
|
27
|
+
readonly workspaceId: Schema.String;
|
|
28
|
+
readonly projectId: Schema.optionalKey<Schema.String>;
|
|
29
|
+
/** New versions bind one stable Loop; historical rows may not have a binding. */
|
|
30
|
+
readonly loopId: Schema.optionalKey<Schema.String>;
|
|
31
|
+
readonly name: Schema.optionalKey<Schema.String>;
|
|
32
|
+
readonly version: Schema.Int;
|
|
33
|
+
readonly status: Schema.Literals<readonly ["draft", "published", "disabled", "archived"]>;
|
|
34
|
+
readonly timezone: Schema.String;
|
|
35
|
+
readonly rule: Schema.Union<readonly [Schema.Struct<{
|
|
36
|
+
readonly frequency: Schema.Literals<readonly ["daily", "weekly"]>;
|
|
37
|
+
readonly hour: Schema.Int;
|
|
38
|
+
readonly minute: Schema.Int;
|
|
39
|
+
readonly second: Schema.optionalKey<Schema.Int>;
|
|
40
|
+
readonly daysOfWeek: Schema.optionalKey<Schema.$Array<Schema.Int>>;
|
|
41
|
+
}>, Schema.Struct<{
|
|
42
|
+
readonly cron: Schema.String;
|
|
43
|
+
}>]>;
|
|
44
|
+
readonly misfirePolicy: Schema.Literals<readonly ["skip", "fire_once", "catch_up"]>;
|
|
45
|
+
readonly overlapPolicy: Schema.Literals<readonly ["allow", "skip", "coalesce"]>;
|
|
46
|
+
readonly maxCatchUp: Schema.Int;
|
|
47
|
+
readonly misfireGraceSeconds: Schema.optionalKey<Schema.Int>;
|
|
48
|
+
readonly inputSchemaRef: Schema.optionalKey<Schema.Struct<{
|
|
49
|
+
readonly kind: Schema.Literal<"typebox_ref">;
|
|
50
|
+
readonly name: Schema.String;
|
|
51
|
+
readonly version: Schema.optionalKey<Schema.String>;
|
|
52
|
+
readonly sha256: Schema.optionalKey<Schema.String>;
|
|
53
|
+
}>>;
|
|
54
|
+
readonly input: Schema.optionalKey<Schema.Codec<SafeJson, SafeJson, never, never>>;
|
|
55
|
+
readonly createdAt: Schema.String;
|
|
56
|
+
}>;
|
|
57
|
+
export type ScheduleVersion = (typeof ScheduleVersion)['Type'];
|
|
58
|
+
export interface ScheduleCursor {
|
|
59
|
+
readonly lastEvaluatedAt?: string;
|
|
60
|
+
readonly lastFireKey?: string;
|
|
61
|
+
readonly resourceVersion?: number;
|
|
62
|
+
}
|
|
63
|
+
export declare function scheduleDefinitionDigest(version: Pick<ScheduleVersion, 'timezone' | 'rule' | 'misfirePolicy' | 'overlapPolicy' | 'maxCatchUp' | 'misfireGraceSeconds' | 'loopId'> & Partial<Pick<ScheduleVersion, 'status' | 'inputSchemaRef' | 'input' | 'name'>>): string;
|
|
64
|
+
interface FireIdentityInput {
|
|
65
|
+
readonly scheduleId: string;
|
|
66
|
+
readonly scheduleVersion: number;
|
|
67
|
+
readonly bindingId: string;
|
|
68
|
+
readonly localDate: string;
|
|
69
|
+
readonly localTime: string;
|
|
70
|
+
readonly fold: 0 | 1;
|
|
71
|
+
}
|
|
72
|
+
export declare function fireIdentity(input: FireIdentityInput): string;
|
|
73
|
+
type ResolvedLocalDateTime = {
|
|
74
|
+
readonly kind: 'gap';
|
|
75
|
+
readonly instants: readonly [];
|
|
76
|
+
} | {
|
|
77
|
+
readonly kind: 'unique';
|
|
78
|
+
readonly instants: readonly [Date];
|
|
79
|
+
} | {
|
|
80
|
+
readonly kind: 'fold';
|
|
81
|
+
readonly instants: readonly [Date, Date];
|
|
82
|
+
};
|
|
83
|
+
/**
|
|
84
|
+
* Resolve a wall-clock time without silently normalizing gaps or folds. Each Schedule Host tick re-enumerates the days
|
|
85
|
+
* around now for every Schedule, and each resolution costs several Intl calls, so resolutions are kept.
|
|
86
|
+
*/
|
|
87
|
+
export declare function resolveLocalDateTime(timezone: string, date: string, time: string): ResolvedLocalDateTime;
|
|
88
|
+
export interface ScheduleCandidate {
|
|
89
|
+
readonly fireKey: string;
|
|
90
|
+
readonly scheduleId: string;
|
|
91
|
+
readonly scheduleVersion: number;
|
|
92
|
+
readonly bindingId: string;
|
|
93
|
+
readonly timezone: string;
|
|
94
|
+
readonly localDate: string;
|
|
95
|
+
readonly localTime: string;
|
|
96
|
+
readonly fold: 0 | 1;
|
|
97
|
+
readonly scheduledAt?: string;
|
|
98
|
+
readonly resolution: 'unique' | 'fold' | 'gap';
|
|
99
|
+
}
|
|
100
|
+
/**
|
|
101
|
+
* Create one explicit test occurrence without advancing or colliding with the
|
|
102
|
+
* Schedule's normal calendar binding. Repeating a request with the same key
|
|
103
|
+
* produces the same durable Event identity.
|
|
104
|
+
*/
|
|
105
|
+
export declare function scheduleTestCandidate(input: {
|
|
106
|
+
readonly version: ScheduleVersion;
|
|
107
|
+
readonly idempotencyKey: string;
|
|
108
|
+
readonly requestedAt: string;
|
|
109
|
+
}): ScheduleCandidate;
|
|
110
|
+
/** Enumerate deterministic local-time candidates. Fold candidates are deliberately separate fires. */
|
|
111
|
+
export declare function enumerateScheduleCandidates(input: {
|
|
112
|
+
readonly version: ScheduleVersion;
|
|
113
|
+
readonly bindingId: string;
|
|
114
|
+
readonly from: string;
|
|
115
|
+
readonly to: string;
|
|
116
|
+
}): readonly ScheduleCandidate[];
|
|
117
|
+
export interface ScheduleDecision extends ScheduleCandidate {
|
|
118
|
+
readonly disposition: ScheduleDisposition;
|
|
119
|
+
readonly shouldIngress: boolean;
|
|
120
|
+
}
|
|
121
|
+
export declare function planSchedule(input: {
|
|
122
|
+
readonly version: ScheduleVersion;
|
|
123
|
+
readonly candidates: readonly ScheduleCandidate[];
|
|
124
|
+
readonly now: string;
|
|
125
|
+
readonly cursor: ScheduleCursor;
|
|
126
|
+
readonly activeBindingRuns?: ReadonlySet<string>;
|
|
127
|
+
}): readonly ScheduleDecision[];
|
|
128
|
+
export declare function scheduleTriggerIngress(input: {
|
|
129
|
+
readonly version: ScheduleVersion;
|
|
130
|
+
readonly candidate: ScheduleCandidate;
|
|
131
|
+
readonly loopId: string;
|
|
132
|
+
readonly projectId?: string;
|
|
133
|
+
readonly receivedAt: string;
|
|
134
|
+
readonly misfireDisposition?: 'on_time' | 'catch_up' | 'coalesced';
|
|
135
|
+
}): TriggerIngress;
|
|
136
|
+
export {};
|
|
@@ -0,0 +1,89 @@
|
|
|
1
|
+
import * as JsonSchema from 'effect/JsonSchema';
|
|
2
|
+
import * as Schema from 'effect/Schema';
|
|
3
|
+
import type { StandardSchemaV1 } from 'effect/StandardSchema';
|
|
4
|
+
import { type JsonObject, type JsonValue } from './runtime-type';
|
|
5
|
+
/** An RFC 3339 date-time string with a zone, as JSON Schema's `date-time` format requires. */
|
|
6
|
+
export declare const isDateTime: import("effect/SchemaAST").Filter<string>;
|
|
7
|
+
/** A number, or a numeric string read as one, as a query or a JSON body may carry it. */
|
|
8
|
+
export declare const Numeric: Schema.Union<readonly [Schema.Finite, Schema.FiniteFromString]>;
|
|
9
|
+
/**
|
|
10
|
+
* A whole `Numeric`. Its JSON Schema is `multipleOf: 1`, which holds for the string a query carries where `isInt`'s
|
|
11
|
+
* `type: integer` would not.
|
|
12
|
+
*/
|
|
13
|
+
export declare const isWholeNumber: import("effect/SchemaAST").Filter<number>;
|
|
14
|
+
/**
|
|
15
|
+
* A type guard that holds only when `input` already is a `schema` value, without properties the schema does not model,
|
|
16
|
+
* as a TypeBox `Check` of a closed object did: no transformation or decoding default applies.
|
|
17
|
+
*/
|
|
18
|
+
export declare function guard<S extends Schema.ConstraintDecoder<unknown>>(schema: S): <I>(input: I) => input is I & S['Type'];
|
|
19
|
+
/** `Schema.toStandardSchemaV1(schema)`, with a passing value decoded synchronously first. */
|
|
20
|
+
export declare function standardSchemaV1<S extends Schema.ConstraintDecoder<unknown>>(schema: S): StandardSchemaV1<S["Encoded"], S["Type"]> & S & {
|
|
21
|
+
'~standard': {
|
|
22
|
+
version: 1;
|
|
23
|
+
vendor: string;
|
|
24
|
+
types?: import("effect/StandardSchema").StandardTypedV1.Types<S["Encoded"], S["Type"]> | undefined;
|
|
25
|
+
validate: <Value>(value: Value) => Promise<StandardSchemaV1.Result<S["Type"]>> | StandardSchemaV1.Result<S["Type"]>;
|
|
26
|
+
};
|
|
27
|
+
};
|
|
28
|
+
/** The JSON Schema (draft 2020-12) of `schema`, with objects closed to the properties they model. */
|
|
29
|
+
export declare function jsonSchema(schema: Schema.Top): JsonSchema.JsonSchema;
|
|
30
|
+
/**
|
|
31
|
+
* `value` with every `$defs` entry inside it moved out to `definitions`, and its `#/$defs/` refs pointed at `prefix`. A
|
|
32
|
+
* ref resolves against the whole document, so once a schema that carries its own `$defs` is embedded in a larger one,
|
|
33
|
+
* such as an OpenAPI operation, its refs hold only after the entries sit where `prefix` names. Each schema names its
|
|
34
|
+
* entries on its own, so an entry that would replace a different one under the same name, `known` ones included, moves
|
|
35
|
+
* under a new name.
|
|
36
|
+
*/
|
|
37
|
+
export declare function hoistDefinitions(value: JsonValue, prefix: string, known?: JsonObject): {
|
|
38
|
+
value: JsonValue;
|
|
39
|
+
definitions: {
|
|
40
|
+
[k: string]: JsonValue;
|
|
41
|
+
};
|
|
42
|
+
};
|
|
43
|
+
/**
|
|
44
|
+
* `schema` as a Standard Schema validator with its JSON Schema, for Elysia routes and their OpenAPI. Validation strips
|
|
45
|
+
* properties the schema does not model; the JSON Schema closes objects, as the TypeBox contracts did. An invalid value
|
|
46
|
+
* answers `status`, 400 as TypeBox routes did, with `refused` in place of the message, which otherwise quotes the
|
|
47
|
+
* value. The validator is a copy, so the shared schema stays as it is.
|
|
48
|
+
*/
|
|
49
|
+
export declare function standard<S extends Schema.Top & Schema.ConstraintDecoder<unknown>>(schema: S, options?: {
|
|
50
|
+
readonly refused?: string;
|
|
51
|
+
readonly status?: number;
|
|
52
|
+
}): StandardSchemaV1<S["Encoded"], S["Type"]> & S & {
|
|
53
|
+
invalidStatus: number;
|
|
54
|
+
refused?: string;
|
|
55
|
+
'~standard': {
|
|
56
|
+
version: 1;
|
|
57
|
+
vendor: string;
|
|
58
|
+
types?: import("effect/StandardSchema").StandardTypedV1.Types<S["Encoded"], S["Type"]> | undefined;
|
|
59
|
+
validate: <Value>(value: Value) => Promise<StandardSchemaV1.Result<S["Type"]>> | StandardSchemaV1.Result<S["Type"]>;
|
|
60
|
+
jsonSchema: {
|
|
61
|
+
input: (target: {
|
|
62
|
+
readonly target: string;
|
|
63
|
+
}) => JsonSchema.JsonSchema;
|
|
64
|
+
output: (target: {
|
|
65
|
+
readonly target: string;
|
|
66
|
+
}) => JsonSchema.JsonSchema;
|
|
67
|
+
};
|
|
68
|
+
};
|
|
69
|
+
};
|
|
70
|
+
/**
|
|
71
|
+
* `schema` as an Elysia response validator: the handler's value encodes to what the wire carries, without properties
|
|
72
|
+
* the schema does not model, and the JSON Schema on both sides is that encoded form.
|
|
73
|
+
*/
|
|
74
|
+
export declare function standardResponse<S extends Schema.Top & Schema.ConstraintEncoder<unknown>>(schema: S): StandardSchemaV1<(S extends Schema.flip<infer F extends Schema.Top> ? F["Rebuild"] : Schema.flip<S>)["Encoded"], (S extends Schema.flip<infer F extends Schema.Top> ? F["Rebuild"] : Schema.flip<S>)["Type"]> & (S extends Schema.flip<infer F extends Schema.Top> ? F["Rebuild"] : Schema.flip<S>) & {
|
|
75
|
+
'~standard': {
|
|
76
|
+
version: 1;
|
|
77
|
+
vendor: string;
|
|
78
|
+
types?: import("effect/StandardSchema").StandardTypedV1.Types<(S extends Schema.flip<infer F extends Schema.Top> ? F["Rebuild"] : Schema.flip<S>)["Encoded"], (S extends Schema.flip<infer F extends Schema.Top> ? F["Rebuild"] : Schema.flip<S>)["Type"]> | undefined;
|
|
79
|
+
validate: <Value>(value: Value) => Promise<StandardSchemaV1.Result<(S extends Schema.flip<infer F extends Schema.Top> ? F["Rebuild"] : Schema.flip<S>)["Type"]>> | StandardSchemaV1.Result<(S extends Schema.flip<infer F extends Schema.Top> ? F["Rebuild"] : Schema.flip<S>)["Type"]>;
|
|
80
|
+
jsonSchema: {
|
|
81
|
+
input: (options: {
|
|
82
|
+
readonly target: string;
|
|
83
|
+
}) => JsonSchema.JsonSchema;
|
|
84
|
+
output: (options: {
|
|
85
|
+
readonly target: string;
|
|
86
|
+
}) => JsonSchema.JsonSchema;
|
|
87
|
+
};
|
|
88
|
+
};
|
|
89
|
+
};
|
|
@@ -0,0 +1,100 @@
|
|
|
1
|
+
import * as Schema from 'effect/Schema';
|
|
2
|
+
export declare const ScopeDirectoryPageSize = 50;
|
|
3
|
+
export declare const ScopeDirectoryPageSizeMaximum = 100;
|
|
4
|
+
export declare const ScopeDirectoryIncludedMaximum = 8;
|
|
5
|
+
export declare const ScopeDirectoryIdMaximum = 128;
|
|
6
|
+
export declare const ScopeDirectoryCursorMaximum = 512;
|
|
7
|
+
export declare const ScopeDirectoryId: Schema.String;
|
|
8
|
+
export declare const WorkspaceSelectorItem: Schema.Struct<{
|
|
9
|
+
readonly id: Schema.String;
|
|
10
|
+
readonly name: Schema.String;
|
|
11
|
+
}>;
|
|
12
|
+
export declare const ProjectSelectorItem: Schema.Struct<{
|
|
13
|
+
readonly id: Schema.String;
|
|
14
|
+
readonly workspaceId: Schema.String;
|
|
15
|
+
readonly name: Schema.String;
|
|
16
|
+
}>;
|
|
17
|
+
export declare const ScopeDirectoryPageInfo: Schema.Union<readonly [Schema.Struct<{
|
|
18
|
+
readonly hasNextPage: Schema.Literal<false>;
|
|
19
|
+
}>, Schema.Struct<{
|
|
20
|
+
readonly hasNextPage: Schema.Literal<true>;
|
|
21
|
+
readonly endCursor: Schema.String;
|
|
22
|
+
}>]>;
|
|
23
|
+
export declare const WorkspaceSelectorPage: Schema.Struct<{
|
|
24
|
+
readonly items: Schema.$Array<Schema.Struct<{
|
|
25
|
+
readonly id: Schema.String;
|
|
26
|
+
readonly name: Schema.String;
|
|
27
|
+
}>>;
|
|
28
|
+
readonly included: Schema.$Array<Schema.Struct<{
|
|
29
|
+
readonly id: Schema.String;
|
|
30
|
+
readonly name: Schema.String;
|
|
31
|
+
}>>;
|
|
32
|
+
readonly pageInfo: Schema.Union<readonly [Schema.Struct<{
|
|
33
|
+
readonly hasNextPage: Schema.Literal<false>;
|
|
34
|
+
}>, Schema.Struct<{
|
|
35
|
+
readonly hasNextPage: Schema.Literal<true>;
|
|
36
|
+
readonly endCursor: Schema.String;
|
|
37
|
+
}>]>;
|
|
38
|
+
}>;
|
|
39
|
+
export declare const ProjectSelectorPage: Schema.Struct<{
|
|
40
|
+
readonly items: Schema.$Array<Schema.Struct<{
|
|
41
|
+
readonly id: Schema.String;
|
|
42
|
+
readonly workspaceId: Schema.String;
|
|
43
|
+
readonly name: Schema.String;
|
|
44
|
+
}>>;
|
|
45
|
+
readonly included: Schema.$Array<Schema.Struct<{
|
|
46
|
+
readonly id: Schema.String;
|
|
47
|
+
readonly workspaceId: Schema.String;
|
|
48
|
+
readonly name: Schema.String;
|
|
49
|
+
}>>;
|
|
50
|
+
readonly pageInfo: Schema.Union<readonly [Schema.Struct<{
|
|
51
|
+
readonly hasNextPage: Schema.Literal<false>;
|
|
52
|
+
}>, Schema.Struct<{
|
|
53
|
+
readonly hasNextPage: Schema.Literal<true>;
|
|
54
|
+
readonly endCursor: Schema.String;
|
|
55
|
+
}>]>;
|
|
56
|
+
}>;
|
|
57
|
+
export declare const ScopeDirectoryPageQuery: Schema.Struct<{
|
|
58
|
+
readonly limit: Schema.optionalKey<Schema.Union<readonly [Schema.Finite, Schema.FiniteFromString]>>;
|
|
59
|
+
readonly cursor: Schema.optionalKey<Schema.String>;
|
|
60
|
+
readonly includeIds: Schema.optionalKey<Schema.String>;
|
|
61
|
+
}>;
|
|
62
|
+
export declare const parseWorkspaceSelectorPage: <ValueType>(value: ValueType) => {
|
|
63
|
+
readonly items: readonly {
|
|
64
|
+
readonly id: string;
|
|
65
|
+
readonly name: string;
|
|
66
|
+
}[];
|
|
67
|
+
readonly included: readonly {
|
|
68
|
+
readonly id: string;
|
|
69
|
+
readonly name: string;
|
|
70
|
+
}[];
|
|
71
|
+
readonly pageInfo: {
|
|
72
|
+
readonly hasNextPage: false;
|
|
73
|
+
} | {
|
|
74
|
+
readonly hasNextPage: true;
|
|
75
|
+
readonly endCursor: string;
|
|
76
|
+
};
|
|
77
|
+
};
|
|
78
|
+
export declare const parseProjectSelectorPage: <ValueType>(value: ValueType, workspaceId: string) => {
|
|
79
|
+
readonly items: readonly {
|
|
80
|
+
readonly id: string;
|
|
81
|
+
readonly workspaceId: string;
|
|
82
|
+
readonly name: string;
|
|
83
|
+
}[];
|
|
84
|
+
readonly included: readonly {
|
|
85
|
+
readonly id: string;
|
|
86
|
+
readonly workspaceId: string;
|
|
87
|
+
readonly name: string;
|
|
88
|
+
}[];
|
|
89
|
+
readonly pageInfo: {
|
|
90
|
+
readonly hasNextPage: false;
|
|
91
|
+
} | {
|
|
92
|
+
readonly hasNextPage: true;
|
|
93
|
+
readonly endCursor: string;
|
|
94
|
+
};
|
|
95
|
+
};
|
|
96
|
+
export type WorkspaceSelectorItem = (typeof WorkspaceSelectorItem)['Type'];
|
|
97
|
+
export type ProjectSelectorItem = (typeof ProjectSelectorItem)['Type'];
|
|
98
|
+
export type WorkspaceSelectorPage = (typeof WorkspaceSelectorPage)['Type'];
|
|
99
|
+
export type ProjectSelectorPage = (typeof ProjectSelectorPage)['Type'];
|
|
100
|
+
export type ScopeDirectoryPageInfo = (typeof ScopeDirectoryPageInfo)['Type'];
|
|
@@ -0,0 +1,37 @@
|
|
|
1
|
+
import * as Schema from 'effect/Schema';
|
|
2
|
+
/** A Secret's name, which a Loop reads through Effect `Config`. */
|
|
3
|
+
export declare const SecretName: Schema.String;
|
|
4
|
+
export declare const SecretScope: Schema.Union<readonly [Schema.Literal<"workspace">, Schema.Literal<"project">]>;
|
|
5
|
+
export type SecretScope = (typeof SecretScope)['Type'];
|
|
6
|
+
/** A Secret as anyone may see it: never its value. */
|
|
7
|
+
export declare const SecretSummary: Schema.Struct<{
|
|
8
|
+
readonly name: Schema.String;
|
|
9
|
+
readonly scope: Schema.Union<readonly [Schema.Literal<"workspace">, Schema.Literal<"project">]>;
|
|
10
|
+
readonly projectId: Schema.optionalKey<Schema.String>;
|
|
11
|
+
readonly setByActorType: Schema.Union<readonly [Schema.Literal<"human">, Schema.Literal<"delegated_agent">, Schema.Literal<"agent">]>;
|
|
12
|
+
readonly setByActorId: Schema.String;
|
|
13
|
+
readonly setAt: Schema.String;
|
|
14
|
+
}>;
|
|
15
|
+
export type SecretSummary = (typeof SecretSummary)['Type'];
|
|
16
|
+
export declare const SecretList: Schema.Struct<{
|
|
17
|
+
readonly items: Schema.$Array<Schema.Struct<{
|
|
18
|
+
readonly name: Schema.String;
|
|
19
|
+
readonly scope: Schema.Union<readonly [Schema.Literal<"workspace">, Schema.Literal<"project">]>;
|
|
20
|
+
readonly projectId: Schema.optionalKey<Schema.String>;
|
|
21
|
+
readonly setByActorType: Schema.Union<readonly [Schema.Literal<"human">, Schema.Literal<"delegated_agent">, Schema.Literal<"agent">]>;
|
|
22
|
+
readonly setByActorId: Schema.String;
|
|
23
|
+
readonly setAt: Schema.String;
|
|
24
|
+
}>>;
|
|
25
|
+
}>;
|
|
26
|
+
export type SecretList = (typeof SecretList)['Type'];
|
|
27
|
+
export declare const secretSetRefused = "A Secret takes a value of 1 to 65536 characters and an optional projectId";
|
|
28
|
+
/** Sets a Secret for the Workspace, or for one of its Projects; a refusal never quotes the value. */
|
|
29
|
+
export declare const SecretSet: Schema.Struct<{
|
|
30
|
+
readonly value: Schema.String;
|
|
31
|
+
readonly projectId: Schema.optionalKey<Schema.String>;
|
|
32
|
+
}>;
|
|
33
|
+
export type SecretSet = (typeof SecretSet)['Type'];
|
|
34
|
+
export declare const SecretScopeQuery: Schema.Struct<{
|
|
35
|
+
readonly projectId: Schema.optionalKey<Schema.String>;
|
|
36
|
+
}>;
|
|
37
|
+
export type SecretScopeQuery = (typeof SecretScopeQuery)['Type'];
|
|
@@ -0,0 +1,90 @@
|
|
|
1
|
+
import * as Schema from 'effect/Schema';
|
|
2
|
+
export declare const SessionStatuses: readonly ['active', 'ended'];
|
|
3
|
+
export declare const DefaultSessionStatus = "active";
|
|
4
|
+
export declare const SessionStatus: Schema.Union<readonly [Schema.Literal<"active">, Schema.Literal<"ended">]>;
|
|
5
|
+
export declare const SessionUpdateKind: Schema.Union<readonly [Schema.Literal<"note">, Schema.Literal<"question">, Schema.Literal<"answer">, Schema.Literal<"decision">, Schema.Literal<"blocker">, Schema.Literal<"finding">, Schema.Literal<"handoff">, Schema.Literal<"test_result">, Schema.Literal<"file_reference">, Schema.Literal<"status_change">, Schema.Literal<"assignment_change">, Schema.Literal<"link">]>;
|
|
6
|
+
export declare const Session: Schema.Struct<{
|
|
7
|
+
readonly id: Schema.String;
|
|
8
|
+
readonly workspaceId: Schema.String;
|
|
9
|
+
readonly projectId: Schema.optionalKey<Schema.String>;
|
|
10
|
+
readonly taskId: Schema.String;
|
|
11
|
+
readonly actorType: Schema.Union<readonly [Schema.Literal<"human">, Schema.Literal<"delegated_agent">, Schema.Literal<"agent">]>;
|
|
12
|
+
readonly actorId: Schema.String;
|
|
13
|
+
readonly actorName: Schema.optionalKey<Schema.String>;
|
|
14
|
+
readonly delegatedByUserId: Schema.optionalKey<Schema.String>;
|
|
15
|
+
readonly agentName: Schema.optionalKey<Schema.String>;
|
|
16
|
+
readonly agentIdentityId: Schema.optionalKey<Schema.String>;
|
|
17
|
+
readonly runtimeMetadata: Schema.optionalKey<Schema.$Record<Schema.String, Schema.Unknown>>;
|
|
18
|
+
readonly modelMetadata: Schema.optionalKey<Schema.$Record<Schema.String, Schema.Unknown>>;
|
|
19
|
+
readonly status: Schema.Union<readonly [Schema.Literal<"active">, Schema.Literal<"ended">]>;
|
|
20
|
+
readonly summary: Schema.optionalKey<Schema.String>;
|
|
21
|
+
readonly startedAt: Schema.String;
|
|
22
|
+
readonly endedAt: Schema.optionalKey<Schema.String>;
|
|
23
|
+
readonly createdAt: Schema.String;
|
|
24
|
+
readonly updatedAt: Schema.String;
|
|
25
|
+
}>;
|
|
26
|
+
export declare const SessionCreate: Schema.Struct<{
|
|
27
|
+
readonly summary: Schema.optionalKey<Schema.String>;
|
|
28
|
+
readonly agentIdentityId: Schema.optionalKey<Schema.String>;
|
|
29
|
+
readonly runtimeMetadata: Schema.optionalKey<Schema.$Record<Schema.String, Schema.Unknown>>;
|
|
30
|
+
readonly modelMetadata: Schema.optionalKey<Schema.$Record<Schema.String, Schema.Unknown>>;
|
|
31
|
+
}>;
|
|
32
|
+
export declare const SessionEnd: Schema.Struct<{
|
|
33
|
+
readonly summary: Schema.optionalKey<Schema.String>;
|
|
34
|
+
}>;
|
|
35
|
+
export declare const SessionList: Schema.Struct<{
|
|
36
|
+
readonly items: Schema.$Array<Schema.Struct<{
|
|
37
|
+
readonly id: Schema.String;
|
|
38
|
+
readonly workspaceId: Schema.String;
|
|
39
|
+
readonly projectId: Schema.optionalKey<Schema.String>;
|
|
40
|
+
readonly taskId: Schema.String;
|
|
41
|
+
readonly actorType: Schema.Union<readonly [Schema.Literal<"human">, Schema.Literal<"delegated_agent">, Schema.Literal<"agent">]>;
|
|
42
|
+
readonly actorId: Schema.String;
|
|
43
|
+
readonly actorName: Schema.optionalKey<Schema.String>;
|
|
44
|
+
readonly delegatedByUserId: Schema.optionalKey<Schema.String>;
|
|
45
|
+
readonly agentName: Schema.optionalKey<Schema.String>;
|
|
46
|
+
readonly agentIdentityId: Schema.optionalKey<Schema.String>;
|
|
47
|
+
readonly runtimeMetadata: Schema.optionalKey<Schema.$Record<Schema.String, Schema.Unknown>>;
|
|
48
|
+
readonly modelMetadata: Schema.optionalKey<Schema.$Record<Schema.String, Schema.Unknown>>;
|
|
49
|
+
readonly status: Schema.Union<readonly [Schema.Literal<"active">, Schema.Literal<"ended">]>;
|
|
50
|
+
readonly summary: Schema.optionalKey<Schema.String>;
|
|
51
|
+
readonly startedAt: Schema.String;
|
|
52
|
+
readonly endedAt: Schema.optionalKey<Schema.String>;
|
|
53
|
+
readonly createdAt: Schema.String;
|
|
54
|
+
readonly updatedAt: Schema.String;
|
|
55
|
+
}>>;
|
|
56
|
+
}>;
|
|
57
|
+
export declare const SessionUpdate: Schema.Struct<{
|
|
58
|
+
readonly id: Schema.String;
|
|
59
|
+
readonly sessionId: Schema.String;
|
|
60
|
+
readonly taskId: Schema.String;
|
|
61
|
+
readonly kind: Schema.Union<readonly [Schema.Literal<"note">, Schema.Literal<"question">, Schema.Literal<"answer">, Schema.Literal<"decision">, Schema.Literal<"blocker">, Schema.Literal<"finding">, Schema.Literal<"handoff">, Schema.Literal<"test_result">, Schema.Literal<"file_reference">, Schema.Literal<"status_change">, Schema.Literal<"assignment_change">, Schema.Literal<"link">]>;
|
|
62
|
+
readonly content: Schema.String;
|
|
63
|
+
readonly metadata: Schema.$Record<Schema.String, Schema.Unknown>;
|
|
64
|
+
readonly createdAt: Schema.String;
|
|
65
|
+
}>;
|
|
66
|
+
export declare const SessionUpdateList: Schema.Struct<{
|
|
67
|
+
readonly items: Schema.$Array<Schema.Struct<{
|
|
68
|
+
readonly id: Schema.String;
|
|
69
|
+
readonly sessionId: Schema.String;
|
|
70
|
+
readonly taskId: Schema.String;
|
|
71
|
+
readonly kind: Schema.Union<readonly [Schema.Literal<"note">, Schema.Literal<"question">, Schema.Literal<"answer">, Schema.Literal<"decision">, Schema.Literal<"blocker">, Schema.Literal<"finding">, Schema.Literal<"handoff">, Schema.Literal<"test_result">, Schema.Literal<"file_reference">, Schema.Literal<"status_change">, Schema.Literal<"assignment_change">, Schema.Literal<"link">]>;
|
|
72
|
+
readonly content: Schema.String;
|
|
73
|
+
readonly metadata: Schema.$Record<Schema.String, Schema.Unknown>;
|
|
74
|
+
readonly createdAt: Schema.String;
|
|
75
|
+
}>>;
|
|
76
|
+
}>;
|
|
77
|
+
export declare const SessionUpdateCreate: Schema.Struct<{
|
|
78
|
+
readonly kind: Schema.Union<readonly [Schema.Literal<"note">, Schema.Literal<"question">, Schema.Literal<"answer">, Schema.Literal<"decision">, Schema.Literal<"blocker">, Schema.Literal<"finding">, Schema.Literal<"handoff">, Schema.Literal<"test_result">, Schema.Literal<"file_reference">, Schema.Literal<"status_change">, Schema.Literal<"assignment_change">, Schema.Literal<"link">]>;
|
|
79
|
+
readonly content: Schema.String;
|
|
80
|
+
readonly metadata: Schema.optionalKey<Schema.$Record<Schema.String, Schema.Unknown>>;
|
|
81
|
+
}>;
|
|
82
|
+
export type SessionStatus = (typeof SessionStatus)['Type'];
|
|
83
|
+
export type SessionUpdateKind = (typeof SessionUpdateKind)['Type'];
|
|
84
|
+
export type Session = (typeof Session)['Type'];
|
|
85
|
+
export type SessionCreate = (typeof SessionCreate)['Type'];
|
|
86
|
+
export type SessionEnd = (typeof SessionEnd)['Type'];
|
|
87
|
+
export type SessionList = (typeof SessionList)['Type'];
|
|
88
|
+
export type SessionUpdate = (typeof SessionUpdate)['Type'];
|
|
89
|
+
export type SessionUpdateList = (typeof SessionUpdateList)['Type'];
|
|
90
|
+
export type SessionUpdateCreate = (typeof SessionUpdateCreate)['Type'];
|
|
@@ -0,0 +1,50 @@
|
|
|
1
|
+
import type { JsonObject } from './runtime-type';
|
|
2
|
+
/** Validates an Output against its JSON Schema; the message is what the agent sees for its one repair. */
|
|
3
|
+
export declare function validateAgentOutput(schema: JsonObject, output: JsonObject): {
|
|
4
|
+
readonly ok: true;
|
|
5
|
+
} | {
|
|
6
|
+
readonly ok: false;
|
|
7
|
+
readonly message: string;
|
|
8
|
+
};
|
|
9
|
+
/** The first message an agent receives. */
|
|
10
|
+
export declare function renderStepBriefPrompt(input: {
|
|
11
|
+
readonly instruction: string;
|
|
12
|
+
readonly contextPackMarkdown?: string;
|
|
13
|
+
readonly outputSchema: JsonObject;
|
|
14
|
+
}): string;
|
|
15
|
+
type ContextArtifact = {
|
|
16
|
+
readonly title: string;
|
|
17
|
+
readonly kind: string;
|
|
18
|
+
readonly text: string;
|
|
19
|
+
};
|
|
20
|
+
/**
|
|
21
|
+
* A program agent Step's ContextPack: its Task's context, this Run's artifacts, related artifacts from earlier Runs,
|
|
22
|
+
* and what earlier attempts of the Step recorded; then the Run's Intent and steering. Undefined when there is nothing to say.
|
|
23
|
+
*/
|
|
24
|
+
export declare function programStepContext(input: {
|
|
25
|
+
readonly taskContext?: string;
|
|
26
|
+
/** The Project's Kits, for a Run with no Task whose ContextPack would carry them. */
|
|
27
|
+
readonly kits?: string;
|
|
28
|
+
readonly runArtifacts: readonly ContextArtifact[];
|
|
29
|
+
readonly earlierArtifacts: readonly ContextArtifact[];
|
|
30
|
+
readonly handoff: readonly {
|
|
31
|
+
readonly attempt: number;
|
|
32
|
+
readonly kind: string;
|
|
33
|
+
readonly content: string;
|
|
34
|
+
}[];
|
|
35
|
+
/** The Run's current Intent, as Oversight renders it. */
|
|
36
|
+
readonly intent?: string;
|
|
37
|
+
readonly steering?: readonly string[];
|
|
38
|
+
}): string | undefined;
|
|
39
|
+
/** The program's prompt, and how the agent leaves a trail a retry on another Runner can follow. */
|
|
40
|
+
export declare const programStepInstruction: (prompt: string) => string;
|
|
41
|
+
type StepCredentialLease = {
|
|
42
|
+
readonly stepAttemptId: string;
|
|
43
|
+
readonly leaseId: string;
|
|
44
|
+
readonly fencingToken: string;
|
|
45
|
+
};
|
|
46
|
+
/** The agent's credential for StepAttempt-scoped Kitman MCP tools; it is valid only for the lease it was minted for. */
|
|
47
|
+
export declare function mintStepCredential(secret: string, lease: StepCredentialLease): string;
|
|
48
|
+
export declare function stepCredentialAttemptId(credential: string): string | undefined;
|
|
49
|
+
export declare function stepCredentialMatches(secret: string, credential: string, lease: StepCredentialLease): boolean;
|
|
50
|
+
export {};
|