@velum-labs/cursorkit 0.1.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/DISCLAIMER.md +12 -0
- package/README.md +157 -0
- package/dist/src/agentTools/diff.d.ts +11 -0
- package/dist/src/agentTools/diff.js +88 -0
- package/dist/src/agentTools/policy.d.ts +3 -0
- package/dist/src/agentTools/policy.js +12 -0
- package/dist/src/agentTools/registry.d.ts +114 -0
- package/dist/src/agentTools/registry.js +663 -0
- package/dist/src/agentTools/results.d.ts +14 -0
- package/dist/src/agentTools/results.js +117 -0
- package/dist/src/agentTools/schemas.d.ts +3 -0
- package/dist/src/agentTools/schemas.js +89 -0
- package/dist/src/agentTools/surface.d.ts +11 -0
- package/dist/src/agentTools/surface.js +251 -0
- package/dist/src/certs.d.ts +8 -0
- package/dist/src/certs.js +34 -0
- package/dist/src/ck.d.ts +2 -0
- package/dist/src/ck.js +6 -0
- package/dist/src/ckLauncher.d.ts +150 -0
- package/dist/src/ckLauncher.js +1496 -0
- package/dist/src/cli.d.ts +2 -0
- package/dist/src/cli.js +265 -0
- package/dist/src/config.d.ts +52 -0
- package/dist/src/config.js +210 -0
- package/dist/src/connectEnvelope.d.ts +16 -0
- package/dist/src/connectEnvelope.js +70 -0
- package/dist/src/desktop.d.ts +19 -0
- package/dist/src/desktop.js +167 -0
- package/dist/src/desktopConnectProxy.d.ts +26 -0
- package/dist/src/desktopConnectProxy.js +175 -0
- package/dist/src/extensions/index.d.ts +2 -0
- package/dist/src/extensions/index.js +1 -0
- package/dist/src/extensions/registry.d.ts +8 -0
- package/dist/src/extensions/registry.js +52 -0
- package/dist/src/extensions/types.d.ts +42 -0
- package/dist/src/extensions/types.js +1 -0
- package/dist/src/fixtures/modelFusion.d.ts +103 -0
- package/dist/src/fixtures/modelFusion.js +404 -0
- package/dist/src/fixtures/replay.d.ts +9 -0
- package/dist/src/fixtures/replay.js +41 -0
- package/dist/src/fixtures/sanitizer.d.ts +9 -0
- package/dist/src/fixtures/sanitizer.js +43 -0
- package/dist/src/fixtures/schema.d.ts +38 -0
- package/dist/src/fixtures/schema.js +33 -0
- package/dist/src/gen/agent/v1/agent_pb.d.ts +21577 -0
- package/dist/src/gen/agent/v1/agent_pb.js +5325 -0
- package/dist/src/gen/aiserver/v1/aiserver_pb.d.ts +135242 -0
- package/dist/src/gen/aiserver/v1/aiserver_pb.js +34430 -0
- package/dist/src/gen/anyrun/v1/anyrun_pb.d.ts +1163 -0
- package/dist/src/gen/anyrun/v1/anyrun_pb.js +374 -0
- package/dist/src/gen/google/protobuf/google_pb.d.ts +142 -0
- package/dist/src/gen/google/protobuf/google_pb.js +54 -0
- package/dist/src/gen/internapi/v1/internapi_pb.d.ts +121 -0
- package/dist/src/gen/internapi/v1/internapi_pb.js +79 -0
- package/dist/src/logger.d.ts +8 -0
- package/dist/src/logger.js +37 -0
- package/dist/src/modelFusion/cursorHarness.d.ts +146 -0
- package/dist/src/modelFusion/cursorHarness.js +647 -0
- package/dist/src/modelFusion/index.d.ts +4 -0
- package/dist/src/modelFusion/index.js +2 -0
- package/dist/src/models/registry.d.ts +22 -0
- package/dist/src/models/registry.js +30 -0
- package/dist/src/proto.d.ts +13 -0
- package/dist/src/proto.js +61 -0
- package/dist/src/providers/openai.d.ts +64 -0
- package/dist/src/providers/openai.js +355 -0
- package/dist/src/redaction.d.ts +4 -0
- package/dist/src/redaction.js +65 -0
- package/dist/src/routeInventory.d.ts +16 -0
- package/dist/src/routeInventory.js +39 -0
- package/dist/src/routes.d.ts +37 -0
- package/dist/src/routes.js +227 -0
- package/dist/src/server.d.ts +50 -0
- package/dist/src/server.js +1353 -0
- package/dist/src/services/agent.d.ts +1 -0
- package/dist/src/services/agent.js +7 -0
- package/dist/src/services/agentRun.d.ts +60 -0
- package/dist/src/services/agentRun.js +391 -0
- package/dist/src/services/chat.d.ts +11 -0
- package/dist/src/services/chat.js +47 -0
- package/dist/src/services/models.d.ts +10 -0
- package/dist/src/services/models.js +216 -0
- package/dist/src/services/serverConfig.d.ts +2 -0
- package/dist/src/services/serverConfig.js +19 -0
- package/dist/src/testing/artifacts.d.ts +14 -0
- package/dist/src/testing/artifacts.js +92 -0
- package/dist/src/testing/cli.d.ts +4 -0
- package/dist/src/testing/cli.js +192 -0
- package/dist/src/testing/localBackend.d.ts +24 -0
- package/dist/src/testing/localBackend.js +310 -0
- package/dist/src/testing/processRunner.d.ts +7 -0
- package/dist/src/testing/processRunner.js +74 -0
- package/dist/src/testing/runner.d.ts +9 -0
- package/dist/src/testing/runner.js +85 -0
- package/dist/src/testing/scenarios.d.ts +3 -0
- package/dist/src/testing/scenarios.js +2535 -0
- package/dist/src/testing/types.d.ts +66 -0
- package/dist/src/testing/types.js +1 -0
- package/dist/src/tools/baselineInventory.d.ts +12 -0
- package/dist/src/tools/baselineInventory.js +680 -0
- package/dist/src/tools/checkModelFusionProtocol.d.ts +1 -0
- package/dist/src/tools/checkModelFusionProtocol.js +274 -0
- package/dist/src/tools/checkReleasePublishConfig.d.ts +1 -0
- package/dist/src/tools/checkReleasePublishConfig.js +99 -0
- package/dist/src/tools/generateProtoInventory.d.ts +1 -0
- package/dist/src/tools/generateProtoInventory.js +89 -0
- package/dist/src/tools/normalizeGeneratedCode.d.ts +1 -0
- package/dist/src/tools/normalizeGeneratedCode.js +18 -0
- package/dist/src/tools/releaseCheck.d.ts +26 -0
- package/dist/src/tools/releaseCheck.js +367 -0
- package/dist/src/trace.d.ts +39 -0
- package/dist/src/trace.js +106 -0
- package/dist/src/translation.d.ts +6 -0
- package/dist/src/translation.js +22 -0
- package/dist/src/upstream.d.ts +20 -0
- package/dist/src/upstream.js +270 -0
- package/docs/configuration.md +55 -0
- package/docs/cursor-app.md +263 -0
- package/docs/implementation-inventory.json +609 -0
- package/docs/learnings.md +363 -0
- package/docs/model-fusion-protocol-origin.json +126 -0
- package/docs/model-fusion-protocol.md +110 -0
- package/docs/plugin-authoring.md +24 -0
- package/docs/proto-inventory.md +1477 -0
- package/docs/protocol-surface-audit.md +92 -0
- package/docs/protocol.md +52 -0
- package/docs/refreshing-protos.md +78 -0
- package/docs/release-gates.md +110 -0
- package/docs/release-summary.json +86 -0
- package/docs/route-contract-manifest.json +288 -0
- package/docs/route-policy.json +133 -0
- package/docs/service-manifest.json +9490 -0
- package/docs/test-manifest.json +155 -0
- package/docs/testing-harness.md +204 -0
- package/docs/troubleshooting.md +36 -0
- package/docs/type-manifest-summary.json +28927 -0
- package/package.json +93 -0
- package/proto/agent/v1/agent.proto +5371 -0
- package/proto/aiserver/v1/aiserver.proto +32944 -0
- package/proto/anyrun/v1/anyrun.proto +294 -0
- package/proto/google/protobuf/google.proto +37 -0
- package/proto/internapi/v1/internapi.proto +32 -0
|
@@ -0,0 +1,121 @@
|
|
|
1
|
+
import type { GenEnum, GenFile, GenMessage } from "@bufbuild/protobuf/codegenv2";
|
|
2
|
+
import type { Message } from "@bufbuild/protobuf";
|
|
3
|
+
/**
|
|
4
|
+
* Describes the file internapi/v1/internapi.proto.
|
|
5
|
+
*/
|
|
6
|
+
export declare const file_internapi_v1_internapi: GenFile;
|
|
7
|
+
/**
|
|
8
|
+
* internapi.v1.ImageBlobData
|
|
9
|
+
*
|
|
10
|
+
* @generated from message internapi.v1.ImageBlobData
|
|
11
|
+
*/
|
|
12
|
+
export type ImageBlobData = Message<"internapi.v1.ImageBlobData"> & {
|
|
13
|
+
/**
|
|
14
|
+
* @generated from field: string mime_type = 1;
|
|
15
|
+
*/
|
|
16
|
+
mimeType: string;
|
|
17
|
+
};
|
|
18
|
+
/**
|
|
19
|
+
* Describes the message internapi.v1.ImageBlobData.
|
|
20
|
+
* Use `create(ImageBlobDataSchema)` to create a new message.
|
|
21
|
+
*/
|
|
22
|
+
export declare const ImageBlobDataSchema: GenMessage<ImageBlobData>;
|
|
23
|
+
/**
|
|
24
|
+
* internapi.v1.BlobData
|
|
25
|
+
*
|
|
26
|
+
* @generated from message internapi.v1.BlobData
|
|
27
|
+
*/
|
|
28
|
+
export type BlobData = Message<"internapi.v1.BlobData"> & {
|
|
29
|
+
/**
|
|
30
|
+
* @generated from field: internapi.v1.BlobType blob_type = 1;
|
|
31
|
+
*/
|
|
32
|
+
blobType: BlobType;
|
|
33
|
+
/**
|
|
34
|
+
* @generated from field: bytes blob_id = 2;
|
|
35
|
+
*/
|
|
36
|
+
blobId: Uint8Array;
|
|
37
|
+
/**
|
|
38
|
+
* @generated from field: int32 index = 3;
|
|
39
|
+
*/
|
|
40
|
+
index: number;
|
|
41
|
+
/**
|
|
42
|
+
* @generated from field: internapi.v1.ImageBlobData image_data = 4;
|
|
43
|
+
*/
|
|
44
|
+
imageData?: ImageBlobData | undefined;
|
|
45
|
+
};
|
|
46
|
+
/**
|
|
47
|
+
* Describes the message internapi.v1.BlobData.
|
|
48
|
+
* Use `create(BlobDataSchema)` to create a new message.
|
|
49
|
+
*/
|
|
50
|
+
export declare const BlobDataSchema: GenMessage<BlobData>;
|
|
51
|
+
/**
|
|
52
|
+
* internapi.v1.BlobDataPerMessage
|
|
53
|
+
*
|
|
54
|
+
* @generated from message internapi.v1.BlobDataPerMessage
|
|
55
|
+
*/
|
|
56
|
+
export type BlobDataPerMessage = Message<"internapi.v1.BlobDataPerMessage"> & {
|
|
57
|
+
/**
|
|
58
|
+
* @generated from field: repeated internapi.v1.BlobData blob_data = 1;
|
|
59
|
+
*/
|
|
60
|
+
blobData: BlobData[];
|
|
61
|
+
};
|
|
62
|
+
/**
|
|
63
|
+
* Describes the message internapi.v1.BlobDataPerMessage.
|
|
64
|
+
* Use `create(BlobDataPerMessageSchema)` to create a new message.
|
|
65
|
+
*/
|
|
66
|
+
export declare const BlobDataPerMessageSchema: GenMessage<BlobDataPerMessage>;
|
|
67
|
+
/**
|
|
68
|
+
* internapi.v1.BlobType
|
|
69
|
+
*
|
|
70
|
+
* @generated from enum internapi.v1.BlobType
|
|
71
|
+
*/
|
|
72
|
+
export declare enum BlobType {
|
|
73
|
+
/**
|
|
74
|
+
* @generated from enum value: BLOB_TYPE_BLOB_TYPE_UNSPECIFIED = 0;
|
|
75
|
+
*/
|
|
76
|
+
BLOB_TYPE_UNSPECIFIED = 0,
|
|
77
|
+
/**
|
|
78
|
+
* @generated from enum value: BLOB_TYPE_BLOB_TYPE_IMAGE = 1;
|
|
79
|
+
*/
|
|
80
|
+
BLOB_TYPE_IMAGE = 1,
|
|
81
|
+
/**
|
|
82
|
+
* @generated from enum value: BLOB_TYPE_BLOB_TYPE_INVOCATION_CONTEXT = 2;
|
|
83
|
+
*/
|
|
84
|
+
BLOB_TYPE_INVOCATION_CONTEXT = 2,
|
|
85
|
+
/**
|
|
86
|
+
* @generated from enum value: BLOB_TYPE_BLOB_TYPE_EXTRA_CONTEXT = 3;
|
|
87
|
+
*/
|
|
88
|
+
BLOB_TYPE_EXTRA_CONTEXT = 3,
|
|
89
|
+
/**
|
|
90
|
+
* @generated from enum value: BLOB_TYPE_BLOB_TYPE_GIT_PR_DIFF_SELECTION = 4;
|
|
91
|
+
*/
|
|
92
|
+
BLOB_TYPE_GIT_PR_DIFF_SELECTION = 4,
|
|
93
|
+
/**
|
|
94
|
+
* @generated from enum value: BLOB_TYPE_BLOB_TYPE_SELECTED_PULL_REQUEST = 5;
|
|
95
|
+
*/
|
|
96
|
+
BLOB_TYPE_SELECTED_PULL_REQUEST = 5,
|
|
97
|
+
/**
|
|
98
|
+
* @generated from enum value: BLOB_TYPE_BLOB_TYPE_TEXT = 6;
|
|
99
|
+
*/
|
|
100
|
+
BLOB_TYPE_TEXT = 6,
|
|
101
|
+
/**
|
|
102
|
+
* @generated from enum value: BLOB_TYPE_BLOB_TYPE_RICH_TEXT = 7;
|
|
103
|
+
*/
|
|
104
|
+
BLOB_TYPE_RICH_TEXT = 7,
|
|
105
|
+
/**
|
|
106
|
+
* @generated from enum value: BLOB_TYPE_BLOB_TYPE_EXTERNAL_LINK_PDF = 8;
|
|
107
|
+
*/
|
|
108
|
+
BLOB_TYPE_EXTERNAL_LINK_PDF = 8,
|
|
109
|
+
/**
|
|
110
|
+
* @generated from enum value: BLOB_TYPE_BLOB_TYPE_DOCUMENT = 9;
|
|
111
|
+
*/
|
|
112
|
+
BLOB_TYPE_DOCUMENT = 9,
|
|
113
|
+
/**
|
|
114
|
+
* @generated from enum value: BLOB_TYPE_BLOB_TYPE_VIDEO = 10;
|
|
115
|
+
*/
|
|
116
|
+
BLOB_TYPE_VIDEO = 10
|
|
117
|
+
}
|
|
118
|
+
/**
|
|
119
|
+
* Describes the enum internapi.v1.BlobType.
|
|
120
|
+
*/
|
|
121
|
+
export declare const BlobTypeSchema: GenEnum<BlobType>;
|
|
@@ -0,0 +1,79 @@
|
|
|
1
|
+
// @generated by protoc-gen-es v2.12.0 with parameter "target=ts"
|
|
2
|
+
// @generated from file internapi/v1/internapi.proto (package internapi.v1, syntax proto3)
|
|
3
|
+
/* eslint-disable */
|
|
4
|
+
import { enumDesc, fileDesc, messageDesc } from "@bufbuild/protobuf/codegenv2";
|
|
5
|
+
/**
|
|
6
|
+
* Describes the file internapi/v1/internapi.proto.
|
|
7
|
+
*/
|
|
8
|
+
export const file_internapi_v1_internapi = /*@__PURE__*/ fileDesc("ChxpbnRlcm5hcGkvdjEvaW50ZXJuYXBpLnByb3RvEgxpbnRlcm5hcGkudjEiIgoNSW1hZ2VCbG9iRGF0YRIRCgltaW1lX3R5cGUYASABKAkihgEKCEJsb2JEYXRhEikKCWJsb2JfdHlwZRgBIAEoDjIWLmludGVybmFwaS52MS5CbG9iVHlwZRIPCgdibG9iX2lkGAIgASgMEg0KBWluZGV4GAMgASgFEi8KCmltYWdlX2RhdGEYBCABKAsyGy5pbnRlcm5hcGkudjEuSW1hZ2VCbG9iRGF0YSI/ChJCbG9iRGF0YVBlck1lc3NhZ2USKQoJYmxvYl9kYXRhGAEgAygLMhYuaW50ZXJuYXBpLnYxLkJsb2JEYXRhKqwDCghCbG9iVHlwZRIjCh9CTE9CX1RZUEVfQkxPQl9UWVBFX1VOU1BFQ0lGSUVEEAASHQoZQkxPQl9UWVBFX0JMT0JfVFlQRV9JTUFHRRABEioKJkJMT0JfVFlQRV9CTE9CX1RZUEVfSU5WT0NBVElPTl9DT05URVhUEAISJQohQkxPQl9UWVBFX0JMT0JfVFlQRV9FWFRSQV9DT05URVhUEAMSLQopQkxPQl9UWVBFX0JMT0JfVFlQRV9HSVRfUFJfRElGRl9TRUxFQ1RJT04QBBItCilCTE9CX1RZUEVfQkxPQl9UWVBFX1NFTEVDVEVEX1BVTExfUkVRVUVTVBAFEhwKGEJMT0JfVFlQRV9CTE9CX1RZUEVfVEVYVBAGEiEKHUJMT0JfVFlQRV9CTE9CX1RZUEVfUklDSF9URVhUEAcSKQolQkxPQl9UWVBFX0JMT0JfVFlQRV9FWFRFUk5BTF9MSU5LX1BERhAIEiAKHEJMT0JfVFlQRV9CTE9CX1RZUEVfRE9DVU1FTlQQCRIdChlCTE9CX1RZUEVfQkxPQl9UWVBFX1ZJREVPEApCJVojY3Vyc29yL2dlbi9pbnRlcm5hcGkvdjE7aW50ZXJuYXBpdjFiBnByb3RvMw");
|
|
9
|
+
/**
|
|
10
|
+
* Describes the message internapi.v1.ImageBlobData.
|
|
11
|
+
* Use `create(ImageBlobDataSchema)` to create a new message.
|
|
12
|
+
*/
|
|
13
|
+
export const ImageBlobDataSchema = /*@__PURE__*/ messageDesc(file_internapi_v1_internapi, 0);
|
|
14
|
+
/**
|
|
15
|
+
* Describes the message internapi.v1.BlobData.
|
|
16
|
+
* Use `create(BlobDataSchema)` to create a new message.
|
|
17
|
+
*/
|
|
18
|
+
export const BlobDataSchema = /*@__PURE__*/ messageDesc(file_internapi_v1_internapi, 1);
|
|
19
|
+
/**
|
|
20
|
+
* Describes the message internapi.v1.BlobDataPerMessage.
|
|
21
|
+
* Use `create(BlobDataPerMessageSchema)` to create a new message.
|
|
22
|
+
*/
|
|
23
|
+
export const BlobDataPerMessageSchema = /*@__PURE__*/ messageDesc(file_internapi_v1_internapi, 2);
|
|
24
|
+
/**
|
|
25
|
+
* internapi.v1.BlobType
|
|
26
|
+
*
|
|
27
|
+
* @generated from enum internapi.v1.BlobType
|
|
28
|
+
*/
|
|
29
|
+
export var BlobType;
|
|
30
|
+
(function (BlobType) {
|
|
31
|
+
/**
|
|
32
|
+
* @generated from enum value: BLOB_TYPE_BLOB_TYPE_UNSPECIFIED = 0;
|
|
33
|
+
*/
|
|
34
|
+
BlobType[BlobType["BLOB_TYPE_UNSPECIFIED"] = 0] = "BLOB_TYPE_UNSPECIFIED";
|
|
35
|
+
/**
|
|
36
|
+
* @generated from enum value: BLOB_TYPE_BLOB_TYPE_IMAGE = 1;
|
|
37
|
+
*/
|
|
38
|
+
BlobType[BlobType["BLOB_TYPE_IMAGE"] = 1] = "BLOB_TYPE_IMAGE";
|
|
39
|
+
/**
|
|
40
|
+
* @generated from enum value: BLOB_TYPE_BLOB_TYPE_INVOCATION_CONTEXT = 2;
|
|
41
|
+
*/
|
|
42
|
+
BlobType[BlobType["BLOB_TYPE_INVOCATION_CONTEXT"] = 2] = "BLOB_TYPE_INVOCATION_CONTEXT";
|
|
43
|
+
/**
|
|
44
|
+
* @generated from enum value: BLOB_TYPE_BLOB_TYPE_EXTRA_CONTEXT = 3;
|
|
45
|
+
*/
|
|
46
|
+
BlobType[BlobType["BLOB_TYPE_EXTRA_CONTEXT"] = 3] = "BLOB_TYPE_EXTRA_CONTEXT";
|
|
47
|
+
/**
|
|
48
|
+
* @generated from enum value: BLOB_TYPE_BLOB_TYPE_GIT_PR_DIFF_SELECTION = 4;
|
|
49
|
+
*/
|
|
50
|
+
BlobType[BlobType["BLOB_TYPE_GIT_PR_DIFF_SELECTION"] = 4] = "BLOB_TYPE_GIT_PR_DIFF_SELECTION";
|
|
51
|
+
/**
|
|
52
|
+
* @generated from enum value: BLOB_TYPE_BLOB_TYPE_SELECTED_PULL_REQUEST = 5;
|
|
53
|
+
*/
|
|
54
|
+
BlobType[BlobType["BLOB_TYPE_SELECTED_PULL_REQUEST"] = 5] = "BLOB_TYPE_SELECTED_PULL_REQUEST";
|
|
55
|
+
/**
|
|
56
|
+
* @generated from enum value: BLOB_TYPE_BLOB_TYPE_TEXT = 6;
|
|
57
|
+
*/
|
|
58
|
+
BlobType[BlobType["BLOB_TYPE_TEXT"] = 6] = "BLOB_TYPE_TEXT";
|
|
59
|
+
/**
|
|
60
|
+
* @generated from enum value: BLOB_TYPE_BLOB_TYPE_RICH_TEXT = 7;
|
|
61
|
+
*/
|
|
62
|
+
BlobType[BlobType["BLOB_TYPE_RICH_TEXT"] = 7] = "BLOB_TYPE_RICH_TEXT";
|
|
63
|
+
/**
|
|
64
|
+
* @generated from enum value: BLOB_TYPE_BLOB_TYPE_EXTERNAL_LINK_PDF = 8;
|
|
65
|
+
*/
|
|
66
|
+
BlobType[BlobType["BLOB_TYPE_EXTERNAL_LINK_PDF"] = 8] = "BLOB_TYPE_EXTERNAL_LINK_PDF";
|
|
67
|
+
/**
|
|
68
|
+
* @generated from enum value: BLOB_TYPE_BLOB_TYPE_DOCUMENT = 9;
|
|
69
|
+
*/
|
|
70
|
+
BlobType[BlobType["BLOB_TYPE_DOCUMENT"] = 9] = "BLOB_TYPE_DOCUMENT";
|
|
71
|
+
/**
|
|
72
|
+
* @generated from enum value: BLOB_TYPE_BLOB_TYPE_VIDEO = 10;
|
|
73
|
+
*/
|
|
74
|
+
BlobType[BlobType["BLOB_TYPE_VIDEO"] = 10] = "BLOB_TYPE_VIDEO";
|
|
75
|
+
})(BlobType || (BlobType = {}));
|
|
76
|
+
/**
|
|
77
|
+
* Describes the enum internapi.v1.BlobType.
|
|
78
|
+
*/
|
|
79
|
+
export const BlobTypeSchema = /*@__PURE__*/ enumDesc(file_internapi_v1_internapi, 0);
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import type { LogLevel } from "./config.js";
|
|
2
|
+
export interface Logger {
|
|
3
|
+
debug(message: string, metadata?: Record<string, unknown>): void;
|
|
4
|
+
info(message: string, metadata?: Record<string, unknown>): void;
|
|
5
|
+
warn(message: string, metadata?: Record<string, unknown>): void;
|
|
6
|
+
error(message: string, metadata?: Record<string, unknown>): void;
|
|
7
|
+
}
|
|
8
|
+
export declare function createLogger(level: LogLevel): Logger;
|
|
@@ -0,0 +1,37 @@
|
|
|
1
|
+
import { redactForLogging, redactValue } from "./redaction.js";
|
|
2
|
+
const LEVELS = {
|
|
3
|
+
debug: 10,
|
|
4
|
+
info: 20,
|
|
5
|
+
warn: 30,
|
|
6
|
+
error: 40,
|
|
7
|
+
};
|
|
8
|
+
export function createLogger(level) {
|
|
9
|
+
const threshold = LEVELS[level];
|
|
10
|
+
function write(entryLevel, message, metadata = {}) {
|
|
11
|
+
if (LEVELS[entryLevel] < threshold) {
|
|
12
|
+
return;
|
|
13
|
+
}
|
|
14
|
+
const entry = {
|
|
15
|
+
ts: new Date().toISOString(),
|
|
16
|
+
level: entryLevel,
|
|
17
|
+
message,
|
|
18
|
+
...metadata,
|
|
19
|
+
};
|
|
20
|
+
const output = redactValue(JSON.stringify(redactForLogging(entry)));
|
|
21
|
+
if (entryLevel === "error") {
|
|
22
|
+
console.error(output);
|
|
23
|
+
}
|
|
24
|
+
else if (entryLevel === "warn") {
|
|
25
|
+
console.warn(output);
|
|
26
|
+
}
|
|
27
|
+
else {
|
|
28
|
+
console.log(output);
|
|
29
|
+
}
|
|
30
|
+
}
|
|
31
|
+
return {
|
|
32
|
+
debug: (message, metadata) => write("debug", message, metadata),
|
|
33
|
+
info: (message, metadata) => write("info", message, metadata),
|
|
34
|
+
warn: (message, metadata) => write("warn", message, metadata),
|
|
35
|
+
error: (message, metadata) => write("error", message, metadata),
|
|
36
|
+
};
|
|
37
|
+
}
|
|
@@ -0,0 +1,146 @@
|
|
|
1
|
+
import type { ArtifactRef, CursorRunRequestV1, CursorRunResultV1, HarnessRunRequestV1, HarnessRunResultV1, JsonValue, ModelFusionCapabilityStatus, ModelFusionStatus } from "../fixtures/modelFusion.js";
|
|
2
|
+
export type CursorCapabilityPolicy = "record-and-degrade" | "fail-closed";
|
|
3
|
+
export type CursorHarnessModel = {
|
|
4
|
+
id: string;
|
|
5
|
+
model: string;
|
|
6
|
+
endpointId?: string;
|
|
7
|
+
};
|
|
8
|
+
export type CursorAdapterMode = "fixture" | "real";
|
|
9
|
+
export type CursorEvidenceTier = "smoke" | "real";
|
|
10
|
+
export type CursorRouteInventorySummary = {
|
|
11
|
+
observedRoutes: number;
|
|
12
|
+
passThroughRoutes: number;
|
|
13
|
+
interceptedRoutes: number;
|
|
14
|
+
degradedRoutes?: number;
|
|
15
|
+
observedPaths?: string[];
|
|
16
|
+
failedRouteCount?: number;
|
|
17
|
+
diagnosis?: string[];
|
|
18
|
+
};
|
|
19
|
+
export type CursorCandidateEvidence = {
|
|
20
|
+
transcript?: string;
|
|
21
|
+
diff?: string;
|
|
22
|
+
log?: string;
|
|
23
|
+
outputSummary?: string;
|
|
24
|
+
rawPayload?: string;
|
|
25
|
+
observedModel?: string;
|
|
26
|
+
modelResolutionStatus?: CursorModelResolutionStatus;
|
|
27
|
+
modelResolutionReason?: string;
|
|
28
|
+
routeInventory?: CursorRouteInventorySummary;
|
|
29
|
+
routeInventoryArtifact?: ArtifactRef;
|
|
30
|
+
artifacts?: CursorArtifactEvidence[];
|
|
31
|
+
toolEvidence?: Record<string, JsonValue>[];
|
|
32
|
+
};
|
|
33
|
+
export type CursorArtifactEvidence = {
|
|
34
|
+
artifactId?: string;
|
|
35
|
+
kind: ArtifactRef["kind"];
|
|
36
|
+
uri?: string;
|
|
37
|
+
content?: string;
|
|
38
|
+
hash?: string;
|
|
39
|
+
redactionStatus?: ArtifactRef["redaction_status"];
|
|
40
|
+
};
|
|
41
|
+
export type CursorHarnessBaseOptions = {
|
|
42
|
+
capabilityPolicy?: CursorCapabilityPolicy;
|
|
43
|
+
artifactBaseUri?: string;
|
|
44
|
+
producer?: string;
|
|
45
|
+
producerVersion?: string;
|
|
46
|
+
producerGitSha?: string;
|
|
47
|
+
now?: () => Date;
|
|
48
|
+
};
|
|
49
|
+
export type CursorFixtureHarnessOptions = CursorHarnessBaseOptions & {
|
|
50
|
+
adapterMode?: "fixture";
|
|
51
|
+
};
|
|
52
|
+
export type CursorRealHarnessOptions = CursorHarnessBaseOptions & {
|
|
53
|
+
adapterMode: "real";
|
|
54
|
+
cursorRunClient: CursorRunClient;
|
|
55
|
+
capabilities?: Record<string, ModelFusionCapabilityStatus>;
|
|
56
|
+
};
|
|
57
|
+
export type CursorHarnessOptions = CursorFixtureHarnessOptions | CursorRealHarnessOptions;
|
|
58
|
+
export type RunCursorCandidateInput = {
|
|
59
|
+
request: HarnessRunRequestV1;
|
|
60
|
+
candidateId: string;
|
|
61
|
+
model: CursorHarnessModel;
|
|
62
|
+
workspacePath?: string;
|
|
63
|
+
worktreePath?: string;
|
|
64
|
+
timeoutMs?: number;
|
|
65
|
+
requestedModel?: string;
|
|
66
|
+
requiredCapabilities?: string[];
|
|
67
|
+
evidence?: CursorCandidateEvidence;
|
|
68
|
+
metadata?: Record<string, JsonValue>;
|
|
69
|
+
};
|
|
70
|
+
export type CursorCapabilityIssue = {
|
|
71
|
+
capability: string;
|
|
72
|
+
status: ModelFusionCapabilityStatus;
|
|
73
|
+
requestedStatus?: ModelFusionCapabilityStatus;
|
|
74
|
+
reason: string;
|
|
75
|
+
};
|
|
76
|
+
export type CursorModelResolutionStatus = "matched" | "unknown" | "blocked_override";
|
|
77
|
+
export type CursorModelEvidence = {
|
|
78
|
+
requestedModel: string;
|
|
79
|
+
observedModel: string;
|
|
80
|
+
modelId: string;
|
|
81
|
+
endpointId: string;
|
|
82
|
+
status: CursorModelResolutionStatus;
|
|
83
|
+
reason: string;
|
|
84
|
+
};
|
|
85
|
+
export type RunCursorCandidateOutput = {
|
|
86
|
+
cursorRequest: CursorRunRequestV1;
|
|
87
|
+
cursorResult: CursorRunResultV1;
|
|
88
|
+
harnessResult: HarnessRunResultV1;
|
|
89
|
+
missingCapabilities: CursorCapabilityIssue[];
|
|
90
|
+
metadata: Record<string, JsonValue>;
|
|
91
|
+
};
|
|
92
|
+
export type CursorRunClientRequest = {
|
|
93
|
+
cursorRequest: CursorRunRequestV1;
|
|
94
|
+
candidateId: string;
|
|
95
|
+
model: CursorHarnessModel;
|
|
96
|
+
workspacePath: string;
|
|
97
|
+
timeoutMs?: number;
|
|
98
|
+
capabilities: Record<string, ModelFusionCapabilityStatus>;
|
|
99
|
+
};
|
|
100
|
+
export type CursorRunClientResult = {
|
|
101
|
+
status?: ModelFusionStatus;
|
|
102
|
+
outputSummary?: string;
|
|
103
|
+
transcript?: string;
|
|
104
|
+
rawPayload?: string;
|
|
105
|
+
observedModel?: string;
|
|
106
|
+
modelId?: string;
|
|
107
|
+
endpointId?: string;
|
|
108
|
+
routeInventory?: CursorRouteInventorySummary;
|
|
109
|
+
routeInventoryArtifact?: ArtifactRef;
|
|
110
|
+
artifacts?: CursorArtifactEvidence[];
|
|
111
|
+
capabilities?: Record<string, ModelFusionCapabilityStatus>;
|
|
112
|
+
toolEvidence?: Record<string, JsonValue>[];
|
|
113
|
+
};
|
|
114
|
+
export type CursorRunClient = {
|
|
115
|
+
capabilities?: () => Record<string, ModelFusionCapabilityStatus>;
|
|
116
|
+
run(input: CursorRunClientRequest): Promise<CursorRunClientResult>;
|
|
117
|
+
};
|
|
118
|
+
export type CursorBridgeRunClientOptions = {
|
|
119
|
+
bridgeBaseUrl: string;
|
|
120
|
+
authToken?: string;
|
|
121
|
+
headers?: Record<string, string>;
|
|
122
|
+
fetch?: typeof fetch;
|
|
123
|
+
};
|
|
124
|
+
export type CursorFixtureHarness = {
|
|
125
|
+
id: "cursor";
|
|
126
|
+
adapterMode: "fixture";
|
|
127
|
+
capabilities(): Record<string, ModelFusionCapabilityStatus>;
|
|
128
|
+
runCursorCandidate(input: RunCursorCandidateInput): RunCursorCandidateOutput;
|
|
129
|
+
};
|
|
130
|
+
export type CursorRealHarness = {
|
|
131
|
+
id: "cursor";
|
|
132
|
+
adapterMode: "real";
|
|
133
|
+
capabilities(): Record<string, ModelFusionCapabilityStatus>;
|
|
134
|
+
runCursorCandidate(input: RunCursorCandidateInput): Promise<RunCursorCandidateOutput>;
|
|
135
|
+
};
|
|
136
|
+
export type CursorHarness = CursorFixtureHarness | CursorRealHarness;
|
|
137
|
+
export declare class CursorCapabilityError extends Error {
|
|
138
|
+
readonly issues: CursorCapabilityIssue[];
|
|
139
|
+
constructor(issues: CursorCapabilityIssue[]);
|
|
140
|
+
}
|
|
141
|
+
export declare function cursorHarness(options: CursorRealHarnessOptions): CursorRealHarness;
|
|
142
|
+
export declare function cursorHarness(options?: CursorFixtureHarnessOptions): CursorFixtureHarness;
|
|
143
|
+
export declare function runCursorCandidate(input: RunCursorCandidateInput, options?: CursorFixtureHarnessOptions): RunCursorCandidateOutput;
|
|
144
|
+
export declare function runRealCursorCandidate(input: RunCursorCandidateInput, options: CursorRealHarnessOptions): Promise<RunCursorCandidateOutput>;
|
|
145
|
+
export declare function cursorCapabilities(): Record<string, ModelFusionCapabilityStatus>;
|
|
146
|
+
export declare function createCursorBridgeRunClient(options: CursorBridgeRunClientOptions): CursorRunClient;
|