blokctl 0.6.20 → 0.7.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/__tests__/modular-observability.capstone.e2e.test.js +72 -0
- package/dist/commands/create/node.js +46 -66
- package/dist/commands/create/project.js +55 -9
- package/dist/commands/create/utils/Examples.d.ts +8 -20
- package/dist/commands/create/utils/Examples.js +138 -412
- package/dist/commands/dev/index.js +40 -1
- package/dist/commands/gen/appTypes.js +40 -1
- package/dist/commands/generate/NodeGenerator.d.ts +0 -2
- package/dist/commands/generate/NodeGenerator.js +0 -20
- package/dist/commands/generate/RuntimeGenerator.d.ts +0 -2
- package/dist/commands/generate/RuntimeGenerator.js +0 -19
- package/dist/commands/generate/RuntimeGenerator.test.js +0 -29
- package/dist/commands/generate/TriggerGenerator.d.ts +0 -2
- package/dist/commands/generate/TriggerGenerator.js +0 -19
- package/dist/commands/generate/WorkflowGenerator.d.ts +0 -2
- package/dist/commands/generate/WorkflowGenerator.js +0 -19
- package/dist/commands/generate/e2e/NodeGenerator.e2e.test.js +0 -12
- package/dist/commands/generate/e2e/RuntimeGenerator.e2e.test.js +0 -12
- package/dist/commands/generate/e2e/TriggerGenerator.e2e.test.js +0 -14
- package/dist/commands/monitor/monitor-component.js +5 -5
- package/dist/commands/observability/add.d.ts +2 -0
- package/dist/commands/observability/add.js +113 -0
- package/dist/commands/observability/alerting-module.test.js +43 -0
- package/dist/commands/observability/apply.d.ts +10 -0
- package/dist/commands/observability/apply.js +11 -0
- package/dist/commands/observability/descriptor.d.ts +37 -0
- package/dist/commands/observability/descriptor.js +203 -0
- package/dist/commands/observability/descriptor.test.d.ts +1 -0
- package/dist/commands/observability/descriptor.test.js +40 -0
- package/dist/commands/observability/index.d.ts +1 -0
- package/dist/commands/observability/index.js +53 -0
- package/dist/commands/observability/list.d.ts +2 -0
- package/dist/commands/observability/list.js +45 -0
- package/dist/commands/observability/logging-module.test.d.ts +1 -0
- package/dist/commands/observability/logging-module.test.js +43 -0
- package/dist/commands/observability/obs-stack-module.test.d.ts +1 -0
- package/dist/commands/observability/obs-stack-module.test.js +33 -0
- package/dist/commands/observability/remove.d.ts +2 -0
- package/dist/commands/observability/remove.js +62 -0
- package/dist/commands/observability/shared.d.ts +6 -0
- package/dist/commands/observability/shared.js +23 -0
- package/dist/commands/observability/status.d.ts +2 -0
- package/dist/commands/observability/status.js +36 -0
- package/dist/commands/observability/tracing-module.test.d.ts +1 -0
- package/dist/commands/observability/tracing-module.test.js +42 -0
- package/dist/commands/profile/index.js +7 -10
- package/dist/commands/watch/format.d.ts +23 -0
- package/dist/commands/watch/format.js +60 -0
- package/dist/commands/watch/index.d.ts +1 -0
- package/dist/commands/watch/index.js +53 -0
- package/dist/commands/watch/sse.d.ts +16 -0
- package/dist/commands/watch/sse.js +82 -0
- package/dist/index.d.ts +2 -0
- package/dist/index.js +4 -0
- package/dist/services/obs-setup.d.ts +5 -0
- package/dist/services/obs-setup.js +68 -0
- package/dist/services/obs-setup.test.d.ts +1 -0
- package/dist/services/obs-setup.test.js +71 -0
- package/dist/services/obs-tiers.d.ts +9 -0
- package/dist/services/obs-tiers.js +16 -0
- package/dist/services/observability-mutations.d.ts +4 -0
- package/dist/services/observability-mutations.js +46 -0
- package/dist/services/observability-mutations.test.d.ts +1 -0
- package/dist/services/observability-mutations.test.js +57 -0
- package/dist/services/runtime-setup.d.ts +12 -1
- package/dist/services/runtime-setup.js +274 -14
- package/dist/studio-dist/assets/{index-BD8_9YPN.js → index-CnFqCRQe.js} +17 -17
- package/dist/studio-dist/index.html +1 -1
- package/package.json +3 -3
- package/dist/commands/generate/GenerationAnalytics.d.ts +0 -61
- package/dist/commands/generate/GenerationAnalytics.js +0 -163
- package/dist/commands/generate/GenerationAnalytics.test.js +0 -407
- package/dist/commands/generate/PromptVersioning.d.ts +0 -25
- package/dist/commands/generate/PromptVersioning.js +0 -71
- package/dist/commands/generate/PromptVersioning.test.js +0 -120
- /package/dist/{commands/generate/GenerationAnalytics.test.d.ts → __tests__/modular-observability.capstone.e2e.test.d.ts} +0 -0
- /package/dist/commands/{generate/PromptVersioning.test.d.ts → observability/alerting-module.test.d.ts} +0 -0
|
@@ -1,71 +0,0 @@
|
|
|
1
|
-
export const PROMPT_VERSIONS = {
|
|
2
|
-
"create-fn-node": {
|
|
3
|
-
id: "create-fn-node",
|
|
4
|
-
version: "2.0.0",
|
|
5
|
-
changelog: "Function-first defineNode pattern with Zod schemas, 2 real-world examples",
|
|
6
|
-
createdAt: "2026-01-28T00:00:00Z",
|
|
7
|
-
contentHash: "",
|
|
8
|
-
},
|
|
9
|
-
"create-node": {
|
|
10
|
-
id: "create-node",
|
|
11
|
-
version: "1.0.0",
|
|
12
|
-
changelog: "Class-based BlokService pattern with GlobalError handling",
|
|
13
|
-
createdAt: "2026-01-27T00:00:00Z",
|
|
14
|
-
contentHash: "",
|
|
15
|
-
},
|
|
16
|
-
"create-workflow": {
|
|
17
|
-
id: "create-workflow",
|
|
18
|
-
version: "2.0.0",
|
|
19
|
-
changelog: "7 trigger types (HTTP, Queue, Pub/Sub, Cron, Webhook, WebSocket, SSE), 4 examples",
|
|
20
|
-
createdAt: "2026-01-28T00:00:00Z",
|
|
21
|
-
contentHash: "",
|
|
22
|
-
},
|
|
23
|
-
"create-trigger": {
|
|
24
|
-
id: "create-trigger",
|
|
25
|
-
version: "2.0.0",
|
|
26
|
-
changelog: "TriggerBase architecture, 6 trigger type examples, context creation pattern",
|
|
27
|
-
createdAt: "2026-01-28T00:00:00Z",
|
|
28
|
-
contentHash: "",
|
|
29
|
-
},
|
|
30
|
-
"create-runtime": {
|
|
31
|
-
id: "create-runtime",
|
|
32
|
-
version: "1.0.0",
|
|
33
|
-
changelog: "Runtime SDK generation for Go, Java, Rust, Python, C#, PHP, Ruby with HTTP protocol",
|
|
34
|
-
createdAt: "2026-01-28T00:00:00Z",
|
|
35
|
-
contentHash: "",
|
|
36
|
-
},
|
|
37
|
-
};
|
|
38
|
-
export function computeContentHash(content) {
|
|
39
|
-
let hash = 0;
|
|
40
|
-
for (let i = 0; i < content.length; i++) {
|
|
41
|
-
const char = content.charCodeAt(i);
|
|
42
|
-
hash = ((hash << 5) - hash + char) | 0;
|
|
43
|
-
}
|
|
44
|
-
return Math.abs(hash).toString(36);
|
|
45
|
-
}
|
|
46
|
-
export function getPromptVersion(promptId) {
|
|
47
|
-
return PROMPT_VERSIONS[promptId];
|
|
48
|
-
}
|
|
49
|
-
export function getAllPromptVersions() {
|
|
50
|
-
return Object.values(PROMPT_VERSIONS);
|
|
51
|
-
}
|
|
52
|
-
export function getVersionStamp(promptId) {
|
|
53
|
-
const version = PROMPT_VERSIONS[promptId];
|
|
54
|
-
if (!version)
|
|
55
|
-
return `${promptId}@unknown`;
|
|
56
|
-
return `${version.id}@${version.version}`;
|
|
57
|
-
}
|
|
58
|
-
export function registerPromptContent(promptId, content) {
|
|
59
|
-
const version = PROMPT_VERSIONS[promptId];
|
|
60
|
-
if (version) {
|
|
61
|
-
version.contentHash = computeContentHash(content);
|
|
62
|
-
}
|
|
63
|
-
}
|
|
64
|
-
export default {
|
|
65
|
-
PROMPT_VERSIONS,
|
|
66
|
-
getPromptVersion,
|
|
67
|
-
getAllPromptVersions,
|
|
68
|
-
getVersionStamp,
|
|
69
|
-
computeContentHash,
|
|
70
|
-
registerPromptContent,
|
|
71
|
-
};
|
|
@@ -1,120 +0,0 @@
|
|
|
1
|
-
import { describe, expect, it } from "vitest";
|
|
2
|
-
import { PROMPT_VERSIONS, computeContentHash, getAllPromptVersions, getPromptVersion, getVersionStamp, registerPromptContent, } from "./PromptVersioning.js";
|
|
3
|
-
describe("PromptVersioning", () => {
|
|
4
|
-
describe("PROMPT_VERSIONS registry", () => {
|
|
5
|
-
it("should have entries for all prompt types", () => {
|
|
6
|
-
expect(PROMPT_VERSIONS["create-fn-node"]).toBeDefined();
|
|
7
|
-
expect(PROMPT_VERSIONS["create-node"]).toBeDefined();
|
|
8
|
-
expect(PROMPT_VERSIONS["create-workflow"]).toBeDefined();
|
|
9
|
-
expect(PROMPT_VERSIONS["create-trigger"]).toBeDefined();
|
|
10
|
-
});
|
|
11
|
-
it("should have valid version strings for all entries", () => {
|
|
12
|
-
for (const [id, version] of Object.entries(PROMPT_VERSIONS)) {
|
|
13
|
-
expect(version.version).toMatch(/^\d+\.\d+\.\d+$/);
|
|
14
|
-
expect(version.id).toBe(id);
|
|
15
|
-
expect(version.changelog).toBeTruthy();
|
|
16
|
-
expect(version.createdAt).toMatch(/^\d{4}-\d{2}-\d{2}T/);
|
|
17
|
-
}
|
|
18
|
-
});
|
|
19
|
-
it("should have function-first node at v2.0.0 with defineNode pattern", () => {
|
|
20
|
-
const fnNode = PROMPT_VERSIONS["create-fn-node"];
|
|
21
|
-
expect(fnNode.version).toBe("2.0.0");
|
|
22
|
-
expect(fnNode.changelog).toContain("defineNode");
|
|
23
|
-
});
|
|
24
|
-
it("should have workflow prompt at v2.0.0 with trigger types", () => {
|
|
25
|
-
const workflow = PROMPT_VERSIONS["create-workflow"];
|
|
26
|
-
expect(workflow.version).toBe("2.0.0");
|
|
27
|
-
expect(workflow.changelog).toContain("trigger");
|
|
28
|
-
});
|
|
29
|
-
it("should have trigger prompt at v2.0.0 with TriggerBase", () => {
|
|
30
|
-
const trigger = PROMPT_VERSIONS["create-trigger"];
|
|
31
|
-
expect(trigger.version).toBe("2.0.0");
|
|
32
|
-
expect(trigger.changelog).toContain("TriggerBase");
|
|
33
|
-
});
|
|
34
|
-
});
|
|
35
|
-
describe("getPromptVersion", () => {
|
|
36
|
-
it("should return version for known prompt ID", () => {
|
|
37
|
-
const version = getPromptVersion("create-fn-node");
|
|
38
|
-
expect(version).toBeDefined();
|
|
39
|
-
expect(version.id).toBe("create-fn-node");
|
|
40
|
-
});
|
|
41
|
-
it("should return undefined for unknown prompt ID", () => {
|
|
42
|
-
const version = getPromptVersion("nonexistent-prompt");
|
|
43
|
-
expect(version).toBeUndefined();
|
|
44
|
-
});
|
|
45
|
-
});
|
|
46
|
-
describe("getAllPromptVersions", () => {
|
|
47
|
-
it("should return all registered prompt versions", () => {
|
|
48
|
-
const versions = getAllPromptVersions();
|
|
49
|
-
expect(versions.length).toBeGreaterThanOrEqual(4);
|
|
50
|
-
});
|
|
51
|
-
it("should include all known prompt IDs", () => {
|
|
52
|
-
const versions = getAllPromptVersions();
|
|
53
|
-
const ids = versions.map((v) => v.id);
|
|
54
|
-
expect(ids).toContain("create-fn-node");
|
|
55
|
-
expect(ids).toContain("create-node");
|
|
56
|
-
expect(ids).toContain("create-workflow");
|
|
57
|
-
expect(ids).toContain("create-trigger");
|
|
58
|
-
});
|
|
59
|
-
});
|
|
60
|
-
describe("getVersionStamp", () => {
|
|
61
|
-
it("should return formatted version stamp for known prompt", () => {
|
|
62
|
-
const stamp = getVersionStamp("create-fn-node");
|
|
63
|
-
expect(stamp).toBe("create-fn-node@2.0.0");
|
|
64
|
-
});
|
|
65
|
-
it("should return unknown stamp for unregistered prompt", () => {
|
|
66
|
-
const stamp = getVersionStamp("unknown-prompt");
|
|
67
|
-
expect(stamp).toBe("unknown-prompt@unknown");
|
|
68
|
-
});
|
|
69
|
-
it("should return stamps in id@version format", () => {
|
|
70
|
-
for (const [id, version] of Object.entries(PROMPT_VERSIONS)) {
|
|
71
|
-
const stamp = getVersionStamp(id);
|
|
72
|
-
expect(stamp).toBe(`${id}@${version.version}`);
|
|
73
|
-
}
|
|
74
|
-
});
|
|
75
|
-
});
|
|
76
|
-
describe("computeContentHash", () => {
|
|
77
|
-
it("should return a non-empty string", () => {
|
|
78
|
-
const hash = computeContentHash("test content");
|
|
79
|
-
expect(hash).toBeTruthy();
|
|
80
|
-
expect(typeof hash).toBe("string");
|
|
81
|
-
});
|
|
82
|
-
it("should return consistent hash for same content", () => {
|
|
83
|
-
const hash1 = computeContentHash("hello world");
|
|
84
|
-
const hash2 = computeContentHash("hello world");
|
|
85
|
-
expect(hash1).toBe(hash2);
|
|
86
|
-
});
|
|
87
|
-
it("should return different hashes for different content", () => {
|
|
88
|
-
const hash1 = computeContentHash("content A");
|
|
89
|
-
const hash2 = computeContentHash("content B");
|
|
90
|
-
expect(hash1).not.toBe(hash2);
|
|
91
|
-
});
|
|
92
|
-
it("should handle empty string", () => {
|
|
93
|
-
const hash = computeContentHash("");
|
|
94
|
-
expect(hash).toBe("0");
|
|
95
|
-
});
|
|
96
|
-
it("should handle long content", () => {
|
|
97
|
-
const longContent = "a".repeat(10000);
|
|
98
|
-
const hash = computeContentHash(longContent);
|
|
99
|
-
expect(hash).toBeTruthy();
|
|
100
|
-
});
|
|
101
|
-
});
|
|
102
|
-
describe("registerPromptContent", () => {
|
|
103
|
-
it("should compute and store content hash for known prompt", () => {
|
|
104
|
-
registerPromptContent("create-fn-node", "test prompt content");
|
|
105
|
-
const version = getPromptVersion("create-fn-node");
|
|
106
|
-
expect(version.contentHash).toBeTruthy();
|
|
107
|
-
expect(version.contentHash).toBe(computeContentHash("test prompt content"));
|
|
108
|
-
});
|
|
109
|
-
it("should not throw for unknown prompt ID", () => {
|
|
110
|
-
expect(() => registerPromptContent("nonexistent", "content")).not.toThrow();
|
|
111
|
-
});
|
|
112
|
-
it("should update hash when content changes", () => {
|
|
113
|
-
registerPromptContent("create-node", "content v1");
|
|
114
|
-
const hash1 = getPromptVersion("create-node").contentHash;
|
|
115
|
-
registerPromptContent("create-node", "content v2");
|
|
116
|
-
const hash2 = getPromptVersion("create-node").contentHash;
|
|
117
|
-
expect(hash1).not.toBe(hash2);
|
|
118
|
-
});
|
|
119
|
-
});
|
|
120
|
-
});
|
|
File without changes
|
|
File without changes
|