@ultrst-armada/kloks 1.24.11 → 1.25.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/package.json +5 -4
- package/packages/audio-midi/dist/index.js +16 -16
- package/packages/backend/dist/chunk-CA5HVC4X.js +155 -0
- package/packages/backend/dist/{chunk-UC25J7E4.js → chunk-COA3ABWL.js} +1 -1
- package/packages/backend/dist/chunk-GKQ42CYW.js +47 -0
- package/packages/backend/dist/{chunk-XHADDA75.js → chunk-RIOYKF3X.js} +18 -10
- package/packages/backend/dist/development/index.d.ts +4 -113
- package/packages/backend/dist/development/index.js +31 -204
- package/packages/backend/dist/development/webContainerRuntime.d.ts +2 -0
- package/packages/backend/dist/development/webContainerRuntime.js +12 -0
- package/packages/backend/dist/development/webContainerService.d.ts +17 -0
- package/packages/backend/dist/development/webContainerService.js +19 -0
- package/packages/backend/dist/index.d.ts +17 -1
- package/packages/backend/dist/index.js +62 -2
- package/packages/backend/dist/krnl-services.js +2 -2
- package/packages/backend/dist/srkl/index.d.ts +0 -5
- package/packages/backend/dist/srkl/index.js +1 -1
- package/packages/backend/dist/webContainerRuntime-BnHB2bNz.d.ts +103 -0
- package/packages/backend/package.json +7 -2
- package/packages/client/dist/auth.d.ts +13 -0
- package/packages/client/dist/index.d.ts +1 -0
- package/packages/client/package.json +1 -1
- package/packages/functions/dist/index.js +16 -16
- package/packages/services/dist/index.d.ts +70 -1
- package/packages/services/dist/index.js +130 -16
- package/packages/services/kloks.manifest.json +28 -0
- package/packages/state-graph/dist/index.js +30 -30
- package/.krusbl-release-attestation.json +0 -8
|
@@ -73,6 +73,11 @@
|
|
|
73
73
|
"types": "./dist/development/index.d.ts",
|
|
74
74
|
"default": "./dist/development/index.js"
|
|
75
75
|
},
|
|
76
|
+
"./development/webcontainer": {
|
|
77
|
+
"import": "./dist/development/webContainerService.js",
|
|
78
|
+
"types": "./dist/development/webContainerService.d.ts",
|
|
79
|
+
"default": "./dist/development/webContainerService.js"
|
|
80
|
+
},
|
|
76
81
|
"./ai-provider": {
|
|
77
82
|
"import": "./dist/ai-provider/index.js",
|
|
78
83
|
"types": "./dist/ai-provider/index.d.ts",
|
|
@@ -110,12 +115,12 @@
|
|
|
110
115
|
}
|
|
111
116
|
},
|
|
112
117
|
"scripts": {
|
|
113
|
-
"build": "tsup src/index.ts src/krnl-services.ts src/krnl-ai-services.ts src/services/index.ts src/auth/index.ts src/storage/index.ts src/workspace/index.ts src/control-plane/index.ts src/api/index.ts src/connectivity/index.ts src/client/index.ts src/srkl/index.ts src/development/index.ts src/development/playwrightInspectionService.ts src/development/playwrightInspectionTypes.ts src/ai-provider/index.ts src/ai-inference/index.ts src/ai-models/index.ts src/ai-routing/index.ts src/ai-keys/index.ts src/ai-tools/index.ts --format esm --dts --clean --external @kloks/functions --external react --external @kloks/state-graph --external @neondatabase/serverless --external @supabase/supabase-js --external @aws-sdk/client-s3 --external @aws-sdk/lib-storage --external zod --external ws --external @webcontainer/api --external playwright && tsup src/development/client.ts --format esm --dts --out-dir dist/development --splitting false --platform browser --external @ultrst-armada/krnl",
|
|
118
|
+
"build": "tsup src/index.ts src/krnl-services.ts src/krnl-ai-services.ts src/services/index.ts src/auth/index.ts src/storage/index.ts src/workspace/index.ts src/control-plane/index.ts src/api/index.ts src/connectivity/index.ts src/client/index.ts src/srkl/index.ts src/development/index.ts src/development/webContainerService.ts src/development/webContainerRuntime.ts src/development/playwrightInspectionService.ts src/development/playwrightInspectionTypes.ts src/ai-provider/index.ts src/ai-inference/index.ts src/ai-models/index.ts src/ai-routing/index.ts src/ai-keys/index.ts src/ai-tools/index.ts --format esm --dts --clean --external @kloks/functions --external react --external @kloks/state-graph --external @neondatabase/serverless --external @supabase/supabase-js --external @aws-sdk/client-s3 --external @aws-sdk/lib-storage --external zod --external ws --external @webcontainer/api --external playwright && tsup src/development/client.ts --format esm --dts --out-dir dist/development --splitting false --platform browser --external @ultrst-armada/krnl",
|
|
114
119
|
"typecheck": "tsc --noEmit",
|
|
115
120
|
"clean": "rm -rf dist"
|
|
116
121
|
},
|
|
117
122
|
"dependencies": {
|
|
118
|
-
"@dinilmusick/gutts": "^1.4.
|
|
123
|
+
"@dinilmusick/gutts": "^1.4.4",
|
|
119
124
|
"@kloks/functions": "workspace:*",
|
|
120
125
|
"@kloks/state-graph": "workspace:*",
|
|
121
126
|
"@webcontainer/api": "^1.6.4"
|
|
@@ -1 +1,14 @@
|
|
|
1
|
+
import { DeploymentEnvironment } from '@dinilmusick/gutts/auth';
|
|
1
2
|
export { LuthAuthClient as CanonicalAuthClient, DEFAULT_LUTH_URL, DeploymentEnvironment, EmailSignInCredentials, EmailSignUpData, GoogleSignInOptions, LuthAuthClient, LuthAuthClientConfig, LuthAuthError, LuthAuthTokenStore, LuthSession, LuthSessionResult, LuthUser, RegisterApplicationResult, createLuthAuthClient as createCanonicalAuthClient, createLuthAuthClient, hydrateLuthTokenFromUrl, resolveClientEnvironment, resolveClientOrigin } from '@dinilmusick/gutts/auth';
|
|
3
|
+
|
|
4
|
+
interface LuthDeploymentRecord {
|
|
5
|
+
id: string;
|
|
6
|
+
url: string;
|
|
7
|
+
label?: string;
|
|
8
|
+
environment?: DeploymentEnvironment;
|
|
9
|
+
isActive: boolean;
|
|
10
|
+
isPrimary?: boolean;
|
|
11
|
+
priority?: number;
|
|
12
|
+
}
|
|
13
|
+
|
|
14
|
+
export type { LuthDeploymentRecord };
|
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
export { LuthDeploymentRecord } from './auth.js';
|
|
1
2
|
export { LuthAuthClient as CanonicalAuthClient, DEFAULT_LUTH_URL, DeploymentEnvironment, EmailSignInCredentials, EmailSignUpData, GoogleSignInOptions, LuthAuthClient, LuthAuthClientConfig, LuthAuthError, LuthAuthTokenStore, LuthSession, LuthSessionResult, LuthUser, RegisterApplicationResult, createLuthAuthClient as createCanonicalAuthClient, createLuthAuthClient, hydrateLuthTokenFromUrl, resolveClientEnvironment, resolveClientOrigin } from '@dinilmusick/gutts/auth';
|
|
2
3
|
|
|
3
4
|
/**
|
|
@@ -3,7 +3,7 @@ import "./chunk-QGM4M3NI.js";
|
|
|
3
3
|
// ../../node_modules/.pnpm/@ultrst-armada+krnl@1.0.9_@types+node@22.20.5/node_modules/@ultrst-armada/krnl/packages/core/dist/index.js
|
|
4
4
|
import { randomUUID } from "crypto";
|
|
5
5
|
|
|
6
|
-
// ../../node_modules/.pnpm/@dinilmusick+gutts@1.4.
|
|
6
|
+
// ../../node_modules/.pnpm/@dinilmusick+gutts@1.4.4_@types+node@22.20.5/node_modules/@dinilmusick/gutts/dist/api/define-api.js
|
|
7
7
|
function defineApi(definition) {
|
|
8
8
|
const properties = Object.fromEntries(definition.parameters.map((parameter) => [
|
|
9
9
|
parameter.name,
|
|
@@ -24,7 +24,7 @@ function defineApi(definition) {
|
|
|
24
24
|
});
|
|
25
25
|
}
|
|
26
26
|
|
|
27
|
-
// ../../node_modules/.pnpm/@dinilmusick+gutts@1.4.
|
|
27
|
+
// ../../node_modules/.pnpm/@dinilmusick+gutts@1.4.4_@types+node@22.20.5/node_modules/@dinilmusick/gutts/dist/api/array-apis.js
|
|
28
28
|
var array = { type: "array" };
|
|
29
29
|
var integer = { type: "integer" };
|
|
30
30
|
var arrayApis = [
|
|
@@ -35,7 +35,7 @@ var arrayApis = [
|
|
|
35
35
|
defineApi({ id: "gutts.arrays.last", name: "last", category: "arrays", description: "Returns the final element of an array, or undefined when the array is empty.", parameters: [{ name: "values", description: "The array whose final element should be returned.", required: true, schema: array }], output: { description: "The final array element, or undefined for an empty array." }, semantics: { deterministic: true, pure: true, sideEffects: false } })
|
|
36
36
|
];
|
|
37
37
|
|
|
38
|
-
// ../../node_modules/.pnpm/@dinilmusick+gutts@1.4.
|
|
38
|
+
// ../../node_modules/.pnpm/@dinilmusick+gutts@1.4.4_@types+node@22.20.5/node_modules/@dinilmusick/gutts/dist/api/json-apis.js
|
|
39
39
|
var json = { type: "object", description: "A JSON-compatible value." };
|
|
40
40
|
var jsonApis = [
|
|
41
41
|
defineApi({ id: "gutts.json.isJsonValue", name: "isJsonValue", category: "json", description: "Checks whether an unknown value can be represented as a finite JSON value.", parameters: [{ name: "value", description: "The value to validate as JSON-compatible data.", required: true, schema: {} }], output: { type: "boolean", description: "True when the value is a valid JSON value." }, semantics: { deterministic: true, pure: true, sideEffects: false } }),
|
|
@@ -44,7 +44,7 @@ var jsonApis = [
|
|
|
44
44
|
defineApi({ id: "gutts.json.stringifyJson", name: "stringifyJson", category: "json", description: "Serializes a JSON-compatible value into JSON text, optionally using indentation.", parameters: [{ name: "value", description: "The JSON-compatible value to serialize.", required: true, schema: {} }, { name: "space", description: "Optional number of indentation spaces to use in the serialized output.", required: false, schema: { type: "number" } }], output: { type: "string", description: "The serialized JSON text." }, semantics: { deterministic: true, pure: true, sideEffects: false }, errors: ["Throws TypeError when the value cannot be serialized as JSON."] })
|
|
45
45
|
];
|
|
46
46
|
|
|
47
|
-
// ../../node_modules/.pnpm/@dinilmusick+gutts@1.4.
|
|
47
|
+
// ../../node_modules/.pnpm/@dinilmusick+gutts@1.4.4_@types+node@22.20.5/node_modules/@dinilmusick/gutts/dist/api/number-apis.js
|
|
48
48
|
var numberApis = [
|
|
49
49
|
defineApi({ id: "gutts.numbers.clamp", name: "clamp", category: "numbers", description: "Restricts a numeric value to an inclusive minimum and maximum range.", parameters: [{ name: "value", description: "The numeric value to constrain.", required: true, schema: { type: "number" } }, { name: "min", description: "The inclusive lower bound.", required: true, schema: { type: "number" } }, { name: "max", description: "The inclusive upper bound.", required: true, schema: { type: "number" } }], output: { type: "number", description: "The value constrained to the inclusive range." }, semantics: { deterministic: true, pure: true, sideEffects: false }, errors: ["Throws RangeError when min exceeds max."] }),
|
|
50
50
|
defineApi({ id: "gutts.numbers.inRange", name: "inRange", category: "numbers", description: "Checks whether a numeric value falls within the configured range.", parameters: [{ name: "value", description: "The numeric value to test.", required: true, schema: { type: "number" } }, { name: "min", description: "The lower range boundary.", required: true, schema: { type: "number" } }, { name: "max", description: "The upper range boundary.", required: true, schema: { type: "number" } }], output: { type: "boolean", description: "Whether the value is inside the range." }, semantics: { deterministic: true, pure: true, sideEffects: false }, errors: ["Throws RangeError when min exceeds max."] }),
|
|
@@ -53,7 +53,7 @@ var numberApis = [
|
|
|
53
53
|
defineApi({ id: "gutts.numbers.sum", name: "sum", category: "numbers", description: "Adds all numbers in an array and returns their total.", parameters: [{ name: "values", description: "The numeric values to add.", required: true, schema: { type: "array", items: { type: "number" } } }], output: { type: "number", description: "The sum of all input numbers." }, semantics: { deterministic: true, pure: true, sideEffects: false } })
|
|
54
54
|
];
|
|
55
55
|
|
|
56
|
-
// ../../node_modules/.pnpm/@dinilmusick+gutts@1.4.
|
|
56
|
+
// ../../node_modules/.pnpm/@dinilmusick+gutts@1.4.4_@types+node@22.20.5/node_modules/@dinilmusick/gutts/dist/api/object-apis.js
|
|
57
57
|
var objectApis = [
|
|
58
58
|
defineApi({ id: "gutts.objects.hasOwn", name: "hasOwn", category: "objects", description: "Checks whether an object contains a requested property.", parameters: [{ name: "value", description: "The object to inspect.", required: true, schema: { type: "object" } }, { name: "key", description: "The property key to look for.", required: true, schema: { type: "string" } }], output: { type: "boolean" }, semantics: { deterministic: true, pure: true, sideEffects: false } }),
|
|
59
59
|
defineApi({ id: "gutts.objects.pick", name: "pick", category: "objects", description: "Creates an object containing only requested properties.", parameters: [{ name: "value", description: "The source object.", required: true, schema: { type: "object" } }, { name: "keys", description: "The property keys to retain.", required: true, schema: { type: "array", items: { type: "string" } } }], output: { type: "object" }, semantics: { deterministic: true, pure: true, sideEffects: false } }),
|
|
@@ -61,7 +61,7 @@ var objectApis = [
|
|
|
61
61
|
defineApi({ id: "gutts.objects.isPlainObject", name: "isPlainObject", category: "objects", description: "Checks whether a value is a plain JavaScript object.", parameters: [{ name: "value", description: "The value to classify.", required: true, schema: {} }], output: { type: "boolean" }, semantics: { deterministic: true, pure: true, sideEffects: false } })
|
|
62
62
|
];
|
|
63
63
|
|
|
64
|
-
// ../../node_modules/.pnpm/@dinilmusick+gutts@1.4.
|
|
64
|
+
// ../../node_modules/.pnpm/@dinilmusick+gutts@1.4.4_@types+node@22.20.5/node_modules/@dinilmusick/gutts/dist/api/string-apis.js
|
|
65
65
|
var string = { type: "string" };
|
|
66
66
|
var stringApis = [
|
|
67
67
|
defineApi({ id: "gutts.strings.isBlank", name: "isBlank", category: "strings", description: "Checks whether a string contains no non-whitespace characters.", parameters: [{ name: "value", description: "The string to inspect.", required: true, schema: string }], output: { type: "boolean" }, semantics: { deterministic: true, pure: true, sideEffects: false } }),
|
|
@@ -77,7 +77,7 @@ var stringApis = [
|
|
|
77
77
|
defineApi({ id: "gutts.strings.truncateWords", name: "truncateWords", category: "strings", description: "Shortens a string to a maximum number of words and appends a suffix when truncation is required.", parameters: [{ name: "value", description: "The string to shorten.", required: true, schema: string }, { name: "maxWords", description: "The non-negative maximum number of words.", required: true, schema: { type: "number" } }, { name: "suffix", description: "The suffix used when truncation occurs.", required: false, schema: string }], output: { type: "string" }, semantics: { deterministic: true, pure: true, sideEffects: false }, errors: ["Throws RangeError when maxWords is negative."] })
|
|
78
78
|
];
|
|
79
79
|
|
|
80
|
-
// ../../node_modules/.pnpm/@dinilmusick+gutts@1.4.
|
|
80
|
+
// ../../node_modules/.pnpm/@dinilmusick+gutts@1.4.4_@types+node@22.20.5/node_modules/@dinilmusick/gutts/dist/api/url-apis.js
|
|
81
81
|
var string2 = { type: "string" };
|
|
82
82
|
var urlApis = [
|
|
83
83
|
defineApi({ id: "gutts.urls.isUrl", name: "isUrl", category: "urls", description: "Checks whether a string can be parsed as a URL by the standard URL constructor.", parameters: [{ name: "value", description: "The string to validate.", required: true, schema: string2 }], output: { type: "boolean" }, semantics: { deterministic: true, pure: true, sideEffects: false } }),
|
|
@@ -86,7 +86,7 @@ var urlApis = [
|
|
|
86
86
|
defineApi({ id: "gutts.urls.setQueryParam", name: "setQueryParam", category: "urls", description: "Returns a URL with one query-string parameter set to the supplied value.", parameters: [{ name: "url", description: "The URL to modify.", required: true, schema: string2 }, { name: "key", description: "The query parameter name.", required: true, schema: string2 }, { name: "value", description: "The query parameter value.", required: true, schema: string2 }], output: { type: "string" }, semantics: { deterministic: true, pure: true, sideEffects: false }, errors: ["Throws when url cannot be parsed as a URL."] })
|
|
87
87
|
];
|
|
88
88
|
|
|
89
|
-
// ../../node_modules/.pnpm/@dinilmusick+gutts@1.4.
|
|
89
|
+
// ../../node_modules/.pnpm/@dinilmusick+gutts@1.4.4_@types+node@22.20.5/node_modules/@dinilmusick/gutts/dist/models/needle3/index.js
|
|
90
90
|
var needle3Metadata = {
|
|
91
91
|
id: "model.cactus-needle3",
|
|
92
92
|
name: "Needle 3",
|
|
@@ -117,12 +117,12 @@ var needle3CompleteApi = defineApi({
|
|
|
117
117
|
semantics: { deterministic: false, pure: false, sideEffects: false }
|
|
118
118
|
});
|
|
119
119
|
|
|
120
|
-
// ../../node_modules/.pnpm/@dinilmusick+gutts@1.4.
|
|
120
|
+
// ../../node_modules/.pnpm/@dinilmusick+gutts@1.4.4_@types+node@22.20.5/node_modules/@dinilmusick/gutts/dist/models/runtimes/ettin-head.js
|
|
121
121
|
import fs from "fs";
|
|
122
122
|
import path from "path";
|
|
123
123
|
import os from "os";
|
|
124
124
|
|
|
125
|
-
// ../../node_modules/.pnpm/@dinilmusick+gutts@1.4.
|
|
125
|
+
// ../../node_modules/.pnpm/@dinilmusick+gutts@1.4.4_@types+node@22.20.5/node_modules/@dinilmusick/gutts/dist/models/smollm2/index.js
|
|
126
126
|
var smolLM2Metadata = {
|
|
127
127
|
id: "model.smollm2-135m-instruct",
|
|
128
128
|
name: "SmolLM2-135M-Instruct",
|
|
@@ -154,7 +154,7 @@ var smolLM2GenerateApi = defineApi({
|
|
|
154
154
|
errors: ["Model load failure", "Inference failure"]
|
|
155
155
|
});
|
|
156
156
|
|
|
157
|
-
// ../../node_modules/.pnpm/@dinilmusick+gutts@1.4.
|
|
157
|
+
// ../../node_modules/.pnpm/@dinilmusick+gutts@1.4.4_@types+node@22.20.5/node_modules/@dinilmusick/gutts/dist/models/whistle/index.js
|
|
158
158
|
var whistleMetadata = {
|
|
159
159
|
id: "model.cactus-whistle",
|
|
160
160
|
name: "Whistle",
|
|
@@ -184,7 +184,7 @@ var whistleTranscribeApi = defineApi({
|
|
|
184
184
|
semantics: { deterministic: true, pure: false, sideEffects: false }
|
|
185
185
|
});
|
|
186
186
|
|
|
187
|
-
// ../../node_modules/.pnpm/@dinilmusick+gutts@1.4.
|
|
187
|
+
// ../../node_modules/.pnpm/@dinilmusick+gutts@1.4.4_@types+node@22.20.5/node_modules/@dinilmusick/gutts/dist/models/ettin/index.js
|
|
188
188
|
var defineEttin = (id2, name, parameters, description) => ({
|
|
189
189
|
id: id2,
|
|
190
190
|
name,
|
|
@@ -219,7 +219,7 @@ var ettinRerankApi = defineApi({
|
|
|
219
219
|
semantics: { deterministic: true, pure: false, sideEffects: false }
|
|
220
220
|
});
|
|
221
221
|
|
|
222
|
-
// ../../node_modules/.pnpm/@dinilmusick+gutts@1.4.
|
|
222
|
+
// ../../node_modules/.pnpm/@dinilmusick+gutts@1.4.4_@types+node@22.20.5/node_modules/@dinilmusick/gutts/dist/models/minilm/index.js
|
|
223
223
|
var miniLML6Metadata = {
|
|
224
224
|
id: "model.minilm-l6-v2",
|
|
225
225
|
name: "MiniLM-L6-v2",
|
|
@@ -250,7 +250,7 @@ var miniLMSimilarityApi = defineApi({
|
|
|
250
250
|
semantics: { deterministic: true, pure: false, sideEffects: false }
|
|
251
251
|
});
|
|
252
252
|
|
|
253
|
-
// ../../node_modules/.pnpm/@dinilmusick+gutts@1.4.
|
|
253
|
+
// ../../node_modules/.pnpm/@dinilmusick+gutts@1.4.4_@types+node@22.20.5/node_modules/@dinilmusick/gutts/dist/api/api-registry.js
|
|
254
254
|
var guttsApiDefinitions = Object.freeze([
|
|
255
255
|
...arrayApis,
|
|
256
256
|
...jsonApis,
|
|
@@ -266,7 +266,7 @@ var guttsApiDefinitions = Object.freeze([
|
|
|
266
266
|
]);
|
|
267
267
|
var guttsApiById = Object.freeze(Object.fromEntries(guttsApiDefinitions.map((api) => [api.id, api])));
|
|
268
268
|
|
|
269
|
-
// ../../node_modules/.pnpm/@dinilmusick+gutts@1.4.
|
|
269
|
+
// ../../node_modules/.pnpm/@dinilmusick+gutts@1.4.4_@types+node@22.20.5/node_modules/@dinilmusick/gutts/dist/api/fod-node-provider.js
|
|
270
270
|
var schemaType = (schema) => String(schema?.type ?? "any");
|
|
271
271
|
function guttsApiToFodNode(api) {
|
|
272
272
|
return {
|
|
@@ -282,7 +282,7 @@ function guttsApiToFodNode(api) {
|
|
|
282
282
|
}
|
|
283
283
|
var guttsFodNodeDefinitions = Object.freeze(guttsApiDefinitions.map(guttsApiToFodNode));
|
|
284
284
|
|
|
285
|
-
// ../../node_modules/.pnpm/@dinilmusick+gutts@1.4.
|
|
285
|
+
// ../../node_modules/.pnpm/@dinilmusick+gutts@1.4.4_@types+node@22.20.5/node_modules/@dinilmusick/gutts/dist/models/model-registry.js
|
|
286
286
|
var guttsModelDefinitions = Object.freeze([
|
|
287
287
|
smolLM2Metadata,
|
|
288
288
|
needle3Metadata,
|
|
@@ -454,6 +454,75 @@ declare const krnlSystemDbClientServiceFacade: {
|
|
|
454
454
|
execute: <TIn = unknown, TOut = unknown>(op: string, input?: TIn) => Promise<TOut>;
|
|
455
455
|
};
|
|
456
456
|
|
|
457
|
+
interface GitHubAppInstallation {
|
|
458
|
+
account: string;
|
|
459
|
+
appId: number;
|
|
460
|
+
installationId: number;
|
|
461
|
+
privateKey: string;
|
|
462
|
+
}
|
|
463
|
+
interface GitHubAppConnectorOptions {
|
|
464
|
+
installations: GitHubAppInstallation[];
|
|
465
|
+
apiBaseUrl?: string;
|
|
466
|
+
fetchImpl?: typeof fetch;
|
|
467
|
+
now?: () => number;
|
|
468
|
+
signer?: (installation: GitHubAppInstallation, nowSeconds: number) => Promise<string>;
|
|
469
|
+
}
|
|
470
|
+
interface GitHubOperationResult<T> {
|
|
471
|
+
ok: true;
|
|
472
|
+
operation: string;
|
|
473
|
+
data: T;
|
|
474
|
+
diagnostics: {
|
|
475
|
+
startedAt: string;
|
|
476
|
+
completedAt: string;
|
|
477
|
+
status: number;
|
|
478
|
+
requestId?: string;
|
|
479
|
+
};
|
|
480
|
+
}
|
|
481
|
+
interface GitHubOperationError {
|
|
482
|
+
ok: false;
|
|
483
|
+
operation: string;
|
|
484
|
+
error: {
|
|
485
|
+
message: string;
|
|
486
|
+
status?: number;
|
|
487
|
+
diagnostics?: unknown;
|
|
488
|
+
};
|
|
489
|
+
}
|
|
490
|
+
type GitHubResult<T> = GitHubOperationResult<T> | GitHubOperationError;
|
|
491
|
+
interface GitHubWorkflowRun {
|
|
492
|
+
id: number;
|
|
493
|
+
status: string;
|
|
494
|
+
conclusion: string | null;
|
|
495
|
+
html_url?: string;
|
|
496
|
+
created_at: string;
|
|
497
|
+
updated_at: string;
|
|
498
|
+
run_number?: number;
|
|
499
|
+
}
|
|
500
|
+
declare class GitHubAppConnector {
|
|
501
|
+
readonly id = "github-app";
|
|
502
|
+
private readonly apiBaseUrl;
|
|
503
|
+
private readonly fetchImpl;
|
|
504
|
+
private readonly now;
|
|
505
|
+
private readonly signer;
|
|
506
|
+
private readonly installations;
|
|
507
|
+
private readonly tokens;
|
|
508
|
+
constructor(options: GitHubAppConnectorOptions);
|
|
509
|
+
listAccounts(): string[];
|
|
510
|
+
private installation;
|
|
511
|
+
private installationToken;
|
|
512
|
+
private request;
|
|
513
|
+
getRepository(account: string, repository: string): Promise<GitHubResult<unknown>>;
|
|
514
|
+
listRepositories(account: string, page?: number, perPage?: number): Promise<GitHubResult<unknown>>;
|
|
515
|
+
getFile(account: string, repository: string, path: string, ref?: string): Promise<GitHubResult<unknown>>;
|
|
516
|
+
commitFile(account: string, repository: string, path: string, content: string, message: string, branch: string, sha?: string): Promise<GitHubResult<unknown>>;
|
|
517
|
+
createPullRequest(account: string, repository: string, title: string, body: string, head: string, base?: string): Promise<GitHubResult<unknown>>;
|
|
518
|
+
dispatchWorkflow(account: string, repository: string, workflow: string, ref: string, inputs?: Record<string, string>): Promise<GitHubResult<undefined>>;
|
|
519
|
+
pollWorkflow(account: string, repository: string, workflow: string, ref: string, startedAfter: string, options?: {
|
|
520
|
+
timeoutMs?: number;
|
|
521
|
+
intervalMs?: number;
|
|
522
|
+
}): Promise<GitHubResult<GitHubWorkflowRun>>;
|
|
523
|
+
}
|
|
524
|
+
declare const createGitHubAppConnector: (options: GitHubAppConnectorOptions) => GitHubAppConnector;
|
|
525
|
+
|
|
457
526
|
interface GitHubVcsProviderOptions {
|
|
458
527
|
token: string;
|
|
459
528
|
apiBaseUrl?: string;
|
|
@@ -625,4 +694,4 @@ declare const krnlServiceDDefinition: ServiceDefinition<Record<string, unknown>,
|
|
|
625
694
|
declare const krnlServiceDFacade: ServiceFacade<Record<string, unknown>, Record<string, unknown>>;
|
|
626
695
|
declare const krnlExposeServiceD: typeof exposeServiceD;
|
|
627
696
|
|
|
628
|
-
export { AuthClientServiceDefinition, AuthClientServiceFacade, type AuthListener, AuthService, AuthServiceUISchema, CLEAN_DATABASE_CLUSTER, CommandVerificationProvider, type CounterState, DEFAULT_CONNECTIONS, type EcosystemServiceCategory, type GitHubFile, GitHubVcsProvider, type GitHubVcsProviderOptions, type IAuthStore, KLOKSServiceIndex, LocalExecutionProvider, type LocalExecutionRequest, type LocalExecutionResult, LocalWorkspaceProvider, type MathInput, MonacoIdeServiceDefinition, MonacoIdeServiceFacade, type ProtocolExposureHandle, STORAGE_KEY_CONNECTIONS, ServiceADefinition, ServiceAFacade, ServiceBDefinition, ServiceBFacade, ServiceCDefinition, ServiceCFacade, ServiceDDefinition, ServiceDFacade, type ServiceFacade, type ServiceIdentity, type ServiceMatch, type ServiceMatchClass, type ServiceMatchEvidence, type ServiceOperationIdentity, type SrklAccount, SrklAccountClient, type SrklAccountClientOptions, type SrklAccountManifest, type SrklAccountSyncResult, StorageClientServiceDefinition, StorageClientServiceFacade, StorageService, StorageServiceUISchema, SystemDbClientServiceDefinition, SystemDbClientServiceFacade, SystemDbService, SystemDbServiceUISchema, type SystemEnvironmentStatus, type SystemTelemetry, type TelemetryEvents, UIAuthoringServiceDefinition, UIAuthoringServiceFacade, type VerificationReport, type VerificationStep, type Workspace, authService, buildServiceIdentity, clearSession, compareServices, createMonacoIdeService, createServiceB, createServiceC, createSrklAccountClient, createUIAuthoringService, createWorkspace, deleteWorkspace, exposeServiceD, fetchWorkspaces, krnlAuthClientServiceDefinition, krnlAuthClientServiceFacade, krnlCreateServiceB, krnlCreateServiceC, krnlExposeServiceD, krnlServiceADefinition, krnlServiceAFacade, krnlServiceBDefinition, krnlServiceBFacade, krnlServiceCDefinition, krnlServiceCFacade, krnlServiceDDefinition, krnlServiceDFacade, krnlStorageClientServiceDefinition, krnlStorageClientServiceFacade, krnlSystemDbClientServiceDefinition, krnlSystemDbClientServiceFacade, loadDatabase, loginAdmin, loginUser, mergeSrklAccounts, persistDatabase, register, restoreSession, setActiveWorkspace, setSession, storageService, systemDbService, updateWorkspace, verifyPassword };
|
|
697
|
+
export { AuthClientServiceDefinition, AuthClientServiceFacade, type AuthListener, AuthService, AuthServiceUISchema, CLEAN_DATABASE_CLUSTER, CommandVerificationProvider, type CounterState, DEFAULT_CONNECTIONS, type EcosystemServiceCategory, GitHubAppConnector, type GitHubAppConnectorOptions, type GitHubAppInstallation, type GitHubFile, type GitHubOperationError, type GitHubOperationResult, type GitHubResult, GitHubVcsProvider, type GitHubVcsProviderOptions, type GitHubWorkflowRun, type IAuthStore, KLOKSServiceIndex, LocalExecutionProvider, type LocalExecutionRequest, type LocalExecutionResult, LocalWorkspaceProvider, type MathInput, MonacoIdeServiceDefinition, MonacoIdeServiceFacade, type ProtocolExposureHandle, STORAGE_KEY_CONNECTIONS, ServiceADefinition, ServiceAFacade, ServiceBDefinition, ServiceBFacade, ServiceCDefinition, ServiceCFacade, ServiceDDefinition, ServiceDFacade, type ServiceFacade, type ServiceIdentity, type ServiceMatch, type ServiceMatchClass, type ServiceMatchEvidence, type ServiceOperationIdentity, type SrklAccount, SrklAccountClient, type SrklAccountClientOptions, type SrklAccountManifest, type SrklAccountSyncResult, StorageClientServiceDefinition, StorageClientServiceFacade, StorageService, StorageServiceUISchema, SystemDbClientServiceDefinition, SystemDbClientServiceFacade, SystemDbService, SystemDbServiceUISchema, type SystemEnvironmentStatus, type SystemTelemetry, type TelemetryEvents, UIAuthoringServiceDefinition, UIAuthoringServiceFacade, type VerificationReport, type VerificationStep, type Workspace, authService, buildServiceIdentity, clearSession, compareServices, createGitHubAppConnector, createMonacoIdeService, createServiceB, createServiceC, createSrklAccountClient, createUIAuthoringService, createWorkspace, deleteWorkspace, exposeServiceD, fetchWorkspaces, krnlAuthClientServiceDefinition, krnlAuthClientServiceFacade, krnlCreateServiceB, krnlCreateServiceC, krnlExposeServiceD, krnlServiceADefinition, krnlServiceAFacade, krnlServiceBDefinition, krnlServiceBFacade, krnlServiceCDefinition, krnlServiceCFacade, krnlServiceDDefinition, krnlServiceDFacade, krnlStorageClientServiceDefinition, krnlStorageClientServiceFacade, krnlSystemDbClientServiceDefinition, krnlSystemDbClientServiceFacade, loadDatabase, loginAdmin, loginUser, mergeSrklAccounts, persistDatabase, register, restoreSession, setActiveWorkspace, setSession, storageService, systemDbService, updateWorkspace, verifyPassword };
|
|
@@ -4,7 +4,7 @@ import "./chunk-QGM4M3NI.js";
|
|
|
4
4
|
import { randomUUID } from "crypto";
|
|
5
5
|
import http from "http";
|
|
6
6
|
|
|
7
|
-
// ../../node_modules/.pnpm/@dinilmusick+gutts@1.4.
|
|
7
|
+
// ../../node_modules/.pnpm/@dinilmusick+gutts@1.4.4_@types+node@22.20.5/node_modules/@dinilmusick/gutts/dist/api/define-api.js
|
|
8
8
|
function defineApi(definition) {
|
|
9
9
|
const properties = Object.fromEntries(definition.parameters.map((parameter) => [
|
|
10
10
|
parameter.name,
|
|
@@ -25,7 +25,7 @@ function defineApi(definition) {
|
|
|
25
25
|
});
|
|
26
26
|
}
|
|
27
27
|
|
|
28
|
-
// ../../node_modules/.pnpm/@dinilmusick+gutts@1.4.
|
|
28
|
+
// ../../node_modules/.pnpm/@dinilmusick+gutts@1.4.4_@types+node@22.20.5/node_modules/@dinilmusick/gutts/dist/api/array-apis.js
|
|
29
29
|
var array = { type: "array" };
|
|
30
30
|
var integer = { type: "integer" };
|
|
31
31
|
var arrayApis = [
|
|
@@ -36,7 +36,7 @@ var arrayApis = [
|
|
|
36
36
|
defineApi({ id: "gutts.arrays.last", name: "last", category: "arrays", description: "Returns the final element of an array, or undefined when the array is empty.", parameters: [{ name: "values", description: "The array whose final element should be returned.", required: true, schema: array }], output: { description: "The final array element, or undefined for an empty array." }, semantics: { deterministic: true, pure: true, sideEffects: false } })
|
|
37
37
|
];
|
|
38
38
|
|
|
39
|
-
// ../../node_modules/.pnpm/@dinilmusick+gutts@1.4.
|
|
39
|
+
// ../../node_modules/.pnpm/@dinilmusick+gutts@1.4.4_@types+node@22.20.5/node_modules/@dinilmusick/gutts/dist/api/json-apis.js
|
|
40
40
|
var json = { type: "object", description: "A JSON-compatible value." };
|
|
41
41
|
var jsonApis = [
|
|
42
42
|
defineApi({ id: "gutts.json.isJsonValue", name: "isJsonValue", category: "json", description: "Checks whether an unknown value can be represented as a finite JSON value.", parameters: [{ name: "value", description: "The value to validate as JSON-compatible data.", required: true, schema: {} }], output: { type: "boolean", description: "True when the value is a valid JSON value." }, semantics: { deterministic: true, pure: true, sideEffects: false } }),
|
|
@@ -45,7 +45,7 @@ var jsonApis = [
|
|
|
45
45
|
defineApi({ id: "gutts.json.stringifyJson", name: "stringifyJson", category: "json", description: "Serializes a JSON-compatible value into JSON text, optionally using indentation.", parameters: [{ name: "value", description: "The JSON-compatible value to serialize.", required: true, schema: {} }, { name: "space", description: "Optional number of indentation spaces to use in the serialized output.", required: false, schema: { type: "number" } }], output: { type: "string", description: "The serialized JSON text." }, semantics: { deterministic: true, pure: true, sideEffects: false }, errors: ["Throws TypeError when the value cannot be serialized as JSON."] })
|
|
46
46
|
];
|
|
47
47
|
|
|
48
|
-
// ../../node_modules/.pnpm/@dinilmusick+gutts@1.4.
|
|
48
|
+
// ../../node_modules/.pnpm/@dinilmusick+gutts@1.4.4_@types+node@22.20.5/node_modules/@dinilmusick/gutts/dist/api/number-apis.js
|
|
49
49
|
var numberApis = [
|
|
50
50
|
defineApi({ id: "gutts.numbers.clamp", name: "clamp", category: "numbers", description: "Restricts a numeric value to an inclusive minimum and maximum range.", parameters: [{ name: "value", description: "The numeric value to constrain.", required: true, schema: { type: "number" } }, { name: "min", description: "The inclusive lower bound.", required: true, schema: { type: "number" } }, { name: "max", description: "The inclusive upper bound.", required: true, schema: { type: "number" } }], output: { type: "number", description: "The value constrained to the inclusive range." }, semantics: { deterministic: true, pure: true, sideEffects: false }, errors: ["Throws RangeError when min exceeds max."] }),
|
|
51
51
|
defineApi({ id: "gutts.numbers.inRange", name: "inRange", category: "numbers", description: "Checks whether a numeric value falls within the configured range.", parameters: [{ name: "value", description: "The numeric value to test.", required: true, schema: { type: "number" } }, { name: "min", description: "The lower range boundary.", required: true, schema: { type: "number" } }, { name: "max", description: "The upper range boundary.", required: true, schema: { type: "number" } }], output: { type: "boolean", description: "Whether the value is inside the range." }, semantics: { deterministic: true, pure: true, sideEffects: false }, errors: ["Throws RangeError when min exceeds max."] }),
|
|
@@ -54,7 +54,7 @@ var numberApis = [
|
|
|
54
54
|
defineApi({ id: "gutts.numbers.sum", name: "sum", category: "numbers", description: "Adds all numbers in an array and returns their total.", parameters: [{ name: "values", description: "The numeric values to add.", required: true, schema: { type: "array", items: { type: "number" } } }], output: { type: "number", description: "The sum of all input numbers." }, semantics: { deterministic: true, pure: true, sideEffects: false } })
|
|
55
55
|
];
|
|
56
56
|
|
|
57
|
-
// ../../node_modules/.pnpm/@dinilmusick+gutts@1.4.
|
|
57
|
+
// ../../node_modules/.pnpm/@dinilmusick+gutts@1.4.4_@types+node@22.20.5/node_modules/@dinilmusick/gutts/dist/api/object-apis.js
|
|
58
58
|
var objectApis = [
|
|
59
59
|
defineApi({ id: "gutts.objects.hasOwn", name: "hasOwn", category: "objects", description: "Checks whether an object contains a requested property.", parameters: [{ name: "value", description: "The object to inspect.", required: true, schema: { type: "object" } }, { name: "key", description: "The property key to look for.", required: true, schema: { type: "string" } }], output: { type: "boolean" }, semantics: { deterministic: true, pure: true, sideEffects: false } }),
|
|
60
60
|
defineApi({ id: "gutts.objects.pick", name: "pick", category: "objects", description: "Creates an object containing only requested properties.", parameters: [{ name: "value", description: "The source object.", required: true, schema: { type: "object" } }, { name: "keys", description: "The property keys to retain.", required: true, schema: { type: "array", items: { type: "string" } } }], output: { type: "object" }, semantics: { deterministic: true, pure: true, sideEffects: false } }),
|
|
@@ -62,7 +62,7 @@ var objectApis = [
|
|
|
62
62
|
defineApi({ id: "gutts.objects.isPlainObject", name: "isPlainObject", category: "objects", description: "Checks whether a value is a plain JavaScript object.", parameters: [{ name: "value", description: "The value to classify.", required: true, schema: {} }], output: { type: "boolean" }, semantics: { deterministic: true, pure: true, sideEffects: false } })
|
|
63
63
|
];
|
|
64
64
|
|
|
65
|
-
// ../../node_modules/.pnpm/@dinilmusick+gutts@1.4.
|
|
65
|
+
// ../../node_modules/.pnpm/@dinilmusick+gutts@1.4.4_@types+node@22.20.5/node_modules/@dinilmusick/gutts/dist/api/string-apis.js
|
|
66
66
|
var string = { type: "string" };
|
|
67
67
|
var stringApis = [
|
|
68
68
|
defineApi({ id: "gutts.strings.isBlank", name: "isBlank", category: "strings", description: "Checks whether a string contains no non-whitespace characters.", parameters: [{ name: "value", description: "The string to inspect.", required: true, schema: string }], output: { type: "boolean" }, semantics: { deterministic: true, pure: true, sideEffects: false } }),
|
|
@@ -78,7 +78,7 @@ var stringApis = [
|
|
|
78
78
|
defineApi({ id: "gutts.strings.truncateWords", name: "truncateWords", category: "strings", description: "Shortens a string to a maximum number of words and appends a suffix when truncation is required.", parameters: [{ name: "value", description: "The string to shorten.", required: true, schema: string }, { name: "maxWords", description: "The non-negative maximum number of words.", required: true, schema: { type: "number" } }, { name: "suffix", description: "The suffix used when truncation occurs.", required: false, schema: string }], output: { type: "string" }, semantics: { deterministic: true, pure: true, sideEffects: false }, errors: ["Throws RangeError when maxWords is negative."] })
|
|
79
79
|
];
|
|
80
80
|
|
|
81
|
-
// ../../node_modules/.pnpm/@dinilmusick+gutts@1.4.
|
|
81
|
+
// ../../node_modules/.pnpm/@dinilmusick+gutts@1.4.4_@types+node@22.20.5/node_modules/@dinilmusick/gutts/dist/api/url-apis.js
|
|
82
82
|
var string2 = { type: "string" };
|
|
83
83
|
var urlApis = [
|
|
84
84
|
defineApi({ id: "gutts.urls.isUrl", name: "isUrl", category: "urls", description: "Checks whether a string can be parsed as a URL by the standard URL constructor.", parameters: [{ name: "value", description: "The string to validate.", required: true, schema: string2 }], output: { type: "boolean" }, semantics: { deterministic: true, pure: true, sideEffects: false } }),
|
|
@@ -87,7 +87,7 @@ var urlApis = [
|
|
|
87
87
|
defineApi({ id: "gutts.urls.setQueryParam", name: "setQueryParam", category: "urls", description: "Returns a URL with one query-string parameter set to the supplied value.", parameters: [{ name: "url", description: "The URL to modify.", required: true, schema: string2 }, { name: "key", description: "The query parameter name.", required: true, schema: string2 }, { name: "value", description: "The query parameter value.", required: true, schema: string2 }], output: { type: "string" }, semantics: { deterministic: true, pure: true, sideEffects: false }, errors: ["Throws when url cannot be parsed as a URL."] })
|
|
88
88
|
];
|
|
89
89
|
|
|
90
|
-
// ../../node_modules/.pnpm/@dinilmusick+gutts@1.4.
|
|
90
|
+
// ../../node_modules/.pnpm/@dinilmusick+gutts@1.4.4_@types+node@22.20.5/node_modules/@dinilmusick/gutts/dist/models/needle3/index.js
|
|
91
91
|
var needle3Metadata = {
|
|
92
92
|
id: "model.cactus-needle3",
|
|
93
93
|
name: "Needle 3",
|
|
@@ -118,12 +118,12 @@ var needle3CompleteApi = defineApi({
|
|
|
118
118
|
semantics: { deterministic: false, pure: false, sideEffects: false }
|
|
119
119
|
});
|
|
120
120
|
|
|
121
|
-
// ../../node_modules/.pnpm/@dinilmusick+gutts@1.4.
|
|
121
|
+
// ../../node_modules/.pnpm/@dinilmusick+gutts@1.4.4_@types+node@22.20.5/node_modules/@dinilmusick/gutts/dist/models/runtimes/ettin-head.js
|
|
122
122
|
import fs from "fs";
|
|
123
123
|
import path from "path";
|
|
124
124
|
import os from "os";
|
|
125
125
|
|
|
126
|
-
// ../../node_modules/.pnpm/@dinilmusick+gutts@1.4.
|
|
126
|
+
// ../../node_modules/.pnpm/@dinilmusick+gutts@1.4.4_@types+node@22.20.5/node_modules/@dinilmusick/gutts/dist/models/smollm2/index.js
|
|
127
127
|
var smolLM2Metadata = {
|
|
128
128
|
id: "model.smollm2-135m-instruct",
|
|
129
129
|
name: "SmolLM2-135M-Instruct",
|
|
@@ -155,7 +155,7 @@ var smolLM2GenerateApi = defineApi({
|
|
|
155
155
|
errors: ["Model load failure", "Inference failure"]
|
|
156
156
|
});
|
|
157
157
|
|
|
158
|
-
// ../../node_modules/.pnpm/@dinilmusick+gutts@1.4.
|
|
158
|
+
// ../../node_modules/.pnpm/@dinilmusick+gutts@1.4.4_@types+node@22.20.5/node_modules/@dinilmusick/gutts/dist/models/whistle/index.js
|
|
159
159
|
var whistleMetadata = {
|
|
160
160
|
id: "model.cactus-whistle",
|
|
161
161
|
name: "Whistle",
|
|
@@ -185,7 +185,7 @@ var whistleTranscribeApi = defineApi({
|
|
|
185
185
|
semantics: { deterministic: true, pure: false, sideEffects: false }
|
|
186
186
|
});
|
|
187
187
|
|
|
188
|
-
// ../../node_modules/.pnpm/@dinilmusick+gutts@1.4.
|
|
188
|
+
// ../../node_modules/.pnpm/@dinilmusick+gutts@1.4.4_@types+node@22.20.5/node_modules/@dinilmusick/gutts/dist/models/ettin/index.js
|
|
189
189
|
var defineEttin = (id2, name, parameters, description) => ({
|
|
190
190
|
id: id2,
|
|
191
191
|
name,
|
|
@@ -220,7 +220,7 @@ var ettinRerankApi = defineApi({
|
|
|
220
220
|
semantics: { deterministic: true, pure: false, sideEffects: false }
|
|
221
221
|
});
|
|
222
222
|
|
|
223
|
-
// ../../node_modules/.pnpm/@dinilmusick+gutts@1.4.
|
|
223
|
+
// ../../node_modules/.pnpm/@dinilmusick+gutts@1.4.4_@types+node@22.20.5/node_modules/@dinilmusick/gutts/dist/models/minilm/index.js
|
|
224
224
|
var miniLML6Metadata = {
|
|
225
225
|
id: "model.minilm-l6-v2",
|
|
226
226
|
name: "MiniLM-L6-v2",
|
|
@@ -251,7 +251,7 @@ var miniLMSimilarityApi = defineApi({
|
|
|
251
251
|
semantics: { deterministic: true, pure: false, sideEffects: false }
|
|
252
252
|
});
|
|
253
253
|
|
|
254
|
-
// ../../node_modules/.pnpm/@dinilmusick+gutts@1.4.
|
|
254
|
+
// ../../node_modules/.pnpm/@dinilmusick+gutts@1.4.4_@types+node@22.20.5/node_modules/@dinilmusick/gutts/dist/api/api-registry.js
|
|
255
255
|
var guttsApiDefinitions = Object.freeze([
|
|
256
256
|
...arrayApis,
|
|
257
257
|
...jsonApis,
|
|
@@ -267,7 +267,7 @@ var guttsApiDefinitions = Object.freeze([
|
|
|
267
267
|
]);
|
|
268
268
|
var guttsApiById = Object.freeze(Object.fromEntries(guttsApiDefinitions.map((api) => [api.id, api])));
|
|
269
269
|
|
|
270
|
-
// ../../node_modules/.pnpm/@dinilmusick+gutts@1.4.
|
|
270
|
+
// ../../node_modules/.pnpm/@dinilmusick+gutts@1.4.4_@types+node@22.20.5/node_modules/@dinilmusick/gutts/dist/api/fod-node-provider.js
|
|
271
271
|
var schemaType = (schema) => String(schema?.type ?? "any");
|
|
272
272
|
function guttsApiToFodNode(api) {
|
|
273
273
|
return {
|
|
@@ -283,7 +283,7 @@ function guttsApiToFodNode(api) {
|
|
|
283
283
|
}
|
|
284
284
|
var guttsFodNodeDefinitions = Object.freeze(guttsApiDefinitions.map(guttsApiToFodNode));
|
|
285
285
|
|
|
286
|
-
// ../../node_modules/.pnpm/@dinilmusick+gutts@1.4.
|
|
286
|
+
// ../../node_modules/.pnpm/@dinilmusick+gutts@1.4.4_@types+node@22.20.5/node_modules/@dinilmusick/gutts/dist/models/model-registry.js
|
|
287
287
|
var guttsModelDefinitions = Object.freeze([
|
|
288
288
|
smolLM2Metadata,
|
|
289
289
|
needle3Metadata,
|
|
@@ -2792,6 +2792,118 @@ var krnlStorageClientServiceFacade = StorageClientServiceFacade;
|
|
|
2792
2792
|
var krnlSystemDbClientServiceDefinition = SystemDbClientServiceDefinition;
|
|
2793
2793
|
var krnlSystemDbClientServiceFacade = SystemDbClientServiceFacade;
|
|
2794
2794
|
|
|
2795
|
+
// src/engineering/github-app-connector.ts
|
|
2796
|
+
var encoder = new TextEncoder();
|
|
2797
|
+
var base64 = (bytes) => {
|
|
2798
|
+
let binary = "";
|
|
2799
|
+
for (const byte of bytes) binary += String.fromCharCode(byte);
|
|
2800
|
+
return btoa(binary);
|
|
2801
|
+
};
|
|
2802
|
+
var base64Url = (bytes) => base64(bytes).replace(/=/g, "").replace(/\+/g, "-").replace(/\//g, "_");
|
|
2803
|
+
var pemToDer = (pem) => {
|
|
2804
|
+
const value = pem.replace(/-----BEGIN PRIVATE KEY-----|-----END PRIVATE KEY-----|\s/g, "");
|
|
2805
|
+
const binary = atob(value);
|
|
2806
|
+
return Uint8Array.from(binary, (char) => char.charCodeAt(0));
|
|
2807
|
+
};
|
|
2808
|
+
var signAppJwt = async (installation, nowSeconds) => {
|
|
2809
|
+
const header = base64Url(encoder.encode(JSON.stringify({ alg: "RS256", typ: "JWT" })));
|
|
2810
|
+
const payload = base64Url(encoder.encode(JSON.stringify({ iat: nowSeconds - 30, exp: nowSeconds + 540, iss: String(installation.appId) })));
|
|
2811
|
+
const key = await crypto.subtle.importKey("pkcs8", pemToDer(installation.privateKey).buffer, { name: "RSASSA-PKCS1-v1_5", hash: "SHA-256" }, false, ["sign"]);
|
|
2812
|
+
const signature = await crypto.subtle.sign("RSASSA-PKCS1-v1_5", key, encoder.encode(header + "." + payload));
|
|
2813
|
+
return header + "." + payload + "." + base64Url(new Uint8Array(signature));
|
|
2814
|
+
};
|
|
2815
|
+
var GitHubAppConnector = class {
|
|
2816
|
+
id = "github-app";
|
|
2817
|
+
apiBaseUrl;
|
|
2818
|
+
fetchImpl;
|
|
2819
|
+
now;
|
|
2820
|
+
signer;
|
|
2821
|
+
installations;
|
|
2822
|
+
tokens = /* @__PURE__ */ new Map();
|
|
2823
|
+
constructor(options) {
|
|
2824
|
+
if (options.installations.length === 0) throw new Error("At least one GitHub App installation is required");
|
|
2825
|
+
this.apiBaseUrl = options.apiBaseUrl ?? "https://api.github.com";
|
|
2826
|
+
this.fetchImpl = options.fetchImpl ?? fetch;
|
|
2827
|
+
this.now = options.now ?? (() => Date.now());
|
|
2828
|
+
this.signer = options.signer ?? signAppJwt;
|
|
2829
|
+
this.installations = new Map(options.installations.map((installation) => [installation.account, installation]));
|
|
2830
|
+
}
|
|
2831
|
+
listAccounts() {
|
|
2832
|
+
return [...this.installations.keys()].sort();
|
|
2833
|
+
}
|
|
2834
|
+
installation(account) {
|
|
2835
|
+
const value = this.installations.get(account);
|
|
2836
|
+
if (!value) throw new Error("Unknown GitHub App installation account: " + account);
|
|
2837
|
+
return value;
|
|
2838
|
+
}
|
|
2839
|
+
async installationToken(account) {
|
|
2840
|
+
const cached = this.tokens.get(account);
|
|
2841
|
+
if (cached && cached.expiresAt > this.now() + 6e4) return cached.token;
|
|
2842
|
+
const installation = this.installation(account);
|
|
2843
|
+
const jwt = await this.signer(installation, Math.floor(this.now() / 1e3));
|
|
2844
|
+
const response = await this.fetchImpl(this.apiBaseUrl + "/app/installations/" + installation.installationId + "/access_tokens", {
|
|
2845
|
+
method: "POST",
|
|
2846
|
+
headers: { accept: "application/vnd.github+json", authorization: "Bearer " + jwt, "x-github-api-version": "2022-11-28", "content-type": "application/json" }
|
|
2847
|
+
});
|
|
2848
|
+
if (!response.ok) throw new Error("GitHub installation token request failed (" + response.status + "): " + await response.text());
|
|
2849
|
+
const body = await response.json();
|
|
2850
|
+
this.tokens.set(account, { token: body.token, expiresAt: Date.parse(body.expires_at) });
|
|
2851
|
+
return body.token;
|
|
2852
|
+
}
|
|
2853
|
+
async request(account, path2, init = {}) {
|
|
2854
|
+
const operation = (init.method ?? "GET") + " " + path2;
|
|
2855
|
+
const startedAt = new Date(this.now()).toISOString();
|
|
2856
|
+
try {
|
|
2857
|
+
const token = await this.installationToken(account);
|
|
2858
|
+
const response = await this.fetchImpl(this.apiBaseUrl + path2, {
|
|
2859
|
+
...init,
|
|
2860
|
+
headers: { accept: "application/vnd.github+json", authorization: "Bearer " + token, "x-github-api-version": "2022-11-28", ...init.body ? { "content-type": "application/json" } : {}, ...init.headers ?? {} }
|
|
2861
|
+
});
|
|
2862
|
+
const requestId = response.headers.get("x-github-request-id") ?? void 0;
|
|
2863
|
+
const completedAt = new Date(this.now()).toISOString();
|
|
2864
|
+
if (!response.ok) return { ok: false, operation, error: { message: "GitHub API " + response.status + ": " + await response.text(), status: response.status, diagnostics: { requestId } } };
|
|
2865
|
+
const data = response.status === 204 ? void 0 : await response.json();
|
|
2866
|
+
return { ok: true, operation, data, diagnostics: { startedAt, completedAt, status: response.status, requestId } };
|
|
2867
|
+
} catch (error) {
|
|
2868
|
+
return { ok: false, operation, error: { message: error instanceof Error ? error.message : String(error) } };
|
|
2869
|
+
}
|
|
2870
|
+
}
|
|
2871
|
+
getRepository(account, repository) {
|
|
2872
|
+
return this.request(account, "/repos/" + repository);
|
|
2873
|
+
}
|
|
2874
|
+
listRepositories(account, page = 1, perPage = 100) {
|
|
2875
|
+
return this.request(account, "/installation/repositories?page=" + page + "&per_page=" + perPage);
|
|
2876
|
+
}
|
|
2877
|
+
getFile(account, repository, path2, ref) {
|
|
2878
|
+
const query = ref ? "?ref=" + encodeURIComponent(ref) : "";
|
|
2879
|
+
return this.request(account, "/repos/" + repository + "/contents/" + path2 + query);
|
|
2880
|
+
}
|
|
2881
|
+
commitFile(account, repository, path2, content, message, branch, sha) {
|
|
2882
|
+
const encoded = base64(encoder.encode(content));
|
|
2883
|
+
return this.request(account, "/repos/" + repository + "/contents/" + path2, { method: "PUT", body: JSON.stringify({ message, content: encoded, branch, ...sha ? { sha } : {} }) });
|
|
2884
|
+
}
|
|
2885
|
+
createPullRequest(account, repository, title, body, head, base = "main") {
|
|
2886
|
+
return this.request(account, "/repos/" + repository + "/pulls", { method: "POST", body: JSON.stringify({ title, body, head, base }) });
|
|
2887
|
+
}
|
|
2888
|
+
dispatchWorkflow(account, repository, workflow, ref, inputs = {}) {
|
|
2889
|
+
return this.request(account, "/repos/" + repository + "/actions/workflows/" + workflow + "/dispatches", { method: "POST", body: JSON.stringify({ ref, inputs }) });
|
|
2890
|
+
}
|
|
2891
|
+
async pollWorkflow(account, repository, workflow, ref, startedAfter, options = {}) {
|
|
2892
|
+
const timeoutMs = options.timeoutMs ?? 3e5;
|
|
2893
|
+
const intervalMs = options.intervalMs ?? 2e3;
|
|
2894
|
+
const deadline = this.now() + timeoutMs;
|
|
2895
|
+
while (this.now() <= deadline) {
|
|
2896
|
+
const result = await this.request(account, "/repos/" + repository + "/actions/workflows/" + workflow + "/runs?branch=" + encodeURIComponent(ref) + "&per_page=20");
|
|
2897
|
+
if (result.ok === false) return result;
|
|
2898
|
+
const run = result.data.workflow_runs.find((candidate) => candidate.created_at >= startedAfter);
|
|
2899
|
+
if (run && ["completed", "cancelled"].includes(run.status)) return { ...result, data: run };
|
|
2900
|
+
await new Promise((resolve) => setTimeout(resolve, intervalMs));
|
|
2901
|
+
}
|
|
2902
|
+
return { ok: false, operation: "GET workflow poll", error: { message: "Workflow polling timed out", diagnostics: { timeoutMs, repository, workflow, ref, startedAfter } } };
|
|
2903
|
+
}
|
|
2904
|
+
};
|
|
2905
|
+
var createGitHubAppConnector = (options) => new GitHubAppConnector(options);
|
|
2906
|
+
|
|
2795
2907
|
// src/engineering/github-vcs-provider.ts
|
|
2796
2908
|
var GitHubVcsProvider = class {
|
|
2797
2909
|
constructor(options) {
|
|
@@ -3215,6 +3327,7 @@ export {
|
|
|
3215
3327
|
CLEAN_DATABASE_CLUSTER,
|
|
3216
3328
|
CommandVerificationProvider,
|
|
3217
3329
|
DEFAULT_CONNECTIONS,
|
|
3330
|
+
GitHubAppConnector,
|
|
3218
3331
|
GitHubVcsProvider,
|
|
3219
3332
|
KLOKSServiceIndex,
|
|
3220
3333
|
LocalExecutionProvider,
|
|
@@ -3245,6 +3358,7 @@ export {
|
|
|
3245
3358
|
buildServiceIdentity,
|
|
3246
3359
|
clearSession,
|
|
3247
3360
|
compareServices,
|
|
3361
|
+
createGitHubAppConnector,
|
|
3248
3362
|
createMonacoIdeService,
|
|
3249
3363
|
createServiceB,
|
|
3250
3364
|
createServiceC,
|
|
@@ -170,6 +170,34 @@
|
|
|
170
170
|
"BackendFacade.services"
|
|
171
171
|
]
|
|
172
172
|
}
|
|
173
|
+
},
|
|
174
|
+
{
|
|
175
|
+
"id": "kloks.service.githubAppConnector",
|
|
176
|
+
"name": "GitHub App Connector",
|
|
177
|
+
"version": "1.0.0",
|
|
178
|
+
"description": "Portable GitHub App integration with multiple installations, repository/file/commit/PR operations and asynchronous workflow dispatch/monitoring.",
|
|
179
|
+
"backend": {
|
|
180
|
+
"package": "@ultrst-armada/kloks",
|
|
181
|
+
"export": "GitHubAppConnector",
|
|
182
|
+
"facade": "GitHubAppConnector"
|
|
183
|
+
},
|
|
184
|
+
"modes": [
|
|
185
|
+
"backend"
|
|
186
|
+
],
|
|
187
|
+
"targets": {
|
|
188
|
+
"backend": [
|
|
189
|
+
"BackendFacade.services"
|
|
190
|
+
]
|
|
191
|
+
},
|
|
192
|
+
"capabilities": [
|
|
193
|
+
"github-app",
|
|
194
|
+
"repositories",
|
|
195
|
+
"files",
|
|
196
|
+
"commits",
|
|
197
|
+
"pull-requests",
|
|
198
|
+
"workflow-dispatch",
|
|
199
|
+
"workflow-monitoring"
|
|
200
|
+
]
|
|
173
201
|
}
|
|
174
202
|
]
|
|
175
203
|
}
|