@kosuke-ai/kosuke 1.0.58 → 1.0.60
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 +15 -0
- package/README.md +31 -2
- package/dist/commands/hand-written.js +15 -0
- package/dist/commands/help.js +52 -0
- package/dist/generated/commands/crons/create--personal.js +2 -1
- package/dist/generated/commands/crons/update--personal.js +2 -1
- package/dist/generated/commands/deploys/queue-update.js +2 -1
- package/dist/generated/commands/find/index.js +17 -0
- package/dist/generated/commands/index.js +279 -291
- package/dist/generated/commands/integrations/tools-call.js +2 -1
- package/dist/generated/commands/projects/batch-merging-get.js +1 -1
- package/dist/generated/commands/projects/batch-merging-picks-set.js +2 -1
- package/dist/generated/commands/projects/batch-merging-set.js +19 -1
- package/dist/generated/commands/projects/create.js +21 -9
- package/dist/generated/commands/projects/labels-delete.js +2 -1
- package/dist/generated/commands/projects/live-logs-list.js +1 -1
- package/dist/generated/commands/projects/live-queries-run.js +1 -1
- package/dist/generated/commands/projects/live-traffic-get.js +1 -1
- package/dist/generated/commands/projects/releases-list.js +1 -1
- package/dist/generated/commands/projects/services-create.js +6 -3
- package/dist/generated/commands/projects/services-update.js +6 -3
- package/dist/generated/commands/projects/settings-set.js +4 -2
- package/dist/generated/commands/projects/versions-list.js +1 -1
- package/dist/generated/commands/sensei/cards-mark-read.js +1 -1
- package/dist/generated/commands/sensei/cards-set.js +40 -10
- package/dist/generated/commands/sensei/connect-buttons-create.js +2 -1
- package/dist/generated/commands/sensei/describe-cards-create.js +1 -1
- package/dist/generated/commands/sensei/messages-send.js +2 -1
- package/dist/generated/commands/sensei/sessions-assessments-create.js +3 -1
- package/dist/generated/commands/sensei/sessions-facts-get.js +1 -1
- package/dist/generated/commands/sensei/suggestions-create.js +2 -1
- package/dist/generated/commands/sensei/threads-get.js +8 -1
- package/dist/generated/commands/sensei/threads-split.js +2 -1
- package/dist/generated/commands/sensei/tickets-merge.js +4 -2
- package/dist/generated/commands/sensei/watch-reads-finish.js +4 -2
- package/dist/generated/commands/sensei/writing-samples-create.js +2 -1
- package/dist/generated/commands/sessions/get.js +1 -1
- package/dist/generated/commands/sessions/labels-set.js +6 -3
- package/dist/generated/commands/sessions/labels-update.js +4 -2
- package/dist/generated/commands/sessions/list--all.js +2 -3
- package/dist/generated/commands/sessions/qa-runs-finish.js +2 -1
- package/dist/generated/commands/sessions/qa-runs-results-create.js +2 -1
- package/dist/generated/commands/sessions/qa-runs-start.js +2 -1
- package/dist/generated/commands/sessions/queue-update.js +2 -1
- package/dist/generated/commands/sessions/send.js +4 -2
- package/dist/generated/commands/sessions/update.js +2 -1
- package/dist/generated/commands/skills/create--personal.js +2 -1
- package/dist/generated/commands/skills/create.js +2 -1
- package/dist/generated/commands/skills/update--personal.js +2 -1
- package/dist/generated/commands/skills/update.js +2 -1
- package/dist/generated/commands/tasks/create--personal.js +235 -11
- package/dist/generated/commands/tasks/create.js +1 -1
- package/dist/generated/commands/tasks/delete--personal.js +6 -3
- package/dist/generated/commands/tasks/get--personal.js +6 -3
- package/dist/generated/commands/tasks/list--all.js +1 -1
- package/dist/generated/commands/tasks/list--personal.js +91 -9
- package/dist/generated/commands/tasks/move--personal.js +7 -4
- package/dist/generated/commands/tasks/start--personal.js +6 -3
- package/dist/generated/commands/tasks/update--personal.js +85 -10
- package/dist/generated/commands/tasks/update.js +3 -2
- package/dist/generated/commands/user/personal-space-get.js +19 -0
- package/dist/generated/commands/workspaces/sandboxes-stop.js +2 -1
- package/dist/program.js +13 -2
- package/dist/runtime/arguments.js +58 -0
- package/dist/runtime/attach.js +177 -18
- package/dist/runtime/help.js +398 -0
- package/dist/runtime/personal-space-id.js +26 -0
- package/dist/runtime/personal-space.js +10 -0
- package/dist/runtime/runtime.js +25 -5
- package/dist/runtime/thread-text.js +316 -0
- package/openapi.json +321 -599
- package/package.json +11 -4
- package/dist/generated/commands/projects/backlog-items-create.js +0 -35
- package/dist/generated/commands/projects/backlog-items-delete.js +0 -20
- package/dist/generated/commands/projects/backlog-items-list.js +0 -19
- package/dist/generated/commands/projects/backlog-items-send.js +0 -20
- package/dist/generated/commands/projects/backlog-items-update.js +0 -42
- package/dist/generated/commands/projects/live-writes-create.js +0 -38
- package/dist/generated/commands/projects/live-writes-get.js +0 -21
- package/dist/generated/commands/projects/workflow-set.js +0 -33
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
export const operation = {
|
|
2
2
|
"method": "get",
|
|
3
|
-
"path": "/api/
|
|
3
|
+
"path": "/api/organizations/{workspaceId}/tasks",
|
|
4
4
|
"command": [
|
|
5
5
|
"tasks",
|
|
6
6
|
"list"
|
|
@@ -8,13 +8,21 @@ export const operation = {
|
|
|
8
8
|
"variant": {
|
|
9
9
|
"scope": "personal"
|
|
10
10
|
},
|
|
11
|
-
"
|
|
11
|
+
"personalSpace": true,
|
|
12
|
+
"summary": "The same, in your Personal space.",
|
|
12
13
|
"pathParams": [],
|
|
13
14
|
"query": [
|
|
14
15
|
{
|
|
15
16
|
"name": "status",
|
|
16
17
|
"flag": "status",
|
|
17
18
|
"kind": "string",
|
|
19
|
+
"required": false,
|
|
20
|
+
"description": "Comma-separated statuses to include (todo, in_progress, done, archived). Without it, every status."
|
|
21
|
+
},
|
|
22
|
+
{
|
|
23
|
+
"name": "owners",
|
|
24
|
+
"flag": "owners",
|
|
25
|
+
"kind": "string",
|
|
18
26
|
"required": false
|
|
19
27
|
},
|
|
20
28
|
{
|
|
@@ -24,23 +32,47 @@ export const operation = {
|
|
|
24
32
|
"required": false
|
|
25
33
|
},
|
|
26
34
|
{
|
|
27
|
-
"name": "
|
|
28
|
-
"flag": "
|
|
35
|
+
"name": "labels",
|
|
36
|
+
"flag": "labels",
|
|
37
|
+
"kind": "string",
|
|
38
|
+
"required": false,
|
|
39
|
+
"description": "JSON array of up to 20 label names. Matches tasks whose Chat Session carries at least one of them; a task with no Chat Session never matches. [] means no filter."
|
|
40
|
+
},
|
|
41
|
+
{
|
|
42
|
+
"name": "createdBy",
|
|
43
|
+
"flag": "created-by",
|
|
44
|
+
"kind": "string",
|
|
45
|
+
"required": false,
|
|
46
|
+
"choices": [
|
|
47
|
+
"agent",
|
|
48
|
+
"member"
|
|
49
|
+
]
|
|
50
|
+
},
|
|
51
|
+
{
|
|
52
|
+
"name": "project",
|
|
53
|
+
"flag": "project",
|
|
29
54
|
"kind": "string",
|
|
30
55
|
"required": false
|
|
31
56
|
},
|
|
32
57
|
{
|
|
33
|
-
"name": "
|
|
34
|
-
"flag": "
|
|
58
|
+
"name": "projects",
|
|
59
|
+
"flag": "projects",
|
|
35
60
|
"kind": "string",
|
|
36
61
|
"required": false
|
|
37
62
|
},
|
|
38
63
|
{
|
|
39
|
-
"name": "
|
|
40
|
-
"flag": "
|
|
64
|
+
"name": "q",
|
|
65
|
+
"flag": "q",
|
|
41
66
|
"kind": "string",
|
|
42
67
|
"required": false
|
|
43
68
|
},
|
|
69
|
+
{
|
|
70
|
+
"name": "doneSince",
|
|
71
|
+
"flag": "done-since",
|
|
72
|
+
"kind": "string",
|
|
73
|
+
"required": false,
|
|
74
|
+
"description": "Keeps only the Done and Archived tasks that reached that status since this time."
|
|
75
|
+
},
|
|
44
76
|
{
|
|
45
77
|
"name": "limit",
|
|
46
78
|
"flag": "limit",
|
|
@@ -53,6 +85,41 @@ export const operation = {
|
|
|
53
85
|
"kind": "string",
|
|
54
86
|
"required": false
|
|
55
87
|
},
|
|
88
|
+
{
|
|
89
|
+
"name": "sortBy",
|
|
90
|
+
"flag": "sort-by",
|
|
91
|
+
"kind": "string",
|
|
92
|
+
"required": false,
|
|
93
|
+
"choices": [
|
|
94
|
+
"activity",
|
|
95
|
+
"created",
|
|
96
|
+
"priority"
|
|
97
|
+
]
|
|
98
|
+
},
|
|
99
|
+
{
|
|
100
|
+
"name": "sortOrder",
|
|
101
|
+
"flag": "sort-order",
|
|
102
|
+
"kind": "string",
|
|
103
|
+
"required": false,
|
|
104
|
+
"choices": [
|
|
105
|
+
"asc",
|
|
106
|
+
"desc"
|
|
107
|
+
]
|
|
108
|
+
},
|
|
109
|
+
{
|
|
110
|
+
"name": "needsYou",
|
|
111
|
+
"flag": "needs-you",
|
|
112
|
+
"kind": "boolean",
|
|
113
|
+
"required": false,
|
|
114
|
+
"description": "Only tasks whose Chat Session needs the viewer."
|
|
115
|
+
},
|
|
116
|
+
{
|
|
117
|
+
"name": "includePrompt",
|
|
118
|
+
"flag": "include-prompt",
|
|
119
|
+
"kind": "boolean",
|
|
120
|
+
"required": false,
|
|
121
|
+
"description": "Adds each task's prompt: a Todo task's description, or its first message after Start, cut at 4,000 characters (promptTruncated). Read `tasks get` for a cut or empty one."
|
|
122
|
+
},
|
|
56
123
|
{
|
|
57
124
|
"name": "includeOpenCount",
|
|
58
125
|
"flag": "include-open-count",
|
|
@@ -62,11 +129,26 @@ export const operation = {
|
|
|
62
129
|
"true",
|
|
63
130
|
"false"
|
|
64
131
|
]
|
|
132
|
+
},
|
|
133
|
+
{
|
|
134
|
+
"name": "workspace",
|
|
135
|
+
"flag": "workspace",
|
|
136
|
+
"kind": "string",
|
|
137
|
+
"required": false
|
|
138
|
+
},
|
|
139
|
+
{
|
|
140
|
+
"name": "threadId",
|
|
141
|
+
"flag": "thread-id",
|
|
142
|
+
"kind": "string",
|
|
143
|
+
"required": false,
|
|
144
|
+
"description": "Only the tasks with no Chat Session filed in this thread of your own Sensei. Another member’s thread matches none."
|
|
65
145
|
}
|
|
66
146
|
],
|
|
67
147
|
"body": null,
|
|
68
148
|
"multipart": null,
|
|
69
149
|
"attachments": false,
|
|
70
150
|
"anonymous": false,
|
|
71
|
-
"agents":
|
|
151
|
+
"agents": [
|
|
152
|
+
"senseiToken"
|
|
153
|
+
]
|
|
72
154
|
};
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
export const operation = {
|
|
2
2
|
"method": "post",
|
|
3
|
-
"path": "/api/
|
|
3
|
+
"path": "/api/organizations/{workspaceId}/tasks/{taskId}/move",
|
|
4
4
|
"command": [
|
|
5
5
|
"tasks",
|
|
6
6
|
"move"
|
|
@@ -8,7 +8,8 @@ export const operation = {
|
|
|
8
8
|
"variant": {
|
|
9
9
|
"scope": "personal"
|
|
10
10
|
},
|
|
11
|
-
"
|
|
11
|
+
"personalSpace": true,
|
|
12
|
+
"summary": "The same, in your Personal space.",
|
|
12
13
|
"pathParams": [
|
|
13
14
|
"taskId"
|
|
14
15
|
],
|
|
@@ -20,7 +21,7 @@ export const operation = {
|
|
|
20
21
|
"flag": "org-id",
|
|
21
22
|
"kind": "string",
|
|
22
23
|
"required": true,
|
|
23
|
-
"description": "
|
|
24
|
+
"description": "The target workspace you belong to."
|
|
24
25
|
}
|
|
25
26
|
],
|
|
26
27
|
"required": true
|
|
@@ -28,5 +29,7 @@ export const operation = {
|
|
|
28
29
|
"multipart": null,
|
|
29
30
|
"attachments": false,
|
|
30
31
|
"anonymous": false,
|
|
31
|
-
"agents":
|
|
32
|
+
"agents": [
|
|
33
|
+
"senseiToken"
|
|
34
|
+
]
|
|
32
35
|
};
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
export const operation = {
|
|
2
2
|
"method": "post",
|
|
3
|
-
"path": "/api/
|
|
3
|
+
"path": "/api/organizations/{workspaceId}/tasks/{taskId}/start",
|
|
4
4
|
"command": [
|
|
5
5
|
"tasks",
|
|
6
6
|
"start"
|
|
@@ -8,7 +8,8 @@ export const operation = {
|
|
|
8
8
|
"variant": {
|
|
9
9
|
"scope": "personal"
|
|
10
10
|
},
|
|
11
|
-
"
|
|
11
|
+
"personalSpace": true,
|
|
12
|
+
"summary": "The same, in your Personal space.",
|
|
12
13
|
"pathParams": [
|
|
13
14
|
"taskId"
|
|
14
15
|
],
|
|
@@ -67,5 +68,7 @@ export const operation = {
|
|
|
67
68
|
"multipart": null,
|
|
68
69
|
"attachments": false,
|
|
69
70
|
"anonymous": false,
|
|
70
|
-
"agents":
|
|
71
|
+
"agents": [
|
|
72
|
+
"senseiToken"
|
|
73
|
+
]
|
|
71
74
|
};
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
export const operation = {
|
|
2
2
|
"method": "patch",
|
|
3
|
-
"path": "/api/
|
|
3
|
+
"path": "/api/organizations/{workspaceId}/tasks/{taskId}",
|
|
4
4
|
"command": [
|
|
5
5
|
"tasks",
|
|
6
6
|
"update"
|
|
@@ -8,13 +8,20 @@ export const operation = {
|
|
|
8
8
|
"variant": {
|
|
9
9
|
"scope": "personal"
|
|
10
10
|
},
|
|
11
|
-
"
|
|
11
|
+
"personalSpace": true,
|
|
12
|
+
"summary": "The same, in your Personal space.",
|
|
12
13
|
"pathParams": [
|
|
13
14
|
"taskId"
|
|
14
15
|
],
|
|
15
16
|
"query": [],
|
|
16
17
|
"body": {
|
|
17
18
|
"fields": [
|
|
19
|
+
{
|
|
20
|
+
"name": "startBranch",
|
|
21
|
+
"flag": "start-branch",
|
|
22
|
+
"kind": "string",
|
|
23
|
+
"required": false
|
|
24
|
+
},
|
|
18
25
|
{
|
|
19
26
|
"name": "title",
|
|
20
27
|
"flag": "title",
|
|
@@ -22,8 +29,37 @@ export const operation = {
|
|
|
22
29
|
"required": false
|
|
23
30
|
},
|
|
24
31
|
{
|
|
25
|
-
"name": "
|
|
26
|
-
"flag": "
|
|
32
|
+
"name": "model",
|
|
33
|
+
"flag": "model",
|
|
34
|
+
"kind": "string",
|
|
35
|
+
"required": false,
|
|
36
|
+
"description": "A model, or kosuke-free for personal work. Workspace tasks never use Sensei free."
|
|
37
|
+
},
|
|
38
|
+
{
|
|
39
|
+
"name": "auto",
|
|
40
|
+
"flag": "auto",
|
|
41
|
+
"kind": "boolean",
|
|
42
|
+
"required": false,
|
|
43
|
+
"description": "True puts the session on Auto, from its next Turn. False takes it off; send it with model when choosing a Model. Absent leaves it as it is."
|
|
44
|
+
},
|
|
45
|
+
{
|
|
46
|
+
"name": "kosukeFree",
|
|
47
|
+
"flag": "kosuke-free",
|
|
48
|
+
"kind": "boolean",
|
|
49
|
+
"required": false,
|
|
50
|
+
"description": "true runs the session on Sensei free, on the serving source's model; false, or picking any other model, takes it off. Refused for a session no member is assigned to and for one the workspace pays for."
|
|
51
|
+
},
|
|
52
|
+
{
|
|
53
|
+
"name": "nextTurn",
|
|
54
|
+
"flag": "next-turn",
|
|
55
|
+
"kind": "json",
|
|
56
|
+
"required": false,
|
|
57
|
+
"description": "Active or Under review only: the Model, Auto, or {kosukeFree:true} in personal scope, the session's next Turn runs on, whether or not a Turn is running now. The next Turn applies it once and clears it. null, or the Model and Auto state the session already has, clears it. Send it on its own.",
|
|
58
|
+
"shape": "{model: string} | {auto: boolean} | {kosukeFree: boolean} | null"
|
|
59
|
+
},
|
|
60
|
+
{
|
|
61
|
+
"name": "ownerId",
|
|
62
|
+
"flag": "owner-id",
|
|
27
63
|
"kind": "string",
|
|
28
64
|
"required": false
|
|
29
65
|
},
|
|
@@ -40,6 +76,30 @@ export const operation = {
|
|
|
40
76
|
"none"
|
|
41
77
|
]
|
|
42
78
|
},
|
|
79
|
+
{
|
|
80
|
+
"name": "sandboxSize",
|
|
81
|
+
"flag": "sandbox-size",
|
|
82
|
+
"kind": "string",
|
|
83
|
+
"required": false,
|
|
84
|
+
"description": "The session's Sandbox size: small (2 CPU, 4 GB), medium (4 CPU, 8 GB), large (8 CPU, 16 GB) or xlarge (16 CPU, 32 GB). Absent boots the project's size. Fixed once the session starts.",
|
|
85
|
+
"choices": [
|
|
86
|
+
"small",
|
|
87
|
+
"medium",
|
|
88
|
+
"large",
|
|
89
|
+
"xlarge"
|
|
90
|
+
]
|
|
91
|
+
},
|
|
92
|
+
{
|
|
93
|
+
"name": "appStack",
|
|
94
|
+
"flag": "app-stack",
|
|
95
|
+
"kind": "string",
|
|
96
|
+
"required": false,
|
|
97
|
+
"description": "start (default) runs the project's services when the sandbox boots. skip boots setup and the agent only; a member or the session's agent starts the services later with `kosuke sessions app-stack start`. Fixed once the session starts.",
|
|
98
|
+
"choices": [
|
|
99
|
+
"start",
|
|
100
|
+
"skip"
|
|
101
|
+
]
|
|
102
|
+
},
|
|
43
103
|
{
|
|
44
104
|
"name": "status",
|
|
45
105
|
"flag": "status",
|
|
@@ -48,29 +108,42 @@ export const operation = {
|
|
|
48
108
|
"choices": [
|
|
49
109
|
"todo",
|
|
50
110
|
"in_progress",
|
|
51
|
-
"done"
|
|
111
|
+
"done",
|
|
112
|
+
"archived"
|
|
52
113
|
]
|
|
53
114
|
},
|
|
54
115
|
{
|
|
55
116
|
"name": "dueOn",
|
|
56
117
|
"flag": "due-on",
|
|
57
118
|
"kind": "string",
|
|
58
|
-
"required": false
|
|
59
|
-
"description": "A calendar day, YYYY-MM-DD; null clears it."
|
|
119
|
+
"required": false
|
|
60
120
|
},
|
|
61
121
|
{
|
|
62
122
|
"name": "threadId",
|
|
63
123
|
"flag": "thread-id",
|
|
64
124
|
"kind": "string",
|
|
125
|
+
"required": false
|
|
126
|
+
},
|
|
127
|
+
{
|
|
128
|
+
"name": "description",
|
|
129
|
+
"flag": "description",
|
|
130
|
+
"kind": "string",
|
|
65
131
|
"required": false,
|
|
66
|
-
"description": "
|
|
132
|
+
"description": "The whole new description, only when the goal changed: never because the task starts."
|
|
67
133
|
},
|
|
68
134
|
{
|
|
69
135
|
"name": "ifRevision",
|
|
70
136
|
"flag": "if-revision",
|
|
71
137
|
"kind": "string",
|
|
72
138
|
"required": false,
|
|
73
|
-
"description": "The
|
|
139
|
+
"description": "The descriptionRevision `tasks get` printed. Sensei and a Cron Run must pass it with description on workspace or repository tasks. For sessionless Personal tasks it is optional and also accepts updatedAt; a changed task answers 409 TASK_CONFLICT, so read it again and reconcile."
|
|
140
|
+
},
|
|
141
|
+
{
|
|
142
|
+
"name": "hintProjectId",
|
|
143
|
+
"flag": "hint-project",
|
|
144
|
+
"kind": "string",
|
|
145
|
+
"required": false,
|
|
146
|
+
"description": "Files a Todo task with no repository in this Collaboration project without starting it. Send it alone, with ifRevision at most. The same project again succeeds; another answers 409."
|
|
74
147
|
}
|
|
75
148
|
],
|
|
76
149
|
"required": true
|
|
@@ -78,5 +151,7 @@ export const operation = {
|
|
|
78
151
|
"multipart": null,
|
|
79
152
|
"attachments": false,
|
|
80
153
|
"anonymous": false,
|
|
81
|
-
"agents":
|
|
154
|
+
"agents": [
|
|
155
|
+
"senseiToken"
|
|
156
|
+
]
|
|
82
157
|
};
|
|
@@ -51,7 +51,8 @@ export const operation = {
|
|
|
51
51
|
"flag": "next-turn",
|
|
52
52
|
"kind": "json",
|
|
53
53
|
"required": false,
|
|
54
|
-
"description": "Active or Under review only: the Model, Auto, or {kosukeFree:true} in personal scope, the session's next Turn runs on, whether or not a Turn is running now. The next Turn applies it once and clears it. null, or the Model and Auto state the session already has, clears it. Send it on its own."
|
|
54
|
+
"description": "Active or Under review only: the Model, Auto, or {kosukeFree:true} in personal scope, the session's next Turn runs on, whether or not a Turn is running now. The next Turn applies it once and clears it. null, or the Model and Auto state the session already has, clears it. Send it on its own.",
|
|
55
|
+
"shape": "{model: string} | {auto: boolean} | {kosukeFree: boolean} | null"
|
|
55
56
|
},
|
|
56
57
|
{
|
|
57
58
|
"name": "ownerId",
|
|
@@ -132,7 +133,7 @@ export const operation = {
|
|
|
132
133
|
"flag": "if-revision",
|
|
133
134
|
"kind": "string",
|
|
134
135
|
"required": false,
|
|
135
|
-
"description": "The descriptionRevision `tasks get` printed. Sensei and a Cron Run must pass it with description; a changed task answers 409 TASK_CONFLICT, so read it again and reconcile."
|
|
136
|
+
"description": "The descriptionRevision `tasks get` printed. Sensei and a Cron Run must pass it with description on workspace or repository tasks. For sessionless Personal tasks it is optional and also accepts updatedAt; a changed task answers 409 TASK_CONFLICT, so read it again and reconcile."
|
|
136
137
|
},
|
|
137
138
|
{
|
|
138
139
|
"name": "hintProjectId",
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
export const operation = {
|
|
2
|
+
"method": "get",
|
|
3
|
+
"path": "/api/user/personal-space",
|
|
4
|
+
"command": [
|
|
5
|
+
"user",
|
|
6
|
+
"personal-space",
|
|
7
|
+
"get"
|
|
8
|
+
],
|
|
9
|
+
"summary": "Your Personal space id: the workspaceId that personal stands for in kosuke tasks. Made on first use; yours alone.",
|
|
10
|
+
"pathParams": [],
|
|
11
|
+
"query": [],
|
|
12
|
+
"body": null,
|
|
13
|
+
"multipart": null,
|
|
14
|
+
"attachments": false,
|
|
15
|
+
"anonymous": false,
|
|
16
|
+
"agents": [
|
|
17
|
+
"senseiToken"
|
|
18
|
+
]
|
|
19
|
+
};
|
package/dist/program.js
CHANGED
|
@@ -2,10 +2,12 @@ import { Command } from 'commander';
|
|
|
2
2
|
import { attachSkillMarkerCommands, runSkillMarkerCommand } from './commands/skill-runs.js';
|
|
3
3
|
import { attachAgentCommands } from './commands/agent.js';
|
|
4
4
|
import { attachAuthCommands } from './commands/auth.js';
|
|
5
|
+
import { attachCardSchemaCommand, attachHelpCommand } from './commands/help.js';
|
|
5
6
|
import { attachIntegrationsCommands } from './commands/integrations.js';
|
|
6
7
|
import { attachWatchCommand } from './commands/watch.js';
|
|
7
8
|
import { operations } from './generated/commands/index.js';
|
|
8
9
|
import { attachCommand } from './runtime/attach.js';
|
|
10
|
+
import { helpConfiguration, suggestOnError, takeLongHelp } from './runtime/help.js';
|
|
9
11
|
import { formsOf } from './runtime/variants.js';
|
|
10
12
|
import { agentTokenOf, isReachable } from './runtime/agent-tokens.js';
|
|
11
13
|
import { createRuntime, ExitSignal } from './runtime/runtime.js';
|
|
@@ -22,10 +24,11 @@ export function createProgram(options = {}) {
|
|
|
22
24
|
.version(version)
|
|
23
25
|
.option('--api-key <key>', 'API key; overrides KOSUKE_API_KEY and the stored one.')
|
|
24
26
|
.option('--api-url <url>', 'Platform URL; overrides KOSUKE_API_URL. Default https://app.kosuke.ai.')
|
|
27
|
+
.option('--pretty', 'Indented JSON; the default at a terminal, one line when piped.')
|
|
25
28
|
// commander's default is kept: a program option is read wherever it
|
|
26
29
|
// appears, so `kosuke projects list --api-key X` works as the README shows.
|
|
27
30
|
.showHelpAfterError('(add --help for usage)')
|
|
28
|
-
.configureHelp(
|
|
31
|
+
.configureHelp(helpConfiguration(options.longHelp === true));
|
|
29
32
|
// Built lazily, on the first use, so `--help` and `--version` never touch
|
|
30
33
|
// the credentials file.
|
|
31
34
|
let runtime = null;
|
|
@@ -49,6 +52,10 @@ export function createProgram(options = {}) {
|
|
|
49
52
|
if (forms.some(reaches))
|
|
50
53
|
attachCommand(program, forms, lazy, { reachable: reaches });
|
|
51
54
|
}
|
|
55
|
+
const cardsSet = operations.find((operation) => operation.command.join(' ') === 'sensei cards set');
|
|
56
|
+
if (cardsSet && reaches(cardsSet)) {
|
|
57
|
+
attachCardSchemaCommand(program, cardsSet, options.process?.stdout);
|
|
58
|
+
}
|
|
52
59
|
// Every agent token reads the digest's two lists as its member. Only a
|
|
53
60
|
// member's own key and their Sensei may mark Activity seen, so the others
|
|
54
61
|
// read it with `--peek`.
|
|
@@ -60,6 +67,9 @@ export function createProgram(options = {}) {
|
|
|
60
67
|
// The job stream admits a member's API key only; it closes 4401 on every narrower token.
|
|
61
68
|
if (narrowedTo === null)
|
|
62
69
|
attachWatchCommand(program, lazy, options.watch);
|
|
70
|
+
// Last, so the groups keep commander's own `help` and only the root's is replaced.
|
|
71
|
+
attachHelpCommand(program, options.process?.stdout);
|
|
72
|
+
suggestOnError(program);
|
|
63
73
|
return program;
|
|
64
74
|
}
|
|
65
75
|
/** Run to completion; an ExitSignal has already reported and set the exit code. */
|
|
@@ -67,7 +77,8 @@ export async function run(argv, options) {
|
|
|
67
77
|
try {
|
|
68
78
|
if (await runSkillMarkerCommand(argv.slice(2), options?.process))
|
|
69
79
|
return;
|
|
70
|
-
|
|
80
|
+
const { argv: args, long } = takeLongHelp(argv);
|
|
81
|
+
await createProgram({ ...options, longHelp: long || options?.longHelp }).parseAsync(args);
|
|
71
82
|
}
|
|
72
83
|
catch (error) {
|
|
73
84
|
if (error instanceof ExitSignal)
|
|
@@ -0,0 +1,58 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* The argument shapes the CLI adds to the generated commands, beside what the descriptors
|
|
3
|
+
* say: the global flags, the CLI-only flags of a few commands, and the session id forms.
|
|
4
|
+
* Data and pure rules only, importing nothing at run time, so the `prompt-commands` gate
|
|
5
|
+
* reads the same rules under Bun without this package's dependencies.
|
|
6
|
+
*/
|
|
7
|
+
/**
|
|
8
|
+
* Global flags beyond commander's own, and whether each takes a value.
|
|
9
|
+
* @internal Read by the prompt-commands lint gate.
|
|
10
|
+
*/
|
|
11
|
+
export const CLI_GLOBAL_FLAGS = new Map([
|
|
12
|
+
['--api-key', true],
|
|
13
|
+
['--api-url', true],
|
|
14
|
+
['--pretty', false],
|
|
15
|
+
['--long', false],
|
|
16
|
+
['--help', false],
|
|
17
|
+
['-h', false],
|
|
18
|
+
['--version', false],
|
|
19
|
+
]);
|
|
20
|
+
/** CLI-only flags of generated commands, by command words, each a boolean. */
|
|
21
|
+
export const CLI_ONLY_FLAGS = {
|
|
22
|
+
'sensei threads get': ['--tools'],
|
|
23
|
+
};
|
|
24
|
+
export const SESSION_ID_FLAG = 'session-id';
|
|
25
|
+
function fieldsOf(form) {
|
|
26
|
+
return [...form.query, ...(form.body?.fields ?? []), ...(form.multipart ?? [])];
|
|
27
|
+
}
|
|
28
|
+
/**
|
|
29
|
+
* The `--session-id` field of an operation with no path params: it also takes the id as an
|
|
30
|
+
* optional positional, `kosuke sensei sessions facts get <sessionId>`.
|
|
31
|
+
*/
|
|
32
|
+
export function sessionIdField(form) {
|
|
33
|
+
if (form.pathParams.length || form.variant)
|
|
34
|
+
return undefined;
|
|
35
|
+
return fieldsOf(form).find((field) => field.flag === SESSION_ID_FLAG);
|
|
36
|
+
}
|
|
37
|
+
/** Path params `projectId, sessionId, ...`: the project id may be left out and looked up. */
|
|
38
|
+
export function omitsProject(form) {
|
|
39
|
+
return !form.variant && form.pathParams[0] === 'projectId' && form.pathParams[1] === 'sessionId';
|
|
40
|
+
}
|
|
41
|
+
/** A command that may leave out the project also takes `--session-id`, unless a field has it. */
|
|
42
|
+
export function addsSessionIdFlag(form) {
|
|
43
|
+
return omitsProject(form) && !fieldsOf(form).some((field) => field.flag === SESSION_ID_FLAG);
|
|
44
|
+
}
|
|
45
|
+
/**
|
|
46
|
+
* How many positionals a call to a single-form command may give, for `sessionIdGiven`
|
|
47
|
+
* (whether `--session-id` is on the line).
|
|
48
|
+
* @internal Read by the prompt-commands lint gate.
|
|
49
|
+
*/
|
|
50
|
+
export function acceptedCounts(form, sessionIdGiven) {
|
|
51
|
+
const n = form.pathParams.length;
|
|
52
|
+
if (sessionIdField(form))
|
|
53
|
+
return sessionIdGiven ? [0] : [0, 1];
|
|
54
|
+
if (omitsProject(form)) {
|
|
55
|
+
return sessionIdGiven && addsSessionIdFlag(form) ? [n - 1, n - 2] : [n, n - 1];
|
|
56
|
+
}
|
|
57
|
+
return [n];
|
|
58
|
+
}
|