@kitman-sh/sdk 0.7.2 → 0.7.3
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/package.json +1 -1
- 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-launch-snapshot.d.ts +44 -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/connection.d.ts +33 -0
- package/types/packages/core/src/context-feedback.d.ts +89 -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/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/integration.d.ts +275 -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/live.d.ts +8318 -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.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/provider-safe-text.d.ts +2 -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/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 +3776 -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/work-unit.d.ts +740 -0
- package/types/packages/core/src/workspace.d.ts +96 -0
- package/types/packages/live/src/rpc/runner-group.d.ts +260 -260
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
import * as Effect from 'effect/Effect';
|
|
2
|
+
import * as Exit from 'effect/Exit';
|
|
3
|
+
import * as Schema from 'effect/Schema';
|
|
4
|
+
/** The largest encoded journal entry Kitman stores; larger content belongs in a Run artifact. */
|
|
5
|
+
export declare const journalEntryMaxBytes: number;
|
|
6
|
+
export declare const encodeJournalExit: (exit: Exit.Exit<unknown, unknown>) => Effect.Effect<Schema.Json, Schema.SchemaError, never>;
|
|
7
|
+
export declare const decodeJournalExit: (input: unknown, options?: import("effect/SchemaAST").ParseOptions) => Effect.Effect<Exit.Exit<Schema.Json, Schema.Json>, Schema.SchemaError, never>;
|
|
8
|
+
/** How a deferred resolved by Kitman (an answer, a fired clock) is written to the journal. */
|
|
9
|
+
export declare const journalSuccess: (value: Schema.Json) => Schema.Json;
|
|
10
|
+
/** The SDK's Step failure as the journal holds it, for a Step Kitman fails on a program's behalf. */
|
|
11
|
+
export declare const JournalStepFailed: Schema.TaggedStruct<"StepFailed", {
|
|
12
|
+
readonly step: Schema.String;
|
|
13
|
+
readonly reason: Schema.String;
|
|
14
|
+
}>;
|
|
15
|
+
/** The SDK's Child Run failure as the journal holds it. */
|
|
16
|
+
export declare const JournalChildFailed: Schema.TaggedStruct<"ChildFailed", {
|
|
17
|
+
readonly step: Schema.String;
|
|
18
|
+
readonly loop: Schema.String;
|
|
19
|
+
readonly reason: Schema.String;
|
|
20
|
+
}>;
|
|
21
|
+
/** The SDK's `waitFor` timeout as the journal holds it. */
|
|
22
|
+
export declare const JournalWaitTimedOut: Schema.TaggedStruct<"WaitTimedOut", {
|
|
23
|
+
readonly step: Schema.String;
|
|
24
|
+
readonly event: Schema.String;
|
|
25
|
+
}>;
|
|
26
|
+
/** A deferred Kitman fails, with the deferred's error already encoded as JSON. */
|
|
27
|
+
export declare const journalFailure: (error: Schema.Json) => Schema.Json;
|
|
28
|
+
export declare const journalEntryBytes: (entry: Schema.Json) => number;
|
|
@@ -0,0 +1,67 @@
|
|
|
1
|
+
import type { JsonObject } from './runtime-type';
|
|
2
|
+
export type LaunchOutcome = 'feature' | 'bug' | 'refactor' | 'investigation' | 'docs' | 'migration';
|
|
3
|
+
/** Where and how a developer launched: their checkout, and the words they typed. */
|
|
4
|
+
export type LaunchContext = {
|
|
5
|
+
/** The Project the request names; it wins over the repository's. */
|
|
6
|
+
readonly projectId?: string;
|
|
7
|
+
readonly remoteUrl?: string;
|
|
8
|
+
/** A repository chosen outright, as the web's New run form does. */
|
|
9
|
+
readonly repoBindingId?: string;
|
|
10
|
+
readonly branch?: string;
|
|
11
|
+
readonly words?: string;
|
|
12
|
+
};
|
|
13
|
+
/** What the control plane knows that a launch may point at. */
|
|
14
|
+
export type LaunchCandidates = {
|
|
15
|
+
readonly repositories: readonly {
|
|
16
|
+
readonly repoBindingId: string;
|
|
17
|
+
readonly projectId: string;
|
|
18
|
+
readonly repositoryUrl: string;
|
|
19
|
+
}[];
|
|
20
|
+
/** Open ChangeRequests in those repositories. */
|
|
21
|
+
readonly changeRequests: readonly {
|
|
22
|
+
readonly id: string;
|
|
23
|
+
readonly repoBindingId: string;
|
|
24
|
+
readonly number?: number;
|
|
25
|
+
readonly sourceBranch?: string;
|
|
26
|
+
}[];
|
|
27
|
+
};
|
|
28
|
+
export type LaunchTask = {
|
|
29
|
+
readonly kind: 'tracker';
|
|
30
|
+
readonly key: string;
|
|
31
|
+
} | {
|
|
32
|
+
readonly kind: 'words';
|
|
33
|
+
readonly words: string;
|
|
34
|
+
};
|
|
35
|
+
export type InferredLaunch = {
|
|
36
|
+
readonly projectId?: string;
|
|
37
|
+
readonly repoBindingId?: string;
|
|
38
|
+
readonly branch?: string;
|
|
39
|
+
readonly changeRequestId?: string;
|
|
40
|
+
readonly trackerKeys: readonly string[];
|
|
41
|
+
readonly task?: LaunchTask;
|
|
42
|
+
readonly outcome?: LaunchOutcome;
|
|
43
|
+
/** Loop Input fields; `taskId` is left to whoever makes the Task. */
|
|
44
|
+
readonly input: JsonObject;
|
|
45
|
+
/** Required Loop Input fields nothing filled. */
|
|
46
|
+
readonly missing: readonly string[];
|
|
47
|
+
};
|
|
48
|
+
/** host/owner/name of a git remote, so SSH and HTTPS remotes of one repository match. */
|
|
49
|
+
export declare const repositoryKey: (url: string) => string;
|
|
50
|
+
/** A Loop Input JSON Schema's top-level fields, behind a `$ref` if it has one. */
|
|
51
|
+
export declare const launchInputSchema: (schema: JsonObject) => {
|
|
52
|
+
properties: JsonObject;
|
|
53
|
+
required: any[];
|
|
54
|
+
};
|
|
55
|
+
/**
|
|
56
|
+
* What a launch means: the Project, repository, branch, open ChangeRequest, Task and Outcome its context points at,
|
|
57
|
+
* and the Loop Input they fill. The words fill a `words` field, or else the one required text field left.
|
|
58
|
+
*/
|
|
59
|
+
export declare const inferLaunch: (launch: {
|
|
60
|
+
readonly context: LaunchContext;
|
|
61
|
+
readonly loop: {
|
|
62
|
+
readonly input: JsonObject;
|
|
63
|
+
readonly outcome?: LaunchOutcome;
|
|
64
|
+
};
|
|
65
|
+
readonly candidates: LaunchCandidates;
|
|
66
|
+
readonly given?: JsonObject;
|
|
67
|
+
}) => InferredLaunch;
|
|
@@ -0,0 +1,43 @@
|
|
|
1
|
+
import { type Runner, type RunnerCapabilities } from './runner';
|
|
2
|
+
import type { RunnerExecutionRouting } from './runner-routing';
|
|
3
|
+
export declare const RunnerEligibilityReasonCodes: readonly ['workspace_mismatch', 'project_access_denied', 'personal_owner_attribution_required', 'personal_owner_project_access_denied', 'agent_identity_authority_missing', 'foreground_target_required', 'foreground_target_mismatch', 'foreground_target_not_personal', 'runner_requirements_mismatch', 'runner_replica_unavailable'];
|
|
4
|
+
export type RunnerEligibilityReasonCode = (typeof RunnerEligibilityReasonCodes)[number];
|
|
5
|
+
export type RunnerSchedulingAuthority = {
|
|
6
|
+
readonly kind: 'direct_human';
|
|
7
|
+
readonly userId: string;
|
|
8
|
+
} | {
|
|
9
|
+
readonly kind: 'durable_delegation';
|
|
10
|
+
readonly ownerUserId: string;
|
|
11
|
+
readonly delegationId: string;
|
|
12
|
+
} | {
|
|
13
|
+
readonly kind: 'agent';
|
|
14
|
+
readonly agentIdentityId: string;
|
|
15
|
+
} | {
|
|
16
|
+
readonly kind: 'system';
|
|
17
|
+
};
|
|
18
|
+
export interface RunnerEligibilityInput {
|
|
19
|
+
readonly runner: Runner;
|
|
20
|
+
readonly workspaceId: string;
|
|
21
|
+
readonly projectId: string;
|
|
22
|
+
readonly schedulingAuthority: RunnerSchedulingAuthority;
|
|
23
|
+
readonly routing?: RunnerExecutionRouting;
|
|
24
|
+
readonly ownerHasProjectAccess: boolean;
|
|
25
|
+
readonly agentIdentityAuthorized: boolean;
|
|
26
|
+
readonly requirementsMatch: boolean;
|
|
27
|
+
readonly replicaReady: boolean;
|
|
28
|
+
}
|
|
29
|
+
export interface RunnerEligibilityResult {
|
|
30
|
+
readonly eligible: boolean;
|
|
31
|
+
readonly reasons: readonly RunnerEligibilityReasonCode[];
|
|
32
|
+
}
|
|
33
|
+
/**
|
|
34
|
+
* The only scope/authority predicate used by runner admission callers.
|
|
35
|
+
* Inputs such as labels, claimed Project IDs, or runner metadata are
|
|
36
|
+
* deliberately absent; callers must resolve them from trusted control-plane
|
|
37
|
+
* state before invoking this function.
|
|
38
|
+
*/
|
|
39
|
+
export declare function evaluateRunnerEligibility(input: RunnerEligibilityInput): RunnerEligibilityResult;
|
|
40
|
+
/** The owner's choice while the Runner offers it, else the first offered of Pi, Claude Code and Codex. */
|
|
41
|
+
export declare function runnerDefaultHarness(harnesses: readonly string[], chosen: string | undefined): string | undefined;
|
|
42
|
+
/** The Harness this Runner would launch an Agent on, or undefined when the Agent's Step is not this Runner's. */
|
|
43
|
+
export declare function agentStepHarness(capabilities: Pick<RunnerCapabilities, 'harnesses' | 'defaultHarness'>, agentHarness: string | undefined): string | undefined;
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import * as Schema from 'effect/Schema';
|
|
2
|
+
export declare const RunnerExecutionRouting: Schema.Union<readonly [Schema.Struct<{
|
|
3
|
+
readonly mode: Schema.Literal<"background">;
|
|
4
|
+
readonly requestedByUserId: Schema.optionalKey<Schema.String>;
|
|
5
|
+
}>, Schema.Struct<{
|
|
6
|
+
readonly mode: Schema.Literal<"foreground">;
|
|
7
|
+
readonly requestedByUserId: Schema.String;
|
|
8
|
+
readonly targetPersonalRunnerId: Schema.String;
|
|
9
|
+
readonly interaction: Schema.Literal<"observable">;
|
|
10
|
+
}>]>;
|
|
11
|
+
export type RunnerExecutionRouting = (typeof RunnerExecutionRouting)['Type'];
|
|
@@ -0,0 +1,67 @@
|
|
|
1
|
+
export declare const RunnerArchitecture: readonly ['amd64', 'arm64'];
|
|
2
|
+
export type RunnerArchitecture = (typeof RunnerArchitecture)[number];
|
|
3
|
+
declare const RunnerArtifactKinds: readonly ['host_package', 'oci_image'];
|
|
4
|
+
type RunnerArtifactKind = (typeof RunnerArtifactKinds)[number];
|
|
5
|
+
declare const RunnerArtifactTrustErrorCodes: readonly ['artifact_signature_invalid', 'artifact_sbom_invalid', 'artifact_provenance_invalid', 'artifact_expired', 'artifact_signed_in_future', 'artifact_architecture_mismatch', 'artifact_digest_not_allowed', 'artifact_profile_mismatch', 'artifact_sbom_mismatch', 'artifact_provenance_mismatch', 'artifact_metadata_rollback', 'artifact_metadata_expired', 'artifact_subject_mismatch', 'artifact_index_invalid'];
|
|
6
|
+
type RunnerArtifactTrustErrorCode = (typeof RunnerArtifactTrustErrorCodes)[number];
|
|
7
|
+
declare const RunnerArtifactTrustError_base: new <A extends Record<string, any> = {}>(args: import("effect/Types").VoidIfEmpty<{ readonly [P in keyof A as P extends "_tag" ? never : P]: A[P]; }>) => import("effect/Cause").YieldableError & {
|
|
8
|
+
readonly _tag: "RunnerArtifactTrustError";
|
|
9
|
+
} & Readonly<A>;
|
|
10
|
+
export declare class RunnerArtifactTrustError extends RunnerArtifactTrustError_base<{
|
|
11
|
+
readonly code: RunnerArtifactTrustErrorCode;
|
|
12
|
+
readonly message: string;
|
|
13
|
+
}> {
|
|
14
|
+
constructor(code: RunnerArtifactTrustErrorCode);
|
|
15
|
+
}
|
|
16
|
+
export type RunnerArtifactManifest = {
|
|
17
|
+
readonly contractVersion: 'runner-trust-distribution.v1';
|
|
18
|
+
readonly artifactId: string;
|
|
19
|
+
readonly kind: RunnerArtifactKind;
|
|
20
|
+
readonly version: string;
|
|
21
|
+
readonly channel: string;
|
|
22
|
+
readonly architecture: RunnerArchitecture;
|
|
23
|
+
readonly platform: 'linux';
|
|
24
|
+
readonly subjectDigest: string;
|
|
25
|
+
readonly subjectLength: number;
|
|
26
|
+
readonly profileDigest: string;
|
|
27
|
+
readonly certificationDigest: string;
|
|
28
|
+
readonly sbomDigest: string;
|
|
29
|
+
readonly provenanceDigest: string;
|
|
30
|
+
readonly metadataVersion: number;
|
|
31
|
+
readonly rollbackFloor: number;
|
|
32
|
+
readonly signedAt: string;
|
|
33
|
+
readonly expiresAt: string;
|
|
34
|
+
};
|
|
35
|
+
type RunnerArtifactManifestInput = Omit<RunnerArtifactManifest, 'contractVersion' | 'kind' | 'platform' | 'signedAt' | 'expiresAt'> & {
|
|
36
|
+
readonly kind?: RunnerArtifactKind;
|
|
37
|
+
readonly platform?: 'linux';
|
|
38
|
+
readonly signedAt: Date | string;
|
|
39
|
+
readonly expiresAt: Date | string;
|
|
40
|
+
};
|
|
41
|
+
type RunnerArtifactVerificationResult = {
|
|
42
|
+
readonly ok: boolean;
|
|
43
|
+
readonly reasons: readonly RunnerArtifactTrustErrorCode[];
|
|
44
|
+
};
|
|
45
|
+
type RunnerOciManifest = {
|
|
46
|
+
readonly digest: string;
|
|
47
|
+
readonly size: number;
|
|
48
|
+
readonly platform: {
|
|
49
|
+
readonly os: 'linux';
|
|
50
|
+
readonly architecture: RunnerArchitecture;
|
|
51
|
+
};
|
|
52
|
+
readonly artifactDigest: string;
|
|
53
|
+
};
|
|
54
|
+
export type RunnerOciIndex = {
|
|
55
|
+
readonly schemaVersion: 2;
|
|
56
|
+
readonly mediaType: 'application/vnd.oci.image.index.v1+json';
|
|
57
|
+
readonly indexDigest: string;
|
|
58
|
+
readonly manifests: readonly RunnerOciManifest[];
|
|
59
|
+
};
|
|
60
|
+
export declare function createRunnerArtifactManifest(input: RunnerArtifactManifestInput): RunnerArtifactManifest;
|
|
61
|
+
export declare function verifyRunnerOciIndex(index: RunnerOciIndex): RunnerArtifactVerificationResult;
|
|
62
|
+
export declare function createRunnerOciIndex(artifacts: readonly RunnerArtifactManifest[], options?: {
|
|
63
|
+
readonly digest?: string;
|
|
64
|
+
}): RunnerOciIndex;
|
|
65
|
+
export declare function runnerCanonicalJson<ValueType>(value: ValueType): string;
|
|
66
|
+
export declare function sha256(value: string): string;
|
|
67
|
+
export {};
|