@kitman-sh/loops 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/index.js +1066 -0
- package/package.json +19 -4
- package/types/packages/core/src/agent-environment.d.ts +2429 -0
- package/types/packages/core/src/agent-sandbox-policy.d.ts +33 -0
- package/types/packages/core/src/common.d.ts +6 -0
- package/types/packages/core/src/context-pack.d.ts +182 -0
- package/types/packages/core/src/extension.d.ts +35 -0
- package/types/packages/core/src/kit.d.ts +1489 -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/package-declarations.d.ts +435 -0
- package/types/packages/core/src/proposal.d.ts +292 -0
- package/types/packages/core/src/redaction.d.ts +73 -0
- package/types/packages/core/src/run.d.ts +566 -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/trigger-dispatch.d.ts +421 -0
- package/types/packages/loops/src/build.d.ts +33 -0
- package/types/packages/loops/src/change-request-body.d.ts +14 -0
- package/types/packages/loops/src/code-quality-pass.d.ts +50 -0
- package/types/packages/loops/src/code-quality.d.ts +26 -0
- package/types/packages/loops/src/hello.d.ts +9 -0
- package/types/packages/loops/src/incident.d.ts +13 -0
- package/types/packages/loops/src/index.d.ts +172 -0
- package/types/packages/loops/src/plan.d.ts +37 -0
- package/types/packages/loops/src/release.d.ts +21 -0
- package/types/packages/loops/src/research.d.ts +8 -0
- package/types/packages/loops/src/review.d.ts +38 -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/README.md +0 -3
|
@@ -0,0 +1,59 @@
|
|
|
1
|
+
import type { AgentSandboxNetwork } from './agent-sandbox-policy';
|
|
2
|
+
/** Where a Loop or Agent version lives, nearest first. */
|
|
3
|
+
export declare const LoopLayers: readonly ['project', 'workspace', 'shipped'];
|
|
4
|
+
export type LoopLayer = (typeof LoopLayers)[number];
|
|
5
|
+
export type LayerListings<T> = {
|
|
6
|
+
readonly [layer in LoopLayer]: readonly T[];
|
|
7
|
+
};
|
|
8
|
+
/** The version an id resolves to: the nearest layer that has it, optionally only below a given layer. */
|
|
9
|
+
export declare const resolveLayered: <T extends {
|
|
10
|
+
readonly id: string;
|
|
11
|
+
}>(id: string, listings: LayerListings<T>, options?: {
|
|
12
|
+
readonly below?: LoopLayer;
|
|
13
|
+
}) => {
|
|
14
|
+
readonly layer: LoopLayer;
|
|
15
|
+
readonly entry: T;
|
|
16
|
+
} | undefined;
|
|
17
|
+
export declare const AgentEfforts: readonly ['low', 'medium', 'high', 'xhigh'];
|
|
18
|
+
export type AgentEffort = (typeof AgentEfforts)[number];
|
|
19
|
+
/** Whether a harness has an effort control; a StepAttempt on any other harness records its effort as ignored. */
|
|
20
|
+
export declare const harnessTakesEffort: (harness: string) => boolean;
|
|
21
|
+
/** The fields an Agent version may name; one that extends another replaces these, and merges instructions by section. */
|
|
22
|
+
export type AgentFields = {
|
|
23
|
+
readonly instructions?: string;
|
|
24
|
+
readonly harness?: string;
|
|
25
|
+
readonly model?: string;
|
|
26
|
+
readonly effort?: AgentEffort;
|
|
27
|
+
readonly kits?: readonly string[];
|
|
28
|
+
readonly network?: AgentSandboxNetwork;
|
|
29
|
+
/** The SandboxBackend its Steps require. */
|
|
30
|
+
readonly sandbox?: 'docker';
|
|
31
|
+
};
|
|
32
|
+
export type AgentListing = AgentFields & {
|
|
33
|
+
readonly id: string;
|
|
34
|
+
readonly extends?: string;
|
|
35
|
+
/** The Package that declares it. */
|
|
36
|
+
readonly package?: string;
|
|
37
|
+
};
|
|
38
|
+
export type ResolvedAgent = AgentFields & {
|
|
39
|
+
readonly id: string;
|
|
40
|
+
};
|
|
41
|
+
export type AgentFieldLayers = {
|
|
42
|
+
readonly [field in keyof AgentFields]?: LoopLayer;
|
|
43
|
+
};
|
|
44
|
+
/**
|
|
45
|
+
* Merges an extending Agent's instructions into its parent's by `## ` heading: a named section replaces the parent's,
|
|
46
|
+
* a new one is appended, and text before the first heading replaces the parent's.
|
|
47
|
+
*/
|
|
48
|
+
export declare const mergeAgentInstructions: (parent: string, child: string) => string;
|
|
49
|
+
/**
|
|
50
|
+
* Resolves an Agent and the chain it extends into one Agent. An Agent that extends its own id extends the version
|
|
51
|
+
* below its layer, as a fork does.
|
|
52
|
+
*/
|
|
53
|
+
export declare const resolveAgent: (id: string, listings: LayerListings<AgentListing>, options?: {
|
|
54
|
+
readonly below?: LoopLayer;
|
|
55
|
+
}, seen?: ReadonlySet<string>) => {
|
|
56
|
+
readonly layer: LoopLayer;
|
|
57
|
+
readonly agent: ResolvedAgent;
|
|
58
|
+
readonly fieldLayers: AgentFieldLayers;
|
|
59
|
+
} | undefined;
|
|
@@ -0,0 +1,59 @@
|
|
|
1
|
+
import * as Schema from 'effect/Schema';
|
|
2
|
+
import type { ActorType } from './common';
|
|
3
|
+
import type { LoopStatus } from './loop';
|
|
4
|
+
export declare const LoopVersionStatuses: readonly ['draft', 'published', 'deprecated', 'disabled', 'archived'];
|
|
5
|
+
export type LoopVersionStatus = (typeof LoopVersionStatuses)[number];
|
|
6
|
+
export interface LoopIdentity {
|
|
7
|
+
readonly id: string;
|
|
8
|
+
readonly workspaceId: string;
|
|
9
|
+
readonly projectId?: string;
|
|
10
|
+
readonly slug: string;
|
|
11
|
+
readonly name: string;
|
|
12
|
+
readonly description?: string;
|
|
13
|
+
readonly status: LoopStatus;
|
|
14
|
+
readonly createdByActorType: ActorType;
|
|
15
|
+
readonly createdByActorId: string;
|
|
16
|
+
readonly delegatedByUserId?: string;
|
|
17
|
+
readonly createdAt: string;
|
|
18
|
+
readonly updatedAt: string;
|
|
19
|
+
}
|
|
20
|
+
/** A portable selector. Admission always resolves this to an immutable version pin. */
|
|
21
|
+
export declare const LoopReferenceSchema: Schema.Union<readonly [Schema.Struct<{
|
|
22
|
+
readonly loopId: Schema.String;
|
|
23
|
+
readonly alias: Schema.String;
|
|
24
|
+
}>, Schema.Struct<{
|
|
25
|
+
readonly loopId: Schema.String;
|
|
26
|
+
readonly versionId: Schema.String;
|
|
27
|
+
}>, Schema.Struct<{
|
|
28
|
+
readonly loopId: Schema.String;
|
|
29
|
+
readonly version: Schema.Int;
|
|
30
|
+
}>, Schema.Struct<{
|
|
31
|
+
readonly loopId: Schema.String;
|
|
32
|
+
readonly digest: Schema.String;
|
|
33
|
+
}>, Schema.Struct<{
|
|
34
|
+
readonly slug: Schema.String;
|
|
35
|
+
readonly alias: Schema.String;
|
|
36
|
+
}>, Schema.Struct<{
|
|
37
|
+
readonly slug: Schema.String;
|
|
38
|
+
readonly version: Schema.Int;
|
|
39
|
+
}>, Schema.Struct<{
|
|
40
|
+
readonly slug: Schema.String;
|
|
41
|
+
readonly digest: Schema.String;
|
|
42
|
+
}>]>;
|
|
43
|
+
export type LoopReference = (typeof LoopReferenceSchema)['Type'];
|
|
44
|
+
/** A Loop reference resolved to its exact published version. */
|
|
45
|
+
export interface LoopResolution {
|
|
46
|
+
readonly loop: LoopIdentity;
|
|
47
|
+
readonly version: {
|
|
48
|
+
readonly id: string;
|
|
49
|
+
readonly version: number;
|
|
50
|
+
readonly definitionDigest: string;
|
|
51
|
+
};
|
|
52
|
+
}
|
|
53
|
+
/**
|
|
54
|
+
* RFC 8785-compatible for the JSON value subset used by Loop definitions.
|
|
55
|
+
* Object keys are sorted lexicographically and arrays preserve semantic order.
|
|
56
|
+
*/
|
|
57
|
+
export declare function canonicalJson<ValueType>(value: ValueType): string;
|
|
58
|
+
/** SHA-256 over canonical JSON without introducing a Node-only dependency in @kitman/core. */
|
|
59
|
+
export declare function canonicalSha256<ValueType>(value: ValueType): string;
|