@kana-ai/edgar-contracts 0.1.4 → 0.1.6
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/config.schema.d.ts +25 -5
- package/dist/js/schemas/ts/card.d.ts +4 -0
- package/dist/js/schemas/ts/card.js +2 -0
- package/dist/js/schemas/ts/end.d.ts +15 -1
- package/dist/js/schemas/ts/end.js +11 -2
- package/dist/manifest.schema.d.ts +14 -1
- package/dist/rpc.schema.d.ts +35 -0
- package/package.json +1 -1
- package/schemas/json/config.schema.json +49 -5
- package/schemas/json/manifest.schema.json +7 -2
- package/schemas/json/rpc.schema.json +52 -0
- package/schemas/ts/card.ts +2 -0
- package/schemas/ts/end.ts +11 -2
package/dist/config.schema.d.ts
CHANGED
|
@@ -259,9 +259,21 @@ export type SecretSource =
|
|
|
259
259
|
command: string[];
|
|
260
260
|
};
|
|
261
261
|
/**
|
|
262
|
-
* The program and its arguments that the check runs, never a shell string
|
|
262
|
+
* The program and its arguments that the check runs, never a shell string; none for a check that builds `dockerfile`.
|
|
263
263
|
*/
|
|
264
264
|
export type CheckCommand = string[];
|
|
265
|
+
/**
|
|
266
|
+
* The folder of the checkout that the build of `dockerfile` reads; the checkout when unset.
|
|
267
|
+
*/
|
|
268
|
+
export type CheckBuildContext = string | null;
|
|
269
|
+
/**
|
|
270
|
+
* The path prefixes of the checkout that the check tests; its result lists each changed path under one of them, so a pull request can say which changed files the check covers.
|
|
271
|
+
*/
|
|
272
|
+
export type PathsTheCheckCovers = string[];
|
|
273
|
+
/**
|
|
274
|
+
* The Dockerfile in the service's checkout whose image the check builds, outside the sandbox, with no push, and removes after.
|
|
275
|
+
*/
|
|
276
|
+
export type CheckDockerfile = string | null;
|
|
265
277
|
/**
|
|
266
278
|
* The most seconds this check may take; the check default when unset.
|
|
267
279
|
*/
|
|
@@ -400,9 +412,14 @@ export type PublicWebhooks1 = boolean;
|
|
|
400
412
|
*/
|
|
401
413
|
export type PublicWebhookHost = string;
|
|
402
414
|
/**
|
|
403
|
-
* At most `limit` runs of this workflow at once for each value of `key` in the run's input; the next one waits.
|
|
415
|
+
* At most `limit` runs of this workflow at once for each value of `key` in the run's input; the next one waits. `false` turns off every limit, the built-in one too.
|
|
416
|
+
*/
|
|
417
|
+
export type RunsAtOncePerKey = WorkflowConcurrency | null;
|
|
418
|
+
/**
|
|
419
|
+
* This interface was referenced by `Config`'s JSON-Schema
|
|
420
|
+
* via the `definition` "WorkflowConcurrency".
|
|
404
421
|
*/
|
|
405
|
-
export type
|
|
422
|
+
export type WorkflowConcurrency = KeyedConcurrency | false;
|
|
406
423
|
/**
|
|
407
424
|
* A path into the run's input, `trigger.` then a field, or a list of them where the first with a value is the key.
|
|
408
425
|
*
|
|
@@ -826,13 +843,16 @@ export interface Service {
|
|
|
826
843
|
repo: Repository;
|
|
827
844
|
}
|
|
828
845
|
/**
|
|
829
|
-
* A check command as structured arguments, never a shell string.
|
|
846
|
+
* A check: a command as structured arguments, never a shell string, or the build of an image.
|
|
830
847
|
*
|
|
831
848
|
* This interface was referenced by `Config`'s JSON-Schema
|
|
832
849
|
* via the `definition` "Check".
|
|
833
850
|
*/
|
|
834
851
|
export interface Check {
|
|
835
|
-
cmd
|
|
852
|
+
cmd?: CheckCommand;
|
|
853
|
+
context?: CheckBuildContext;
|
|
854
|
+
covers?: PathsTheCheckCovers;
|
|
855
|
+
dockerfile?: CheckDockerfile;
|
|
836
856
|
timeout_seconds?: CheckTimeLimit;
|
|
837
857
|
}
|
|
838
858
|
/**
|
|
@@ -26,6 +26,8 @@ export declare const cardBlock: z.ZodObject<{
|
|
|
26
26
|
outside: "outside";
|
|
27
27
|
team: "team";
|
|
28
28
|
}>>;
|
|
29
|
+
requested_by: z.ZodExactOptional<z.ZodString>;
|
|
30
|
+
requested_by_id: z.ZodExactOptional<z.ZodString>;
|
|
29
31
|
}, z.core.$strict>;
|
|
30
32
|
/** The card a tool files; its output type is the contract's `CardSpec`. */
|
|
31
33
|
export declare const cardSpec: z.ZodObject<{
|
|
@@ -59,5 +61,7 @@ export declare const cardSpec: z.ZodObject<{
|
|
|
59
61
|
outside: "outside";
|
|
60
62
|
team: "team";
|
|
61
63
|
}>>;
|
|
64
|
+
requested_by: z.ZodExactOptional<z.ZodString>;
|
|
65
|
+
requested_by_id: z.ZodExactOptional<z.ZodString>;
|
|
62
66
|
}, z.core.$strict>;
|
|
63
67
|
}, z.core.$strict>;
|
|
@@ -23,6 +23,8 @@ export const cardBlock = z.strictObject({
|
|
|
23
23
|
})
|
|
24
24
|
.exactOptional(),
|
|
25
25
|
trust: z.enum(["team", "outside"]).exactOptional(),
|
|
26
|
+
requested_by: z.string().min(1).exactOptional(),
|
|
27
|
+
requested_by_id: z.string().min(1).exactOptional(),
|
|
26
28
|
});
|
|
27
29
|
/** The card a tool files; its output type is the contract's `CardSpec`. */
|
|
28
30
|
export const cardSpec = z.strictObject({
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { z } from "zod";
|
|
2
|
-
/** The card of a run, as its `run_created` payload and the `end` of its `run_outcome` name it. In `run_created`, `event` is the card event that started the run, such as `created` or `comment`, and `tracker` is the extension of the tracker that holds the card. */
|
|
2
|
+
/** The card of a run, as its `run_created` payload and the `end` of its `run_outcome` name it. In `run_created`, `event` is the card event that started the run, such as `created` or `comment`, and `tracker` is the extension of the tracker that holds the card. `requested_by` is who asked for the work, by name, and `requested_by_id` is that person's id in the service that opened the card for them, such as a Slack user id. In `run_created`, `ask` is what the card asks: the first two lines of its description that hold words, at most 280 characters. */
|
|
3
3
|
export declare const runCard: z.ZodObject<{
|
|
4
4
|
event: z.ZodOptional<z.ZodString>;
|
|
5
5
|
card: z.ZodOptional<z.ZodString>;
|
|
@@ -7,6 +7,9 @@ export declare const runCard: z.ZodObject<{
|
|
|
7
7
|
title: z.ZodOptional<z.ZodString>;
|
|
8
8
|
service: z.ZodOptional<z.ZodString>;
|
|
9
9
|
card_url: z.ZodOptional<z.ZodString>;
|
|
10
|
+
requested_by: z.ZodOptional<z.ZodString>;
|
|
11
|
+
requested_by_id: z.ZodOptional<z.ZodString>;
|
|
12
|
+
ask: z.ZodOptional<z.ZodString>;
|
|
10
13
|
}, z.core.$loose>;
|
|
11
14
|
export type RunCard = z.infer<typeof runCard>;
|
|
12
15
|
/** The part of a `run_outcome` payload a note at the end of a run reads. */
|
|
@@ -28,6 +31,9 @@ export declare const runEnded: z.ZodObject<{
|
|
|
28
31
|
title: z.ZodOptional<z.ZodString>;
|
|
29
32
|
service: z.ZodOptional<z.ZodString>;
|
|
30
33
|
card_url: z.ZodOptional<z.ZodString>;
|
|
34
|
+
requested_by: z.ZodOptional<z.ZodString>;
|
|
35
|
+
requested_by_id: z.ZodOptional<z.ZodString>;
|
|
36
|
+
ask: z.ZodOptional<z.ZodString>;
|
|
31
37
|
assignee: z.ZodOptional<z.ZodString>;
|
|
32
38
|
started: z.ZodNumber;
|
|
33
39
|
workflow: z.ZodOptional<z.ZodString>;
|
|
@@ -48,8 +54,16 @@ export declare const runEnded: z.ZodObject<{
|
|
|
48
54
|
summary: z.ZodOptional<z.ZodString>;
|
|
49
55
|
options: z.ZodDefault<z.ZodArray<z.ZodString>>;
|
|
50
56
|
question: z.ZodOptional<z.ZodString>;
|
|
57
|
+
who_can_act: z.ZodDefault<z.ZodArray<z.ZodRecord<z.ZodString, z.ZodString>>>;
|
|
51
58
|
risk: z.ZodOptional<z.ZodString>;
|
|
52
59
|
risk_reason: z.ZodOptional<z.ZodString>;
|
|
60
|
+
handed_to: z.ZodOptional<z.ZodString>;
|
|
61
|
+
paid_by: z.ZodOptional<z.ZodObject<{
|
|
62
|
+
name: z.ZodString;
|
|
63
|
+
credential: z.ZodString;
|
|
64
|
+
provider: z.ZodOptional<z.ZodString>;
|
|
65
|
+
}, z.core.$loose>>;
|
|
66
|
+
stopped_by: z.ZodOptional<z.ZodString>;
|
|
53
67
|
failed_stage: z.ZodOptional<z.ZodString>;
|
|
54
68
|
failure: z.ZodOptional<z.ZodString>;
|
|
55
69
|
}, z.core.$loose>>;
|
|
@@ -18,7 +18,7 @@ const totals = z.looseObject({
|
|
|
18
18
|
output_tokens: z.number(),
|
|
19
19
|
cost: z.number().optional(),
|
|
20
20
|
});
|
|
21
|
-
/** The card of a run, as its `run_created` payload and the `end` of its `run_outcome` name it. In `run_created`, `event` is the card event that started the run, such as `created` or `comment`, and `tracker` is the extension of the tracker that holds the card. */
|
|
21
|
+
/** The card of a run, as its `run_created` payload and the `end` of its `run_outcome` name it. In `run_created`, `event` is the card event that started the run, such as `created` or `comment`, and `tracker` is the extension of the tracker that holds the card. `requested_by` is who asked for the work, by name, and `requested_by_id` is that person's id in the service that opened the card for them, such as a Slack user id. In `run_created`, `ask` is what the card asks: the first two lines of its description that hold words, at most 280 characters. */
|
|
22
22
|
export const runCard = z.looseObject({
|
|
23
23
|
event: z.string().min(1).optional(),
|
|
24
24
|
card: z.string().min(1).optional(),
|
|
@@ -26,8 +26,11 @@ export const runCard = z.looseObject({
|
|
|
26
26
|
title: z.string().optional(),
|
|
27
27
|
service: z.string().min(1).optional(),
|
|
28
28
|
card_url: z.string().min(1).optional(),
|
|
29
|
+
requested_by: z.string().min(1).optional(),
|
|
30
|
+
requested_by_id: z.string().min(1).optional(),
|
|
31
|
+
ask: z.string().min(1).optional(),
|
|
29
32
|
});
|
|
30
|
-
/** The `end` of a `run_outcome` payload: the run's card, when the run began in Unix milliseconds, its workflow, each pull request that it or its sub-runs opened or worked on, what people decided on it (`reviewed`), the `decision`, `summary` and `options` of its newest proposal, the `question` of its newest stage output that asks one, and the stage and message of its newest attempt that failed for good. `risk` is how likely the review thinks it that the change is not what its developers want, such as `low`, `moderate` or `high`, and `risk_reason` says why. For a run that a schedule started, `failed_before` counts the runs of that schedule that failed in a row just before it, and `repeat` says that the run just before it failed with the same failure kind. */
|
|
33
|
+
/** The `end` of a `run_outcome` payload: the run's card, when the run began in Unix milliseconds, its workflow, each pull request that it or its sub-runs opened or worked on, what people decided on it (`reviewed`), the `decision`, `summary` and `options` of its newest proposal, the `question` of its newest stage output that asks one with the people who can act on it (`who_can_act`, each by an id in a service, such as `github`, an `email` or a `name`, with `why`), the person its newest hand-back gave the card to (`handed_to`), the person of `[people]` whose own key or subscription its newest model call on one ran on (`paid_by`, with the kind of credential and the provider), the person whose forced cancel stopped it (`stopped_by`, as the move recorded them, for display only), and the stage and message of its newest attempt that failed for good. `risk` is how likely the review thinks it that the change is not what its developers want, such as `low`, `moderate` or `high`, and `risk_reason` says why. For a run that a schedule started, `failed_before` counts the runs of that schedule that failed in a row just before it, and `repeat` says that the run just before it failed with the same failure kind. */
|
|
31
34
|
const runEnd = runCard.extend({
|
|
32
35
|
assignee: z.string().min(1).optional(),
|
|
33
36
|
started: z.number(),
|
|
@@ -40,8 +43,14 @@ const runEnd = runCard.extend({
|
|
|
40
43
|
summary: z.string().optional(),
|
|
41
44
|
options: z.array(z.string()).default([]),
|
|
42
45
|
question: z.string().optional(),
|
|
46
|
+
who_can_act: z.array(z.record(z.string(), z.string())).default([]),
|
|
43
47
|
risk: z.string().optional(),
|
|
44
48
|
risk_reason: z.string().optional(),
|
|
49
|
+
handed_to: z.string().min(1).optional(),
|
|
50
|
+
paid_by: z
|
|
51
|
+
.looseObject({ name: z.string(), credential: z.string(), provider: z.string().optional() })
|
|
52
|
+
.optional(),
|
|
53
|
+
stopped_by: z.string().min(1).optional(),
|
|
45
54
|
failed_stage: z.string().optional(),
|
|
46
55
|
failure: z.string().optional(),
|
|
47
56
|
});
|
|
@@ -17,7 +17,16 @@ export type SecretName = string;
|
|
|
17
17
|
* via the `definition` "Capability".
|
|
18
18
|
*/
|
|
19
19
|
export type Capability =
|
|
20
|
-
| (
|
|
20
|
+
| (
|
|
21
|
+
| "sandbox:read"
|
|
22
|
+
| "sandbox:write"
|
|
23
|
+
| "git:push"
|
|
24
|
+
| "tracker:read"
|
|
25
|
+
| "tracker:write"
|
|
26
|
+
| "runs:read"
|
|
27
|
+
| "complete"
|
|
28
|
+
| "environment:docker"
|
|
29
|
+
)
|
|
21
30
|
| string;
|
|
22
31
|
/**
|
|
23
32
|
* This interface was referenced by `Manifest`'s JSON-Schema
|
|
@@ -149,6 +158,10 @@ export interface Tracker {
|
|
|
149
158
|
];
|
|
150
159
|
secrets: SecretName[];
|
|
151
160
|
capabilities: Capability[];
|
|
161
|
+
/**
|
|
162
|
+
* Whether `list_cards` takes `updated_since`, so most sweeps ask only for the cards changed since the last listing.
|
|
163
|
+
*/
|
|
164
|
+
updated_since?: boolean;
|
|
152
165
|
}
|
|
153
166
|
/**
|
|
154
167
|
* An environment provider; the engine calls `environment.<name>.<step>` through `tool.call`.
|
package/dist/rpc.schema.d.ts
CHANGED
|
@@ -165,6 +165,17 @@ export type ServiceRequest =
|
|
|
165
165
|
by: string;
|
|
166
166
|
reason: string;
|
|
167
167
|
}
|
|
168
|
+
| {
|
|
169
|
+
kind: "runs.replay";
|
|
170
|
+
run: string;
|
|
171
|
+
by: string;
|
|
172
|
+
}
|
|
173
|
+
| {
|
|
174
|
+
kind: "runs.stop";
|
|
175
|
+
run: string;
|
|
176
|
+
by: string;
|
|
177
|
+
reason: string;
|
|
178
|
+
}
|
|
168
179
|
| ((
|
|
169
180
|
| {
|
|
170
181
|
run: unknown;
|
|
@@ -586,6 +597,14 @@ export interface CardBlock {
|
|
|
586
597
|
};
|
|
587
598
|
origin?: Origin;
|
|
588
599
|
trust?: Trust1;
|
|
600
|
+
/**
|
|
601
|
+
* Set by a service that opens the card for a person: their name as that service shows it, since the tracker sees EDGAR's account as the card's writer.
|
|
602
|
+
*/
|
|
603
|
+
requested_by?: string;
|
|
604
|
+
/**
|
|
605
|
+
* That person's id in the service of `origin`, such as a Slack user id.
|
|
606
|
+
*/
|
|
607
|
+
requested_by_id?: string;
|
|
589
608
|
}
|
|
590
609
|
/**
|
|
591
610
|
* Where a card came from: the extension, and its channel and thread there.
|
|
@@ -710,6 +729,18 @@ export interface Card {
|
|
|
710
729
|
* A stable id of the person who wrote the card, which only their own account can change, such as a login or an email: a person of `[people]` with this id in the tracker is on the team, whatever `trust` says.
|
|
711
730
|
*/
|
|
712
731
|
written_by_id?: string;
|
|
732
|
+
/**
|
|
733
|
+
* Who asked for the work, as the tracker names them: the person who last gave the card to EDGAR, else its writer; absent when that is EDGAR's own user or the tracker cannot say.
|
|
734
|
+
*/
|
|
735
|
+
requested_by?: string;
|
|
736
|
+
/**
|
|
737
|
+
* A stable id of the person in `requested_by`, as `taken_by_id` is of the holder.
|
|
738
|
+
*/
|
|
739
|
+
requested_by_id?: string;
|
|
740
|
+
/**
|
|
741
|
+
* The part of the tracker the card is on, such as a team, for a tracker that watches more than one: the first sweep after a start records the cards of a board with no open card stored, and starts runs only for those in intake. Absent: the tracker is one board.
|
|
742
|
+
*/
|
|
743
|
+
board?: string;
|
|
713
744
|
}
|
|
714
745
|
/**
|
|
715
746
|
* This interface was referenced by `Rpc`'s JSON-Schema
|
|
@@ -753,6 +784,10 @@ export interface Person {
|
|
|
753
784
|
export interface ListCardsInput {
|
|
754
785
|
columns: string[];
|
|
755
786
|
cursor: string | null;
|
|
787
|
+
/**
|
|
788
|
+
* Only the cards changed at or after this RFC 3339 time; the engine sends it only to a tracker whose manifest sets `tracker.updated_since`, and leaves it out for a full listing.
|
|
789
|
+
*/
|
|
790
|
+
updated_since?: string;
|
|
756
791
|
}
|
|
757
792
|
/**
|
|
758
793
|
* This interface was referenced by `Rpc`'s JSON-Schema
|
package/package.json
CHANGED
|
@@ -129,10 +129,11 @@
|
|
|
129
129
|
},
|
|
130
130
|
"Check": {
|
|
131
131
|
"additionalProperties": false,
|
|
132
|
-
"description": "A check command as structured arguments, never a shell string.",
|
|
132
|
+
"description": "A check: a command as structured arguments, never a shell string, or the build of an image.",
|
|
133
133
|
"properties": {
|
|
134
134
|
"cmd": {
|
|
135
|
-
"
|
|
135
|
+
"default": [],
|
|
136
|
+
"description": "The program and its arguments that the check runs, never a shell string; none for a check that builds `dockerfile`.",
|
|
136
137
|
"items": {
|
|
137
138
|
"type": "string"
|
|
138
139
|
},
|
|
@@ -144,6 +145,40 @@
|
|
|
144
145
|
"group": "project"
|
|
145
146
|
}
|
|
146
147
|
},
|
|
148
|
+
"context": {
|
|
149
|
+
"description": "The folder of the checkout that the build of `dockerfile` reads; the checkout when unset.",
|
|
150
|
+
"title": "Check build context",
|
|
151
|
+
"type": ["string", "null"],
|
|
152
|
+
"x-edgar": {
|
|
153
|
+
"apply": "restart",
|
|
154
|
+
"console": "view",
|
|
155
|
+
"group": "project"
|
|
156
|
+
}
|
|
157
|
+
},
|
|
158
|
+
"covers": {
|
|
159
|
+
"default": [],
|
|
160
|
+
"description": "The path prefixes of the checkout that the check tests; its result lists each changed path under one of them, so a pull request can say which changed files the check covers.",
|
|
161
|
+
"items": {
|
|
162
|
+
"type": "string"
|
|
163
|
+
},
|
|
164
|
+
"title": "Paths the check covers",
|
|
165
|
+
"type": "array",
|
|
166
|
+
"x-edgar": {
|
|
167
|
+
"apply": "restart",
|
|
168
|
+
"console": "edit",
|
|
169
|
+
"group": "project"
|
|
170
|
+
}
|
|
171
|
+
},
|
|
172
|
+
"dockerfile": {
|
|
173
|
+
"description": "The Dockerfile in the service's checkout whose image the check builds, outside the sandbox, with no push, and removes after.",
|
|
174
|
+
"title": "Check Dockerfile",
|
|
175
|
+
"type": ["string", "null"],
|
|
176
|
+
"x-edgar": {
|
|
177
|
+
"apply": "restart",
|
|
178
|
+
"console": "view",
|
|
179
|
+
"group": "project"
|
|
180
|
+
}
|
|
181
|
+
},
|
|
147
182
|
"timeout_seconds": {
|
|
148
183
|
"description": "The most seconds this check may take; the check default when unset.",
|
|
149
184
|
"format": "uint64",
|
|
@@ -157,7 +192,6 @@
|
|
|
157
192
|
}
|
|
158
193
|
}
|
|
159
194
|
},
|
|
160
|
-
"required": ["cmd"],
|
|
161
195
|
"type": "object"
|
|
162
196
|
},
|
|
163
197
|
"Concurrency": {
|
|
@@ -1813,6 +1847,16 @@
|
|
|
1813
1847
|
"description": "`HH:MM-HH:MM`: the minutes of a day from `start` up to `end`, past midnight when `end` comes first.",
|
|
1814
1848
|
"type": "string"
|
|
1815
1849
|
},
|
|
1850
|
+
"WorkflowConcurrency": {
|
|
1851
|
+
"anyOf": [
|
|
1852
|
+
{
|
|
1853
|
+
"$ref": "#/$defs/KeyedConcurrency"
|
|
1854
|
+
},
|
|
1855
|
+
{
|
|
1856
|
+
"const": false
|
|
1857
|
+
}
|
|
1858
|
+
]
|
|
1859
|
+
},
|
|
1816
1860
|
"WorkflowSettings": {
|
|
1817
1861
|
"additionalProperties": false,
|
|
1818
1862
|
"description": "`[workflows.<name>]`: the settings of one workflow that its file does not hold.",
|
|
@@ -1820,13 +1864,13 @@
|
|
|
1820
1864
|
"concurrency": {
|
|
1821
1865
|
"anyOf": [
|
|
1822
1866
|
{
|
|
1823
|
-
"$ref": "#/$defs/
|
|
1867
|
+
"$ref": "#/$defs/WorkflowConcurrency"
|
|
1824
1868
|
},
|
|
1825
1869
|
{
|
|
1826
1870
|
"type": "null"
|
|
1827
1871
|
}
|
|
1828
1872
|
],
|
|
1829
|
-
"description": "At most `limit` runs of this workflow at once for each value of `key` in the run's input; the next one waits.",
|
|
1873
|
+
"description": "At most `limit` runs of this workflow at once for each value of `key` in the run's input; the next one waits. `false` turns off every limit, the built-in one too.",
|
|
1830
1874
|
"title": "Runs at once per key",
|
|
1831
1875
|
"x-edgar": {
|
|
1832
1876
|
"apply": "live",
|
|
@@ -60,7 +60,8 @@
|
|
|
60
60
|
"tracker:read",
|
|
61
61
|
"tracker:write",
|
|
62
62
|
"runs:read",
|
|
63
|
-
"complete"
|
|
63
|
+
"complete",
|
|
64
|
+
"environment:docker"
|
|
64
65
|
]
|
|
65
66
|
},
|
|
66
67
|
{ "type": "string", "pattern": "^network:(\\*\\.)?[a-z0-9]([a-z0-9.-]*[a-z0-9])?$" }
|
|
@@ -185,7 +186,11 @@
|
|
|
185
186
|
"minItems": 11
|
|
186
187
|
},
|
|
187
188
|
"secrets": { "type": "array", "items": { "$ref": "#/$defs/SecretName" } },
|
|
188
|
-
"capabilities": { "type": "array", "items": { "$ref": "#/$defs/Capability" } }
|
|
189
|
+
"capabilities": { "type": "array", "items": { "$ref": "#/$defs/Capability" } },
|
|
190
|
+
"updated_since": {
|
|
191
|
+
"type": "boolean",
|
|
192
|
+
"description": "Whether `list_cards` takes `updated_since`, so most sweeps ask only for the cards changed since the last listing."
|
|
193
|
+
}
|
|
189
194
|
},
|
|
190
195
|
"required": ["methods", "secrets", "capabilities"],
|
|
191
196
|
"additionalProperties": false
|
|
@@ -584,6 +584,29 @@
|
|
|
584
584
|
"required": ["kind", "origin", "by", "reason"],
|
|
585
585
|
"additionalProperties": false
|
|
586
586
|
},
|
|
587
|
+
{
|
|
588
|
+
"description": "Starts the finished run `run` again, as a person's replay, for the person `by`.",
|
|
589
|
+
"type": "object",
|
|
590
|
+
"properties": {
|
|
591
|
+
"kind": { "const": "runs.replay" },
|
|
592
|
+
"run": { "type": "string", "minLength": 1 },
|
|
593
|
+
"by": { "type": "string", "minLength": 1 }
|
|
594
|
+
},
|
|
595
|
+
"required": ["kind", "run", "by"],
|
|
596
|
+
"additionalProperties": false
|
|
597
|
+
},
|
|
598
|
+
{
|
|
599
|
+
"description": "Cancels the unfinished run `run` for the person `by`; a finished run is refused.",
|
|
600
|
+
"type": "object",
|
|
601
|
+
"properties": {
|
|
602
|
+
"kind": { "const": "runs.stop" },
|
|
603
|
+
"run": { "type": "string", "minLength": 1 },
|
|
604
|
+
"by": { "type": "string", "minLength": 1 },
|
|
605
|
+
"reason": { "type": "string", "minLength": 1 }
|
|
606
|
+
},
|
|
607
|
+
"required": ["kind", "run", "by", "reason"],
|
|
608
|
+
"additionalProperties": false
|
|
609
|
+
},
|
|
587
610
|
{
|
|
588
611
|
"description": "What the person `by` wrote in the service's own place, such as a thread, about the card of `run`, or about `card` when the place names a card and has no run. The engine writes it on the card, and the next read of the card's comments takes it as that person's comment, of `trust`: whether they are on the team, as the service knows it, and `outside` when it does not say. With `origin`, the run that the comment starts names that place as `relayed`.",
|
|
589
612
|
"type": "object",
|
|
@@ -850,6 +873,16 @@
|
|
|
850
873
|
"trust": {
|
|
851
874
|
"description": "Set by a service that opens the card for a person: `outside` when that person is outside the team, which makes the card's trust `outside` whoever the tracker says wrote it.",
|
|
852
875
|
"$ref": "#/$defs/Trust"
|
|
876
|
+
},
|
|
877
|
+
"requested_by": {
|
|
878
|
+
"description": "Set by a service that opens the card for a person: their name as that service shows it, since the tracker sees EDGAR's account as the card's writer.",
|
|
879
|
+
"type": "string",
|
|
880
|
+
"minLength": 1
|
|
881
|
+
},
|
|
882
|
+
"requested_by_id": {
|
|
883
|
+
"description": "That person's id in the service of `origin`, such as a Slack user id.",
|
|
884
|
+
"type": "string",
|
|
885
|
+
"minLength": 1
|
|
853
886
|
}
|
|
854
887
|
},
|
|
855
888
|
"required": ["kind"],
|
|
@@ -926,6 +959,21 @@
|
|
|
926
959
|
"description": "A stable id of the person who wrote the card, which only their own account can change, such as a login or an email: a person of `[people]` with this id in the tracker is on the team, whatever `trust` says.",
|
|
927
960
|
"type": "string",
|
|
928
961
|
"minLength": 1
|
|
962
|
+
},
|
|
963
|
+
"requested_by": {
|
|
964
|
+
"description": "Who asked for the work, as the tracker names them: the person who last gave the card to EDGAR, else its writer; absent when that is EDGAR's own user or the tracker cannot say.",
|
|
965
|
+
"type": "string",
|
|
966
|
+
"minLength": 1
|
|
967
|
+
},
|
|
968
|
+
"requested_by_id": {
|
|
969
|
+
"description": "A stable id of the person in `requested_by`, as `taken_by_id` is of the holder.",
|
|
970
|
+
"type": "string",
|
|
971
|
+
"minLength": 1
|
|
972
|
+
},
|
|
973
|
+
"board": {
|
|
974
|
+
"description": "The part of the tracker the card is on, such as a team, for a tracker that watches more than one: the first sweep after a start records the cards of a board with no open card stored, and starts runs only for those in intake. Absent: the tracker is one board.",
|
|
975
|
+
"type": "string",
|
|
976
|
+
"minLength": 1
|
|
929
977
|
}
|
|
930
978
|
},
|
|
931
979
|
"required": ["id", "title", "description", "column", "labels", "url", "block"],
|
|
@@ -1053,6 +1101,10 @@
|
|
|
1053
1101
|
},
|
|
1054
1102
|
"cursor": {
|
|
1055
1103
|
"type": ["string", "null"]
|
|
1104
|
+
},
|
|
1105
|
+
"updated_since": {
|
|
1106
|
+
"type": "string",
|
|
1107
|
+
"description": "Only the cards changed at or after this RFC 3339 time; the engine sends it only to a tracker whose manifest sets `tracker.updated_since`, and leaves it out for a full listing."
|
|
1056
1108
|
}
|
|
1057
1109
|
},
|
|
1058
1110
|
"required": ["columns", "cursor"],
|
package/schemas/ts/card.ts
CHANGED
|
@@ -25,6 +25,8 @@ export const cardBlock = z.strictObject({
|
|
|
25
25
|
})
|
|
26
26
|
.exactOptional(),
|
|
27
27
|
trust: z.enum(["team", "outside"]).exactOptional(),
|
|
28
|
+
requested_by: z.string().min(1).exactOptional(),
|
|
29
|
+
requested_by_id: z.string().min(1).exactOptional(),
|
|
28
30
|
}) satisfies z.ZodType<CardBlock>;
|
|
29
31
|
|
|
30
32
|
/** The card a tool files; its output type is the contract's `CardSpec`. */
|
package/schemas/ts/end.ts
CHANGED
|
@@ -22,7 +22,7 @@ const totals = z.looseObject({
|
|
|
22
22
|
cost: z.number().optional(),
|
|
23
23
|
});
|
|
24
24
|
|
|
25
|
-
/** The card of a run, as its `run_created` payload and the `end` of its `run_outcome` name it. In `run_created`, `event` is the card event that started the run, such as `created` or `comment`, and `tracker` is the extension of the tracker that holds the card. */
|
|
25
|
+
/** The card of a run, as its `run_created` payload and the `end` of its `run_outcome` name it. In `run_created`, `event` is the card event that started the run, such as `created` or `comment`, and `tracker` is the extension of the tracker that holds the card. `requested_by` is who asked for the work, by name, and `requested_by_id` is that person's id in the service that opened the card for them, such as a Slack user id. In `run_created`, `ask` is what the card asks: the first two lines of its description that hold words, at most 280 characters. */
|
|
26
26
|
export const runCard = z.looseObject({
|
|
27
27
|
event: z.string().min(1).optional(),
|
|
28
28
|
card: z.string().min(1).optional(),
|
|
@@ -30,11 +30,14 @@ export const runCard = z.looseObject({
|
|
|
30
30
|
title: z.string().optional(),
|
|
31
31
|
service: z.string().min(1).optional(),
|
|
32
32
|
card_url: z.string().min(1).optional(),
|
|
33
|
+
requested_by: z.string().min(1).optional(),
|
|
34
|
+
requested_by_id: z.string().min(1).optional(),
|
|
35
|
+
ask: z.string().min(1).optional(),
|
|
33
36
|
});
|
|
34
37
|
|
|
35
38
|
export type RunCard = z.infer<typeof runCard>;
|
|
36
39
|
|
|
37
|
-
/** The `end` of a `run_outcome` payload: the run's card, when the run began in Unix milliseconds, its workflow, each pull request that it or its sub-runs opened or worked on, what people decided on it (`reviewed`), the `decision`, `summary` and `options` of its newest proposal, the `question` of its newest stage output that asks one, and the stage and message of its newest attempt that failed for good. `risk` is how likely the review thinks it that the change is not what its developers want, such as `low`, `moderate` or `high`, and `risk_reason` says why. For a run that a schedule started, `failed_before` counts the runs of that schedule that failed in a row just before it, and `repeat` says that the run just before it failed with the same failure kind. */
|
|
40
|
+
/** The `end` of a `run_outcome` payload: the run's card, when the run began in Unix milliseconds, its workflow, each pull request that it or its sub-runs opened or worked on, what people decided on it (`reviewed`), the `decision`, `summary` and `options` of its newest proposal, the `question` of its newest stage output that asks one with the people who can act on it (`who_can_act`, each by an id in a service, such as `github`, an `email` or a `name`, with `why`), the person its newest hand-back gave the card to (`handed_to`), the person of `[people]` whose own key or subscription its newest model call on one ran on (`paid_by`, with the kind of credential and the provider), the person whose forced cancel stopped it (`stopped_by`, as the move recorded them, for display only), and the stage and message of its newest attempt that failed for good. `risk` is how likely the review thinks it that the change is not what its developers want, such as `low`, `moderate` or `high`, and `risk_reason` says why. For a run that a schedule started, `failed_before` counts the runs of that schedule that failed in a row just before it, and `repeat` says that the run just before it failed with the same failure kind. */
|
|
38
41
|
const runEnd = runCard.extend({
|
|
39
42
|
assignee: z.string().min(1).optional(),
|
|
40
43
|
started: z.number(),
|
|
@@ -47,8 +50,14 @@ const runEnd = runCard.extend({
|
|
|
47
50
|
summary: z.string().optional(),
|
|
48
51
|
options: z.array(z.string()).default([]),
|
|
49
52
|
question: z.string().optional(),
|
|
53
|
+
who_can_act: z.array(z.record(z.string(), z.string())).default([]),
|
|
50
54
|
risk: z.string().optional(),
|
|
51
55
|
risk_reason: z.string().optional(),
|
|
56
|
+
handed_to: z.string().min(1).optional(),
|
|
57
|
+
paid_by: z
|
|
58
|
+
.looseObject({ name: z.string(), credential: z.string(), provider: z.string().optional() })
|
|
59
|
+
.optional(),
|
|
60
|
+
stopped_by: z.string().min(1).optional(),
|
|
52
61
|
failed_stage: z.string().optional(),
|
|
53
62
|
failure: z.string().optional(),
|
|
54
63
|
});
|