@kosuke-ai/kosuke 1.0.141 → 1.0.143
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/CHANGELOG.md +8 -0
- package/README.md +3 -1
- package/dist/commands/skill-runs.js +3 -0
- package/dist/generated/commands/crons/list--personal.js +21 -0
- package/dist/generated/commands/crons/list.js +21 -0
- package/dist/generated/commands/github/connection-get.js +7 -0
- package/dist/generated/commands/integrations/browser-connections-create--personal-network-linkedin.js +4 -0
- package/dist/generated/commands/integrations/browser-connections-create--personal-network-x.js +4 -0
- package/dist/generated/commands/integrations/browser-connections-list--personal-network-linkedin.js +13 -0
- package/dist/generated/commands/integrations/browser-connections-list--personal-network-x.js +13 -0
- package/dist/generated/commands/integrations/connections-delete--personal.js +4 -0
- package/dist/generated/commands/integrations/connections-list--personal.js +31 -0
- package/dist/generated/commands/models/list.js +10 -0
- package/dist/generated/commands/projects/labels-list.js +4 -0
- package/dist/generated/commands/projects/list.js +63 -0
- package/dist/generated/commands/providers/get--personal.js +16 -0
- package/dist/generated/commands/providers/get.js +8 -0
- package/dist/generated/commands/providers/google-get.js +5 -0
- package/dist/generated/commands/providers/google-methods-set.js +4 -0
- package/dist/generated/commands/providers/google-set.js +5 -0
- package/dist/generated/commands/providers/grok-get--personal.js +9 -0
- package/dist/generated/commands/providers/grok-get.js +4 -0
- package/dist/generated/commands/providers/grok-update--personal.js +9 -0
- package/dist/generated/commands/providers/grok-update.js +9 -0
- package/dist/generated/commands/providers/logins-complete--personal-provider-antigravity.js +8 -0
- package/dist/generated/commands/providers/logins-complete--personal-provider-claude-code.js +6 -0
- package/dist/generated/commands/providers/logins-complete--personal-provider-codex.js +6 -0
- package/dist/generated/commands/providers/logins-complete--personal-provider-muse-code.js +6 -0
- package/dist/generated/commands/providers/logins-complete--provider-antigravity.js +8 -0
- package/dist/generated/commands/providers/logins-complete--provider-claude-code.js +6 -0
- package/dist/generated/commands/providers/logins-complete--provider-codex.js +6 -0
- package/dist/generated/commands/providers/logins-complete--provider-muse-code.js +6 -0
- package/dist/generated/commands/providers/logins-start--personal-provider-antigravity.js +8 -0
- package/dist/generated/commands/providers/logins-start--personal-provider-claude-code.js +4 -0
- package/dist/generated/commands/providers/logins-start--personal-provider-codex.js +6 -0
- package/dist/generated/commands/providers/logins-start--personal-provider-muse-code.js +6 -0
- package/dist/generated/commands/providers/logins-start--provider-antigravity.js +8 -0
- package/dist/generated/commands/providers/logins-start--provider-claude-code.js +4 -0
- package/dist/generated/commands/providers/logins-start--provider-codex.js +6 -0
- package/dist/generated/commands/providers/logins-start--provider-muse-code.js +6 -0
- package/dist/generated/commands/providers/set.js +8 -0
- package/dist/generated/commands/providers/usage-get--personal.js +8 -0
- package/dist/generated/commands/providers/usage-get--provider-antigravity.js +8 -0
- package/dist/generated/commands/providers/usage-get--provider-claude-code.js +8 -0
- package/dist/generated/commands/providers/usage-get--provider-codex.js +8 -0
- package/dist/generated/commands/providers/usage-get--provider-coding-plan.js +8 -0
- package/dist/generated/commands/providers/usage-get--provider-deepseek-api.js +8 -0
- package/dist/generated/commands/providers/usage-get--provider-grok.js +8 -0
- package/dist/generated/commands/providers/usage-get--provider-kimi-code.js +8 -0
- package/dist/generated/commands/providers/usage-get--provider-muse-code.js +8 -0
- package/dist/generated/commands/sensei/cards-list.js +68 -0
- package/dist/generated/commands/sensei/cards-set.js +16 -0
- package/dist/generated/commands/sensei/reels-later-holds-create.js +3 -0
- package/dist/generated/commands/sensei/reels-later-holds-delete.js +3 -0
- package/dist/generated/commands/sensei/reels-later-holds-list.js +8 -0
- package/dist/generated/commands/sensei/sessions-facts-get.js +23 -0
- package/dist/generated/commands/sensei/threads-close.js +4 -0
- package/dist/generated/commands/sensei/threads-get.js +16 -0
- package/dist/generated/commands/sensei/threads-list.js +8 -1
- package/dist/generated/commands/sessions/files-get.js +8 -0
- package/dist/generated/commands/sessions/get.js +17 -0
- package/dist/generated/commands/sessions/labels-set.js +4 -0
- package/dist/generated/commands/sessions/list--all.js +79 -0
- package/dist/generated/commands/sessions/list.js +126 -0
- package/dist/generated/commands/skills/get--personal.js +10 -0
- package/dist/generated/commands/skills/list--personal.js +9 -0
- package/dist/generated/commands/tasks/get--personal.js +29 -0
- package/dist/generated/commands/tasks/get.js +29 -0
- package/dist/generated/commands/tasks/labels-list.js +4 -0
- package/dist/generated/commands/tasks/list--all.js +23 -0
- package/dist/generated/commands/tasks/list--personal.js +23 -0
- package/dist/generated/commands/tasks/list.js +23 -0
- package/dist/generated/commands/tasks/start--personal.js +4 -0
- package/dist/generated/commands/tasks/start.js +4 -0
- package/dist/generated/commands/user/profile-get.js +16 -0
- package/dist/generated/commands/user/settings-get.js +7 -0
- package/dist/generated/commands/user/settings-update.js +7 -0
- package/dist/generated/commands/user/usage-get.js +11 -0
- package/dist/generated/commands/workspaces/get.js +11 -0
- package/dist/generated/commands/workspaces/list.js +6 -0
- package/dist/generated/commands/workspaces/members-list--all.js +5 -0
- package/dist/generated/commands/workspaces/members-list.js +6 -0
- package/dist/generated/commands/workspaces/timezone-set.js +3 -0
- package/dist/generated/commands/workspaces/usage-breakdown-get.js +11 -0
- package/dist/program.js +5 -3
- package/dist/runtime/attach.js +7 -4
- package/dist/runtime/fields.js +29 -10
- package/dist/runtime/help.js +119 -2
- package/dist/runtime/runtime.js +1 -0
- package/openapi.json +816 -2
- package/package.json +4 -4
|
@@ -132,6 +132,132 @@ export const operation = {
|
|
|
132
132
|
"body": null,
|
|
133
133
|
"multipart": null,
|
|
134
134
|
"attachments": false,
|
|
135
|
+
"fields": [
|
|
136
|
+
"id",
|
|
137
|
+
"projectId",
|
|
138
|
+
"userId",
|
|
139
|
+
"title",
|
|
140
|
+
"titleRevision",
|
|
141
|
+
"branchName",
|
|
142
|
+
"startBranch",
|
|
143
|
+
"requestedBranchName",
|
|
144
|
+
"status",
|
|
145
|
+
"priority",
|
|
146
|
+
"sandboxTier",
|
|
147
|
+
"appStack",
|
|
148
|
+
"appStackStartedAt",
|
|
149
|
+
"appStackStartingAt",
|
|
150
|
+
"appStackError",
|
|
151
|
+
"createdAt",
|
|
152
|
+
"updatedAt",
|
|
153
|
+
"lastActivityAt",
|
|
154
|
+
"endedAt",
|
|
155
|
+
"lastViewedAt",
|
|
156
|
+
"lastAgentActivityAt",
|
|
157
|
+
"lastReassignedAt",
|
|
158
|
+
"messageCount",
|
|
159
|
+
"branchMergedAt",
|
|
160
|
+
"branchMergedBy",
|
|
161
|
+
"mergeRulePullRequestNumber",
|
|
162
|
+
"mergeCommitSha",
|
|
163
|
+
"pullRequestNumber",
|
|
164
|
+
"pullRequestOpenedAt",
|
|
165
|
+
"pullRequestBaseBranch",
|
|
166
|
+
"pullRequestFactsUnavailable",
|
|
167
|
+
"prOpenedBy",
|
|
168
|
+
"labels",
|
|
169
|
+
"isBehind",
|
|
170
|
+
"behindRevision",
|
|
171
|
+
"behindBaseSha",
|
|
172
|
+
"prStatus",
|
|
173
|
+
"prChecksStatus",
|
|
174
|
+
"prChecksTotal",
|
|
175
|
+
"prRevision",
|
|
176
|
+
"prConflictSince",
|
|
177
|
+
"prBehindSince",
|
|
178
|
+
"prChecksFailedSince",
|
|
179
|
+
"model",
|
|
180
|
+
"kosukeFree",
|
|
181
|
+
"nextModel",
|
|
182
|
+
"nextChosenBy",
|
|
183
|
+
"nextRevision",
|
|
184
|
+
"linesAdded",
|
|
185
|
+
"linesRemoved",
|
|
186
|
+
"contextTokens",
|
|
187
|
+
"contextWindowTokens",
|
|
188
|
+
"checkStatus",
|
|
189
|
+
"reviewAsks",
|
|
190
|
+
"shipRunStartedAt",
|
|
191
|
+
"prRequestedReviewers",
|
|
192
|
+
"effort",
|
|
193
|
+
"shipStage",
|
|
194
|
+
"stage",
|
|
195
|
+
"qaPassedSha",
|
|
196
|
+
"goAheadSha",
|
|
197
|
+
"goAheadBy",
|
|
198
|
+
"goAheadAt",
|
|
199
|
+
"goAheadSource",
|
|
200
|
+
"shipQa",
|
|
201
|
+
"shipReview",
|
|
202
|
+
"qaRuntimeChangeSha",
|
|
203
|
+
"qaRuntimeChangeFile",
|
|
204
|
+
"goAheadMerges",
|
|
205
|
+
"pullRequestHeadSha",
|
|
206
|
+
"readyAt",
|
|
207
|
+
"assessment",
|
|
208
|
+
"senseiEstimate",
|
|
209
|
+
"assessmentHeadSha",
|
|
210
|
+
"assessmentRevision",
|
|
211
|
+
"unansweredClarification",
|
|
212
|
+
"workingMs",
|
|
213
|
+
"runningSince",
|
|
214
|
+
"workingMsAtReady",
|
|
215
|
+
"shipClock",
|
|
216
|
+
"shipEstimateSnapshot",
|
|
217
|
+
"prReviewDecision",
|
|
218
|
+
"prApproved",
|
|
219
|
+
"prUnresolvedThreads",
|
|
220
|
+
"prThreadsChangedAt",
|
|
221
|
+
"prSentReviewIds",
|
|
222
|
+
"historyBoundaryAt",
|
|
223
|
+
"sandboxId",
|
|
224
|
+
"anthropicCredentialOwner",
|
|
225
|
+
"openaiCredentialOwner",
|
|
226
|
+
"zaiCredentialOwner",
|
|
227
|
+
"moonshotCredentialOwner",
|
|
228
|
+
"deepseekCredentialOwner",
|
|
229
|
+
"metaCredentialOwner",
|
|
230
|
+
"googleCredentialOwner",
|
|
231
|
+
"credentialOrgId",
|
|
232
|
+
"sandboxStatus",
|
|
233
|
+
"sandboxRunningSince",
|
|
234
|
+
"sandboxLifecycleEventAt",
|
|
235
|
+
"frustrationAlertedSeverity",
|
|
236
|
+
"createdBy",
|
|
237
|
+
"filedBySessionId",
|
|
238
|
+
"filedByCronId",
|
|
239
|
+
"filedByCronRunId",
|
|
240
|
+
"filedReason",
|
|
241
|
+
"startWhenDeployedAt",
|
|
242
|
+
"closedBySwitchAt",
|
|
243
|
+
"freeReservedSourceId",
|
|
244
|
+
"freeReservedRevision",
|
|
245
|
+
"freeReservedModel",
|
|
246
|
+
"freeReservedAt",
|
|
247
|
+
"freeSourceId",
|
|
248
|
+
"freeRevision",
|
|
249
|
+
"freeModel",
|
|
250
|
+
"freeUsedAt",
|
|
251
|
+
"waitingForDeploy",
|
|
252
|
+
"latestChatJobStatus",
|
|
253
|
+
"latestChatJobCreatedAt",
|
|
254
|
+
"latestStopReason",
|
|
255
|
+
"isUnread",
|
|
256
|
+
"filedSource",
|
|
257
|
+
"prompt",
|
|
258
|
+
"promptTruncated",
|
|
259
|
+
"user"
|
|
260
|
+
],
|
|
135
261
|
"anonymous": false,
|
|
136
262
|
"agents": "all"
|
|
137
263
|
};
|
|
@@ -16,6 +16,16 @@ export const operation = {
|
|
|
16
16
|
"body": null,
|
|
17
17
|
"multipart": null,
|
|
18
18
|
"attachments": false,
|
|
19
|
+
"fields": [
|
|
20
|
+
"id",
|
|
21
|
+
"name",
|
|
22
|
+
"description",
|
|
23
|
+
"argumentHint",
|
|
24
|
+
"enabled",
|
|
25
|
+
"fileCount",
|
|
26
|
+
"replaces",
|
|
27
|
+
"files"
|
|
28
|
+
],
|
|
19
29
|
"anonymous": false,
|
|
20
30
|
"agents": "all"
|
|
21
31
|
};
|
|
@@ -14,6 +14,15 @@ export const operation = {
|
|
|
14
14
|
"body": null,
|
|
15
15
|
"multipart": null,
|
|
16
16
|
"attachments": false,
|
|
17
|
+
"fields": [
|
|
18
|
+
"id",
|
|
19
|
+
"name",
|
|
20
|
+
"description",
|
|
21
|
+
"argumentHint",
|
|
22
|
+
"enabled",
|
|
23
|
+
"fileCount",
|
|
24
|
+
"replaces"
|
|
25
|
+
],
|
|
17
26
|
"anonymous": false,
|
|
18
27
|
"agents": "all"
|
|
19
28
|
};
|
|
@@ -17,6 +17,35 @@ export const operation = {
|
|
|
17
17
|
"body": null,
|
|
18
18
|
"multipart": null,
|
|
19
19
|
"attachments": false,
|
|
20
|
+
"fields": [
|
|
21
|
+
"id",
|
|
22
|
+
"organizationId",
|
|
23
|
+
"status",
|
|
24
|
+
"title",
|
|
25
|
+
"priority",
|
|
26
|
+
"userId",
|
|
27
|
+
"projectId",
|
|
28
|
+
"hintProjectId",
|
|
29
|
+
"hintProjectName",
|
|
30
|
+
"filedThreadId",
|
|
31
|
+
"personalTask",
|
|
32
|
+
"createdAt",
|
|
33
|
+
"updatedAt",
|
|
34
|
+
"chatSession",
|
|
35
|
+
"model",
|
|
36
|
+
"description",
|
|
37
|
+
"descriptionRevision",
|
|
38
|
+
"dueOn",
|
|
39
|
+
"doneAt",
|
|
40
|
+
"archivedAt",
|
|
41
|
+
"thread",
|
|
42
|
+
"sandboxTier",
|
|
43
|
+
"defaultSandboxTier",
|
|
44
|
+
"appStack",
|
|
45
|
+
"pullRequestUrl",
|
|
46
|
+
"branchUrl",
|
|
47
|
+
"session"
|
|
48
|
+
],
|
|
20
49
|
"anonymous": false,
|
|
21
50
|
"agents": [
|
|
22
51
|
"senseiToken"
|
|
@@ -14,6 +14,35 @@ export const operation = {
|
|
|
14
14
|
"body": null,
|
|
15
15
|
"multipart": null,
|
|
16
16
|
"attachments": false,
|
|
17
|
+
"fields": [
|
|
18
|
+
"id",
|
|
19
|
+
"organizationId",
|
|
20
|
+
"status",
|
|
21
|
+
"title",
|
|
22
|
+
"priority",
|
|
23
|
+
"userId",
|
|
24
|
+
"projectId",
|
|
25
|
+
"hintProjectId",
|
|
26
|
+
"hintProjectName",
|
|
27
|
+
"filedThreadId",
|
|
28
|
+
"personalTask",
|
|
29
|
+
"createdAt",
|
|
30
|
+
"updatedAt",
|
|
31
|
+
"chatSession",
|
|
32
|
+
"model",
|
|
33
|
+
"description",
|
|
34
|
+
"descriptionRevision",
|
|
35
|
+
"dueOn",
|
|
36
|
+
"doneAt",
|
|
37
|
+
"archivedAt",
|
|
38
|
+
"thread",
|
|
39
|
+
"sandboxTier",
|
|
40
|
+
"defaultSandboxTier",
|
|
41
|
+
"appStack",
|
|
42
|
+
"pullRequestUrl",
|
|
43
|
+
"branchUrl",
|
|
44
|
+
"session"
|
|
45
|
+
],
|
|
17
46
|
"anonymous": false,
|
|
18
47
|
"agents": "all"
|
|
19
48
|
};
|
|
@@ -139,6 +139,29 @@ export const operation = {
|
|
|
139
139
|
"body": null,
|
|
140
140
|
"multipart": null,
|
|
141
141
|
"attachments": false,
|
|
142
|
+
"fields": [
|
|
143
|
+
"id",
|
|
144
|
+
"title",
|
|
145
|
+
"status",
|
|
146
|
+
"priority",
|
|
147
|
+
"organizationId",
|
|
148
|
+
"projectId",
|
|
149
|
+
"hintProjectId",
|
|
150
|
+
"hintProjectName",
|
|
151
|
+
"userId",
|
|
152
|
+
"createdBy",
|
|
153
|
+
"model",
|
|
154
|
+
"personalTask",
|
|
155
|
+
"filedThreadId",
|
|
156
|
+
"description",
|
|
157
|
+
"prompt",
|
|
158
|
+
"promptTruncated",
|
|
159
|
+
"chatSession",
|
|
160
|
+
"createdAt",
|
|
161
|
+
"updatedAt",
|
|
162
|
+
"chatSession.id",
|
|
163
|
+
"chatSession.status"
|
|
164
|
+
],
|
|
142
165
|
"anonymous": false,
|
|
143
166
|
"agents": "all"
|
|
144
167
|
};
|
|
@@ -140,6 +140,29 @@ export const operation = {
|
|
|
140
140
|
"body": null,
|
|
141
141
|
"multipart": null,
|
|
142
142
|
"attachments": false,
|
|
143
|
+
"fields": [
|
|
144
|
+
"id",
|
|
145
|
+
"title",
|
|
146
|
+
"status",
|
|
147
|
+
"priority",
|
|
148
|
+
"organizationId",
|
|
149
|
+
"projectId",
|
|
150
|
+
"hintProjectId",
|
|
151
|
+
"hintProjectName",
|
|
152
|
+
"userId",
|
|
153
|
+
"createdBy",
|
|
154
|
+
"model",
|
|
155
|
+
"personalTask",
|
|
156
|
+
"filedThreadId",
|
|
157
|
+
"description",
|
|
158
|
+
"prompt",
|
|
159
|
+
"promptTruncated",
|
|
160
|
+
"chatSession",
|
|
161
|
+
"createdAt",
|
|
162
|
+
"updatedAt",
|
|
163
|
+
"chatSession.id",
|
|
164
|
+
"chatSession.status"
|
|
165
|
+
],
|
|
143
166
|
"anonymous": false,
|
|
144
167
|
"agents": [
|
|
145
168
|
"senseiToken"
|
|
@@ -138,6 +138,29 @@ export const operation = {
|
|
|
138
138
|
"body": null,
|
|
139
139
|
"multipart": null,
|
|
140
140
|
"attachments": false,
|
|
141
|
+
"fields": [
|
|
142
|
+
"id",
|
|
143
|
+
"title",
|
|
144
|
+
"status",
|
|
145
|
+
"priority",
|
|
146
|
+
"organizationId",
|
|
147
|
+
"projectId",
|
|
148
|
+
"hintProjectId",
|
|
149
|
+
"hintProjectName",
|
|
150
|
+
"userId",
|
|
151
|
+
"createdBy",
|
|
152
|
+
"model",
|
|
153
|
+
"personalTask",
|
|
154
|
+
"filedThreadId",
|
|
155
|
+
"description",
|
|
156
|
+
"prompt",
|
|
157
|
+
"promptTruncated",
|
|
158
|
+
"chatSession",
|
|
159
|
+
"createdAt",
|
|
160
|
+
"updatedAt",
|
|
161
|
+
"chatSession.id",
|
|
162
|
+
"chatSession.status"
|
|
163
|
+
],
|
|
141
164
|
"anonymous": false,
|
|
142
165
|
"agents": "all"
|
|
143
166
|
};
|
|
@@ -12,6 +12,22 @@ export const operation = {
|
|
|
12
12
|
"body": null,
|
|
13
13
|
"multipart": null,
|
|
14
14
|
"attachments": false,
|
|
15
|
+
"fields": [
|
|
16
|
+
"id",
|
|
17
|
+
"personalSpaceId",
|
|
18
|
+
"email",
|
|
19
|
+
"name",
|
|
20
|
+
"imageUrl",
|
|
21
|
+
"onboardingCompleted",
|
|
22
|
+
"createdAt",
|
|
23
|
+
"marketingEmails",
|
|
24
|
+
"fyiDigestMinutes",
|
|
25
|
+
"threadRouting",
|
|
26
|
+
"locale",
|
|
27
|
+
"defaultModel",
|
|
28
|
+
"isSuperAdmin",
|
|
29
|
+
"canRedeemPromoCode"
|
|
30
|
+
],
|
|
15
31
|
"anonymous": false,
|
|
16
32
|
"agents": "all"
|
|
17
33
|
};
|
|
@@ -12,6 +12,13 @@ export const operation = {
|
|
|
12
12
|
"body": null,
|
|
13
13
|
"multipart": null,
|
|
14
14
|
"attachments": false,
|
|
15
|
+
"fields": [
|
|
16
|
+
"timeZone",
|
|
17
|
+
"timeZoneSource",
|
|
18
|
+
"resolvedTimeZone",
|
|
19
|
+
"resolvedFrom",
|
|
20
|
+
"systemCrons"
|
|
21
|
+
],
|
|
15
22
|
"anonymous": false,
|
|
16
23
|
"agents": "all"
|
|
17
24
|
};
|
|
@@ -32,5 +32,16 @@ export const operation = {
|
|
|
32
32
|
"body": null,
|
|
33
33
|
"multipart": null,
|
|
34
34
|
"attachments": false,
|
|
35
|
+
"fields": [
|
|
36
|
+
"range",
|
|
37
|
+
"timeZone",
|
|
38
|
+
"from",
|
|
39
|
+
"to",
|
|
40
|
+
"recordingStartedOn",
|
|
41
|
+
"firstUsedOn",
|
|
42
|
+
"totals",
|
|
43
|
+
"days",
|
|
44
|
+
"groups"
|
|
45
|
+
],
|
|
35
46
|
"anonymous": false
|
|
36
47
|
};
|
|
@@ -13,6 +13,17 @@ export const operation = {
|
|
|
13
13
|
"body": null,
|
|
14
14
|
"multipart": null,
|
|
15
15
|
"attachments": false,
|
|
16
|
+
"fields": [
|
|
17
|
+
"personal",
|
|
18
|
+
"id",
|
|
19
|
+
"name",
|
|
20
|
+
"logo",
|
|
21
|
+
"createdAt",
|
|
22
|
+
"role",
|
|
23
|
+
"isAdmin",
|
|
24
|
+
"isOwner",
|
|
25
|
+
"timezone"
|
|
26
|
+
],
|
|
16
27
|
"anonymous": false,
|
|
17
28
|
"agents": "all"
|
|
18
29
|
};
|
|
@@ -35,6 +35,17 @@ export const operation = {
|
|
|
35
35
|
"body": null,
|
|
36
36
|
"multipart": null,
|
|
37
37
|
"attachments": false,
|
|
38
|
+
"fields": [
|
|
39
|
+
"range",
|
|
40
|
+
"timeZone",
|
|
41
|
+
"from",
|
|
42
|
+
"to",
|
|
43
|
+
"recordingStartedOn",
|
|
44
|
+
"firstUsedOn",
|
|
45
|
+
"totals",
|
|
46
|
+
"days",
|
|
47
|
+
"groups"
|
|
48
|
+
],
|
|
38
49
|
"anonymous": false,
|
|
39
50
|
"agents": "all"
|
|
40
51
|
};
|
package/dist/program.js
CHANGED
|
@@ -10,7 +10,7 @@ import { HAND_WRITTEN } from './commands/hand-written.js';
|
|
|
10
10
|
import { operations } from './generated/commands/index.js';
|
|
11
11
|
import { attachCommand } from './runtime/attach.js';
|
|
12
12
|
import { parseFields, parseFormat } from './runtime/fields.js';
|
|
13
|
-
import { helpConfiguration, suggestOnError, takeLongHelp } from './runtime/help.js';
|
|
13
|
+
import { helpConfiguration, setOwnOutput, suggestOnError, takeLongHelp } from './runtime/help.js';
|
|
14
14
|
import { formsOf } from './runtime/variants.js';
|
|
15
15
|
import { agentTokenOf, isReachable } from './runtime/agent-tokens.js';
|
|
16
16
|
import { createRuntime, ExitSignal } from './runtime/runtime.js';
|
|
@@ -41,13 +41,15 @@ export function createProgram(options = {}) {
|
|
|
41
41
|
.option('--api-key <key>', 'API key; overrides KOSUKE_API_KEY and the stored one.')
|
|
42
42
|
.option('--api-url <url>', 'Platform URL; overrides KOSUKE_API_URL. Default https://app.kosuke.ai.')
|
|
43
43
|
.option('--pretty', 'Indented JSON; the default at a terminal, one line when piped.')
|
|
44
|
-
.option('--json', "The platform's whole answer as JSON,
|
|
44
|
+
.option('--json', "The platform's whole answer as JSON, every field; pick fields with --fields. Or KOSUKE_OUTPUT=json.")
|
|
45
45
|
.option('--fields <paths>', 'Only these comma-separated fields; dots reach nested ones. Per row on a list, else on the object: id,chatSession.id.', asOption(parseFields))
|
|
46
|
-
.option('--format <
|
|
46
|
+
.option('--format <json|compact>', 'compact: a header, then one tab-separated line per row. Nulls print empty, timestamps to the second; json is the default.', asOption(parseFormat))
|
|
47
47
|
// commander's default is kept: a program option is read wherever it
|
|
48
48
|
// appears, so `kosuke projects list --api-key X` works as the README shows.
|
|
49
49
|
.showHelpAfterError('(add --help for usage)')
|
|
50
50
|
.configureHelp(helpConfiguration(options.longHelp === true));
|
|
51
|
+
// Each command's help lists the output flags, or says it prints its own text.
|
|
52
|
+
setOwnOutput(program, OWN_OUTPUT);
|
|
51
53
|
// Built lazily, on the first use, so `--help` and `--version` never touch
|
|
52
54
|
// the credentials file.
|
|
53
55
|
let runtime = null;
|
package/dist/runtime/attach.js
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { readFileSync } from 'node:fs';
|
|
2
2
|
import { Argument, Command, InvalidArgumentError, Option } from 'commander';
|
|
3
3
|
import { addsSessionIdFlag, CLI_ONLY_FLAGS, omitsProject, SESSION_ID_FLAG, sessionIdField, } from './arguments.js';
|
|
4
|
-
import { setAfterHelp, setOptionShape, shortSummary, usageError } from './help.js';
|
|
4
|
+
import { setAfterHelp, setFormFields, setOptionShape, shortSummary, usageError } from './help.js';
|
|
5
5
|
import { buildRequest, execute, readWholeBody, UsageError } from './invoke.js';
|
|
6
6
|
import { LIST_FLAG_HELP, listAnswer, shortList, shortRequestFields } from './list-defaults.js';
|
|
7
7
|
import { collect, jsonParser } from './option-parsers.js';
|
|
@@ -32,7 +32,7 @@ export function attachCommand(root, forms, runtime, { reachable = () => true } =
|
|
|
32
32
|
function attachLeaf(root, path, operation, runtime, hidden) {
|
|
33
33
|
const parent = groupFor(root, path.slice(0, -1));
|
|
34
34
|
const leaf = parent.command(path[path.length - 1], { hidden });
|
|
35
|
-
leaf.description(operation.summary);
|
|
35
|
+
setFormFields(leaf.description(operation.summary), [operation], () => '');
|
|
36
36
|
// `projectId, sessionId, ...`: commander takes one fewer, the project looked up (sessionArgs).
|
|
37
37
|
const lookup = omitsProject(operation);
|
|
38
38
|
for (const name of operation.pathParams) {
|
|
@@ -201,6 +201,7 @@ function attachForms(root, forms, runtime, reachable) {
|
|
|
201
201
|
const visible = forms.filter(reachable);
|
|
202
202
|
const lead = forms.find((form) => scopeOf(form) === 'workspace') ?? forms[0];
|
|
203
203
|
leaf.description(lead.summary);
|
|
204
|
+
setFormFields(leaf, visible, (form) => formUsage(form, shape));
|
|
204
205
|
if (shape.scope) {
|
|
205
206
|
leaf.addArgument(new Argument(shape.scope.label, shape.scope.label === `<${PERSONAL}>`
|
|
206
207
|
? 'The word personal: this command works on your own only.'
|
|
@@ -352,13 +353,15 @@ async function run(leaf, runtime, operation, input, options = {}) {
|
|
|
352
353
|
// `--fields` and `--format` pick from the platform's own JSON, so a text view steps aside.
|
|
353
354
|
const { fields, format } = leaf.optsWithGlobals();
|
|
354
355
|
const view = fields || format ? undefined : VIEWS[operation.command.join(' ')]?.view;
|
|
356
|
+
const context = { list: operation.command.at(-1) === 'list', declared: operation.fields };
|
|
355
357
|
if (list && outcome.ok) {
|
|
356
358
|
const sent = request;
|
|
357
359
|
const short = await listAnswer(list.rules, list.call, outcome, (more) => execute(client, { ...sent, query: { ...sent.query, ...more } }, controller.signal));
|
|
358
|
-
runtime.output(short.answer, { list: true, footer: short.footer });
|
|
360
|
+
runtime.output(short.answer, { ...context, list: true, footer: short.footer });
|
|
359
361
|
return;
|
|
360
362
|
}
|
|
361
|
-
|
|
363
|
+
const answer = view && outcome.ok ? { ...outcome, body: view(outcome.body, options) } : outcome;
|
|
364
|
+
runtime.output(answer, context);
|
|
362
365
|
}
|
|
363
366
|
finally {
|
|
364
367
|
process.removeListener('SIGINT', cancel);
|