@blastin-dev/clocktopus-cli 0.1.4 → 0.2.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/README.md +163 -5
- package/dist/src/commands/agent/disable.d.ts +21 -0
- package/dist/src/commands/agent/disable.d.ts.map +1 -0
- package/dist/src/commands/agent/disable.js +106 -0
- package/dist/src/commands/agent/doctor.d.ts +2 -0
- package/dist/src/commands/agent/doctor.d.ts.map +1 -0
- package/dist/src/commands/agent/doctor.js +306 -0
- package/dist/src/commands/agent/hook.d.ts +5 -0
- package/dist/src/commands/agent/hook.d.ts.map +1 -0
- package/dist/src/commands/agent/hook.js +368 -0
- package/dist/src/commands/agent/setup.d.ts +28 -0
- package/dist/src/commands/agent/setup.d.ts.map +1 -0
- package/dist/src/commands/agent/setup.js +333 -0
- package/dist/src/commands/agent/status.d.ts +2 -0
- package/dist/src/commands/agent/status.d.ts.map +1 -0
- package/dist/src/commands/agent/status.js +182 -0
- package/dist/src/index.d.ts.map +1 -1
- package/dist/src/index.js +51 -2
- package/dist/src/lib/agent-config.d.ts +56 -0
- package/dist/src/lib/agent-config.d.ts.map +1 -0
- package/dist/src/lib/agent-config.js +168 -0
- package/dist/src/lib/agent-hook-state.d.ts +44 -0
- package/dist/src/lib/agent-hook-state.d.ts.map +1 -0
- package/dist/src/lib/agent-hook-state.js +155 -0
- package/dist/src/lib/agent-receiver.d.ts +26 -0
- package/dist/src/lib/agent-receiver.d.ts.map +1 -0
- package/dist/src/lib/agent-receiver.js +44 -0
- package/dist/src/lib/agents.d.ts +115 -0
- package/dist/src/lib/agents.d.ts.map +1 -0
- package/dist/src/lib/agents.js +245 -0
- package/dist/src/lib/claude-settings.d.ts +82 -0
- package/dist/src/lib/claude-settings.d.ts.map +1 -0
- package/dist/src/lib/claude-settings.js +271 -0
- package/dist/src/lib/claude-settings.test.d.ts +2 -0
- package/dist/src/lib/claude-settings.test.d.ts.map +1 -0
- package/dist/src/lib/claude-settings.test.js +193 -0
- package/dist/src/lib/codex-config.d.ts +166 -0
- package/dist/src/lib/codex-config.d.ts.map +1 -0
- package/dist/src/lib/codex-config.js +441 -0
- package/dist/src/lib/codex-config.test.d.ts +2 -0
- package/dist/src/lib/codex-config.test.d.ts.map +1 -0
- package/dist/src/lib/codex-config.test.js +359 -0
- package/dist/src/lib/config.d.ts +23 -0
- package/dist/src/lib/config.d.ts.map +1 -1
- package/dist/src/lib/config.js +14 -0
- package/dist/src/lib/format.d.ts +6 -0
- package/dist/src/lib/format.d.ts.map +1 -0
- package/dist/src/lib/format.js +19 -0
- package/dist/src/lib/git.d.ts +3 -0
- package/dist/src/lib/git.d.ts.map +1 -0
- package/dist/src/lib/git.js +30 -0
- package/dist/src/lib/opencode-config.d.ts +108 -0
- package/dist/src/lib/opencode-config.d.ts.map +1 -0
- package/dist/src/lib/opencode-config.js +330 -0
- package/dist/src/lib/opencode-config.test.d.ts +2 -0
- package/dist/src/lib/opencode-config.test.d.ts.map +1 -0
- package/dist/src/lib/opencode-config.test.js +140 -0
- package/dist/src/lib/repo-guidance.d.ts +40 -0
- package/dist/src/lib/repo-guidance.d.ts.map +1 -0
- package/dist/src/lib/repo-guidance.js +123 -0
- package/dist/src/lib/validators.d.ts +69 -0
- package/dist/src/lib/validators.d.ts.map +1 -1
- package/dist/src/lib/validators.js +69 -0
- package/package.json +7 -4
|
@@ -36,4 +36,73 @@ export declare const TokenErrorResponseSchema: z.ZodObject<{
|
|
|
36
36
|
}, z.core.$strip>;
|
|
37
37
|
export type TokenResponse = z.infer<typeof TokenResponseSchema>;
|
|
38
38
|
export type TokenErrorResponse = z.infer<typeof TokenErrorResponseSchema>;
|
|
39
|
+
export declare const IngestTokenSchema: z.ZodObject<{
|
|
40
|
+
tokenId: z.ZodString;
|
|
41
|
+
token: z.ZodString;
|
|
42
|
+
tokenPrefix: z.ZodString;
|
|
43
|
+
endpoint: z.ZodString;
|
|
44
|
+
}, z.core.$strip>;
|
|
45
|
+
export declare const AgentEndpointSchema: z.ZodObject<{
|
|
46
|
+
endpoint: z.ZodString;
|
|
47
|
+
}, z.core.$strip>;
|
|
48
|
+
export declare const AgentStatusSchema: z.ZodObject<{
|
|
49
|
+
endpoint: z.ZodString;
|
|
50
|
+
window: z.ZodObject<{
|
|
51
|
+
since: z.ZodString;
|
|
52
|
+
sessions: z.ZodNumber;
|
|
53
|
+
unattributedSessions: z.ZodNumber;
|
|
54
|
+
costMicroUsd: z.ZodNumber;
|
|
55
|
+
}, z.core.$strip>;
|
|
56
|
+
hookLane: z.ZodObject<{
|
|
57
|
+
lastSessionStartedAt: z.ZodNullable<z.ZodString>;
|
|
58
|
+
repositoryUrl: z.ZodNullable<z.ZodString>;
|
|
59
|
+
gitBranch: z.ZodNullable<z.ZodString>;
|
|
60
|
+
cwd: z.ZodNullable<z.ZodString>;
|
|
61
|
+
attributed: z.ZodNullable<z.ZodBoolean>;
|
|
62
|
+
}, z.core.$strip>;
|
|
63
|
+
metricsLane: z.ZodObject<{
|
|
64
|
+
lastExportReceivedAt: z.ZodNullable<z.ZodString>;
|
|
65
|
+
lastModel: z.ZodNullable<z.ZodString>;
|
|
66
|
+
}, z.core.$strip>;
|
|
67
|
+
tokens: z.ZodArray<z.ZodObject<{
|
|
68
|
+
id: z.ZodString;
|
|
69
|
+
name: z.ZodNullable<z.ZodString>;
|
|
70
|
+
tokenPrefix: z.ZodString;
|
|
71
|
+
lastUsedAt: z.ZodNullable<z.ZodString>;
|
|
72
|
+
usageCount: z.ZodNumber;
|
|
73
|
+
createdAt: z.ZodString;
|
|
74
|
+
}, z.core.$strip>>;
|
|
75
|
+
}, z.core.$strip>;
|
|
76
|
+
export declare const RepoStatusSchema: z.ZodObject<{
|
|
77
|
+
repository: z.ZodNullable<z.ZodObject<{
|
|
78
|
+
provider: z.ZodString;
|
|
79
|
+
ownerRepo: z.ZodString;
|
|
80
|
+
displayUrl: z.ZodString;
|
|
81
|
+
}, z.core.$strip>>;
|
|
82
|
+
attribution: z.ZodObject<{
|
|
83
|
+
reason: z.ZodEnum<{
|
|
84
|
+
attributed: "attributed";
|
|
85
|
+
no_repository: "no_repository";
|
|
86
|
+
unsupported_remote: "unsupported_remote";
|
|
87
|
+
no_matching_project: "no_matching_project";
|
|
88
|
+
ambiguous_project: "ambiguous_project";
|
|
89
|
+
}>;
|
|
90
|
+
projectId: z.ZodNullable<z.ZodString>;
|
|
91
|
+
projectNames: z.ZodArray<z.ZodString>;
|
|
92
|
+
}, z.core.$strip>;
|
|
93
|
+
commitLane: z.ZodObject<{
|
|
94
|
+
status: z.ZodEnum<{
|
|
95
|
+
delivering: "delivering";
|
|
96
|
+
no_secret: "no_secret";
|
|
97
|
+
no_delivery: "no_delivery";
|
|
98
|
+
}>;
|
|
99
|
+
lastCommitAt: z.ZodNullable<z.ZodString>;
|
|
100
|
+
hasWebhookSecret: z.ZodBoolean;
|
|
101
|
+
}, z.core.$strip>;
|
|
102
|
+
ready: z.ZodBoolean;
|
|
103
|
+
webhookUrl: z.ZodString;
|
|
104
|
+
}, z.core.$strip>;
|
|
105
|
+
export type IngestTokenResponse = z.infer<typeof IngestTokenSchema>;
|
|
106
|
+
export type AgentStatusResponse = z.infer<typeof AgentStatusSchema>;
|
|
107
|
+
export type RepoStatusResponse = z.infer<typeof RepoStatusSchema>;
|
|
39
108
|
//# sourceMappingURL=validators.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"validators.d.ts","sourceRoot":"","sources":["../../../src/lib/validators.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAExB,eAAO,MAAM,UAAU;;;;;;;;;iBASrB,CAAC;AAEH,MAAM,MAAM,YAAY,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,UAAU,CAAC,CAAC;AAEtD,eAAO,MAAM,wBAAwB;;;;;;;iBAOnC,CAAC;AAEH,MAAM,MAAM,kBAAkB,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,wBAAwB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,CAAC;AACpE,MAAM,MAAM,mBAAmB,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,iBAAiB,CAAC,CAAC;AACpE,MAAM,MAAM,kBAAkB,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,gBAAgB,CAAC,CAAC"}
|
|
@@ -32,3 +32,72 @@ export const TokenErrorResponseSchema = z.object({
|
|
|
32
32
|
]),
|
|
33
33
|
error_description: z.string().optional(),
|
|
34
34
|
});
|
|
35
|
+
// Agent telemetry (`clocktopus agent …`). The endpoint is always supplied by
|
|
36
|
+
// the server rather than known to the CLI: the receiver lives on its own
|
|
37
|
+
// Router whose URL differs per stage, so a baked-in default would be wrong
|
|
38
|
+
// everywhere but production.
|
|
39
|
+
export const IngestTokenSchema = z.object({
|
|
40
|
+
tokenId: z.string(),
|
|
41
|
+
/** Plaintext, returned exactly once — the server stores only a hash. */
|
|
42
|
+
token: z.string(),
|
|
43
|
+
tokenPrefix: z.string(),
|
|
44
|
+
endpoint: z.string(),
|
|
45
|
+
});
|
|
46
|
+
export const AgentEndpointSchema = z.object({
|
|
47
|
+
endpoint: z.string(),
|
|
48
|
+
});
|
|
49
|
+
export const AgentStatusSchema = z.object({
|
|
50
|
+
endpoint: z.string(),
|
|
51
|
+
window: z.object({
|
|
52
|
+
since: z.string(),
|
|
53
|
+
sessions: z.number(),
|
|
54
|
+
unattributedSessions: z.number(),
|
|
55
|
+
costMicroUsd: z.number(),
|
|
56
|
+
}),
|
|
57
|
+
hookLane: z.object({
|
|
58
|
+
lastSessionStartedAt: z.string().nullable(),
|
|
59
|
+
repositoryUrl: z.string().nullable(),
|
|
60
|
+
gitBranch: z.string().nullable(),
|
|
61
|
+
cwd: z.string().nullable(),
|
|
62
|
+
attributed: z.boolean().nullable(),
|
|
63
|
+
}),
|
|
64
|
+
metricsLane: z.object({
|
|
65
|
+
lastExportReceivedAt: z.string().nullable(),
|
|
66
|
+
lastModel: z.string().nullable(),
|
|
67
|
+
}),
|
|
68
|
+
tokens: z.array(z.object({
|
|
69
|
+
id: z.string(),
|
|
70
|
+
name: z.string().nullable(),
|
|
71
|
+
tokenPrefix: z.string(),
|
|
72
|
+
lastUsedAt: z.string().nullable(),
|
|
73
|
+
usageCount: z.number(),
|
|
74
|
+
createdAt: z.string(),
|
|
75
|
+
})),
|
|
76
|
+
});
|
|
77
|
+
export const RepoStatusSchema = z.object({
|
|
78
|
+
repository: z
|
|
79
|
+
.object({
|
|
80
|
+
provider: z.string(),
|
|
81
|
+
ownerRepo: z.string(),
|
|
82
|
+
displayUrl: z.string(),
|
|
83
|
+
})
|
|
84
|
+
.nullable(),
|
|
85
|
+
attribution: z.object({
|
|
86
|
+
reason: z.enum([
|
|
87
|
+
"attributed",
|
|
88
|
+
"no_repository",
|
|
89
|
+
"unsupported_remote",
|
|
90
|
+
"no_matching_project",
|
|
91
|
+
"ambiguous_project",
|
|
92
|
+
]),
|
|
93
|
+
projectId: z.string().nullable(),
|
|
94
|
+
projectNames: z.array(z.string()),
|
|
95
|
+
}),
|
|
96
|
+
commitLane: z.object({
|
|
97
|
+
status: z.enum(["delivering", "no_secret", "no_delivery"]),
|
|
98
|
+
lastCommitAt: z.string().nullable(),
|
|
99
|
+
hasWebhookSecret: z.boolean(),
|
|
100
|
+
}),
|
|
101
|
+
ready: z.boolean(),
|
|
102
|
+
webhookUrl: z.string(),
|
|
103
|
+
});
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@blastin-dev/clocktopus-cli",
|
|
3
|
-
"version": "0.1
|
|
3
|
+
"version": "0.2.1",
|
|
4
4
|
"type": "module",
|
|
5
5
|
"bin": {
|
|
6
6
|
"clocktopus": "./dist/bin/clocktopus.js"
|
|
@@ -12,13 +12,15 @@
|
|
|
12
12
|
"commander": "^13.0.0",
|
|
13
13
|
"conf": "^13.0.0",
|
|
14
14
|
"date-fns": "4.1.0",
|
|
15
|
-
"
|
|
15
|
+
"smol-toml": "^1.8.0",
|
|
16
|
+
"zod": "4.4.3"
|
|
16
17
|
},
|
|
17
18
|
"devDependencies": {
|
|
18
19
|
"@types/node": "22.15.3",
|
|
19
20
|
"eslint": "9.37.0",
|
|
20
21
|
"eslint-plugin-import-x": "^4.16.1",
|
|
21
22
|
"typescript": "5.9.2",
|
|
23
|
+
"vitest": "^4.1.5",
|
|
22
24
|
"@repo/eslint-config": "0.0.0",
|
|
23
25
|
"@repo/prettier-config": "0.1.0",
|
|
24
26
|
"@repo/typescript-config": "0.0.0"
|
|
@@ -28,8 +30,9 @@
|
|
|
28
30
|
"build": "tsc",
|
|
29
31
|
"dev": "tsc --watch",
|
|
30
32
|
"check-types": "tsc --noEmit",
|
|
33
|
+
"test": "vitest run",
|
|
31
34
|
"lint": "eslint",
|
|
32
|
-
"format": "prettier --check . --ignore-path ../../.gitignore",
|
|
33
|
-
"format:fix": "prettier --write . --ignore-path ../../.gitignore"
|
|
35
|
+
"format": "prettier --check . --ignore-path ../../.gitignore --ignore-path ../../.prettierignore",
|
|
36
|
+
"format:fix": "prettier --write . --ignore-path ../../.gitignore --ignore-path ../../.prettierignore"
|
|
34
37
|
}
|
|
35
38
|
}
|