@usine/core 0.2.0 → 0.3.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/README.md CHANGED
@@ -33,3 +33,7 @@ Everything is 0.x: APIs change without notice while the engine grows. `effect` i
33
33
  Import `CycleLimit`, `CycleGeneration`, `CycleCount`, `LoopCycleCount`, and `CycleBudgetAsk` from `@usine/core/cycle-budget`. An Item-level Ask records the exhausted Loop, its limit, and participating Loops’ admitted and completed Runs; it can exist before another Run is opened.
34
34
 
35
35
  `DefectFailure` records a programmer defect captured at a boundary that needs a serializable Attempt outcome. It retains the original cause and never qualifies for automatic retry.
36
+
37
+ `SessionStarted.harnessSession` optionally records a `HarnessSession`: the harness-native `HarnessSessionId` and worker working directory (`cwd`). Missing metadata in older transcripts decodes to `Option.none()`; usine's session identity remains separate.
38
+
39
+ Attempt channel protocol v6 adds saved harness session metadata. Upgrade the orchestrator and run host together; worker preflight rejects mismatched protocol versions.
@@ -3,6 +3,9 @@ import { BrainSpec } from "./brain.ts";
3
3
  /** Identity usine assigns to a parent or child session within an Attempt. */
4
4
  export declare const AgentSessionId: Schema.brand<Schema.NonEmptyString, "AgentSessionId">;
5
5
  export type AgentSessionId = typeof AgentSessionId.Type;
6
+ /** A provider-reported count of input, output, and cached tokens. */
7
+ export declare const TokenCount: Schema.brand<Schema.Int, "TokenCount">;
8
+ export type TokenCount = typeof TokenCount.Type;
6
9
  /** Maximum child sessions one Attempt may spawn over its lifetime, including sequential spawns. */
7
10
  export declare const ChildSessionBudget: Schema.brand<Schema.Int, "ChildSessionBudget">;
8
11
  export type ChildSessionBudget = typeof ChildSessionBudget.Type;
@@ -29,8 +32,20 @@ export declare class ChildSession extends ChildSession_base {
29
32
  /** A participant in an Attempt, with its role, Agent, and effective brain recorded. */
30
33
  export declare const AgentSession: Schema.Union<readonly [typeof ParentSession, typeof ChildSession]>;
31
34
  export type AgentSession = typeof AgentSession.Type;
35
+ /** The identity assigned by a harness to its saved conversation, distinct from usine's session id. */
36
+ export declare const HarnessSessionId: Schema.brand<Schema.NonEmptyString, "HarnessSessionId">;
37
+ export type HarnessSessionId = typeof HarnessSessionId.Type;
38
+ declare const HarnessSession_base: Schema.Class<HarnessSession, Schema.Struct<{
39
+ readonly id: Schema.brand<Schema.NonEmptyString, "HarnessSessionId">;
40
+ readonly cwd: Schema.NonEmptyString;
41
+ }>, {}>;
42
+ /** A saved harness conversation and the worker checkout from which it can be resumed. */
43
+ export declare class HarnessSession extends HarnessSession_base {
44
+ }
32
45
  declare const SessionStarted_base: Schema.Class<SessionStarted, Schema.TaggedStruct<"SessionStarted", {
33
46
  readonly session: Schema.Union<readonly [typeof ParentSession, typeof ChildSession]>;
47
+ /** Absent for older transcripts and harnesses without a saved conversation. */
48
+ readonly harnessSession: Schema.withConstructorDefault<Schema.OptionFromOptionalKey<typeof HarnessSession>>;
34
49
  }>, {}>;
35
50
  /** Records the session identity and brain actually selected at launch. */
36
51
  export declare class SessionStarted extends SessionStarted_base {
@@ -67,6 +82,25 @@ declare const SessionFinished_base: Schema.Class<SessionFinished, Schema.TaggedS
67
82
  /** Marks the end of a session's activity in the transcript; the Attempt's outcome is recorded separately. */
68
83
  export declare class SessionFinished extends SessionFinished_base {
69
84
  }
85
+ declare const SessionIdle_base: Schema.Class<SessionIdle, Schema.TaggedStruct<"SessionIdle", {
86
+ readonly session: Schema.Union<readonly [typeof ParentSession, typeof ChildSession]>;
87
+ }>, {}>;
88
+ /** A supervised session finished a turn and remains available for further operator messages. */
89
+ export declare class SessionIdle extends SessionIdle_base {
90
+ }
91
+ declare const SessionResumed_base: Schema.Class<SessionResumed, Schema.TaggedStruct<"SessionResumed", {
92
+ readonly session: Schema.Union<readonly [typeof ParentSession, typeof ChildSession]>;
93
+ }>, {}>;
94
+ /** A live session is processing another user turn in the same conversation. */
95
+ export declare class SessionResumed extends SessionResumed_base {
96
+ }
97
+ declare const SessionTokensUpdated_base: Schema.Class<SessionTokensUpdated, Schema.TaggedStruct<"SessionTokensUpdated", {
98
+ readonly session: Schema.Union<readonly [typeof ParentSession, typeof ChildSession]>;
99
+ readonly totalTokens: Schema.brand<Schema.Int, "TokenCount">;
100
+ }>, {}>;
101
+ /** Cumulative tokens consumed by this session, including its later operator turns. */
102
+ export declare class SessionTokensUpdated extends SessionTokensUpdated_base {
103
+ }
70
104
  /** The billing source whose meter produced a usage or rate-limit observation. */
71
105
  export declare const BillingPool: Schema.Literals<readonly ["apiKeys", "claudePlan", "chatgptPlan"]>;
72
106
  export type BillingPool = typeof BillingPool.Type;
@@ -99,7 +133,7 @@ declare const PoolRateLimitsUpdated_base: Schema.Class<PoolRateLimitsUpdated, Sc
99
133
  export declare class PoolRateLimitsUpdated extends PoolRateLimitsUpdated_base {
100
134
  }
101
135
  /** Session activity and billing observations recorded in an Attempt's transcript. */
102
- export declare const AgentSessionEvent: Schema.Union<readonly [typeof SessionStarted, typeof TextOutput, typeof ToolStarted, typeof ToolFinished, typeof PoolRateLimitsUpdated, typeof SessionFinished]>;
136
+ export declare const AgentSessionEvent: Schema.Union<readonly [typeof SessionStarted, typeof TextOutput, typeof ToolStarted, typeof ToolFinished, typeof PoolRateLimitsUpdated, typeof SessionFinished, typeof SessionIdle, typeof SessionResumed, typeof SessionTokensUpdated]>;
103
137
  export type AgentSessionEvent = typeof AgentSessionEvent.Type;
104
138
  export {};
105
139
  //# sourceMappingURL=session.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"session.d.ts","sourceRoot":"","sources":["../../src/agent/session.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,MAAM,EAAE,MAAM,QAAQ,CAAC;AAEhC,OAAO,EAAE,SAAS,EAAE,MAAM,YAAY,CAAC;AAEvC,6EAA6E;AAC7E,eAAO,MAAM,cAAc,uDAA6D,CAAC;AACzF,MAAM,MAAM,cAAc,GAAG,OAAO,cAAc,CAAC,IAAI,CAAC;AAIxD,mGAAmG;AACnG,eAAO,MAAM,kBAAkB,gDAAuD,CAAC;AACvF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gBAQhC;CAAG;;;;;;;;AAEJ,0FAA0F;AAC1F,qBAAa,YAAa,SAAQ,iBASjC;CAAG;;;;AAEJ,6GAA6G;AAC7G,qBAAa,eAAgB,SAAQ,oBAGpC;CAAG;;;;AAEJ,gGAAgG;AAChG,qBAAa,WAAY,SAAQ,gBAGhC;CAAG;;;;AAEJ,+EAA+E;AAC/E,qBAAa,cAAe,SAAQ,mBAGnC;CAAG;;;;;AAEJ,sFAAsF;AACtF,qBAAa,oBAAqB,SAAQ,yBAEmC;CAAG;AAEhF,iFAAiF;AACjF,eAAO,MAAM,WAAW,oEAAqE,CAAC;AAC9F,MAAM,MAAM,WAAW,GAAG,OAAO,WAAW,CAAC,IAAI,CAAC;;IAIhD,0FAA0F;;IAE1F,yEAAyE;;IAEzE,oEAAoE;;;AANtE,gEAAgE;AAChE,qBAAa,eAAgB,SAAQ,oBAOnC;CAAG;;;;;;;AAEL,6FAA6F;AAC7F,qBAAa,kBAAmB,SAAQ,uBAOtC;CAAG;;;;;;AAEL,8EAA8E;AAC9E,qBAAa,qBAAsB,SAAQ,0BAMzC;CAAG;AAEL,qFAAqF;AACrF,eAAO,MAAM,iBAAiB,0OAU5B,CAAC;AACH,MAAM,MAAM,iBAAiB,GAAG,OAAO,iBAAiB,CAAC,IAAI,CAAC"}
@@ -1,8 +1,10 @@
1
- import { Schema } from "effect";
1
+ import { Effect, Option, Schema } from "effect";
2
2
  import { AgentName } from "./agent.js";
3
3
  import { BrainSpec } from "./brain.js";
4
4
  /** Identity usine assigns to a parent or child session within an Attempt. */
5
5
  export const AgentSessionId = Schema.NonEmptyString.pipe(Schema.brand("AgentSessionId"));
6
+ /** A provider-reported count of input, output, and cached tokens. */
7
+ export const TokenCount = Schema.Int.check(Schema.isGreaterThanOrEqualTo(0)).pipe(Schema.brand("TokenCount"));
6
8
  const PositiveInt = Schema.Int.check(Schema.isGreaterThanOrEqualTo(1));
7
9
  /** Maximum child sessions one Attempt may spawn over its lifetime, including sequential spawns. */
8
10
  export const ChildSessionBudget = PositiveInt.pipe(Schema.brand("ChildSessionBudget"));
@@ -25,8 +27,20 @@ export class ChildSession extends Schema.TaggedClass("Agent/ChildSession")("Chil
25
27
  }
26
28
  /** A participant in an Attempt, with its role, Agent, and effective brain recorded. */
27
29
  export const AgentSession = Schema.Union([ParentSession, ChildSession]);
30
+ /** The identity assigned by a harness to its saved conversation, distinct from usine's session id. */
31
+ export const HarnessSessionId = Schema.NonEmptyString.pipe(Schema.brand("HarnessSessionId"));
32
+ /** A saved harness conversation and the worker checkout from which it can be resumed. */
33
+ export class HarnessSession extends Schema.Class("Agent/HarnessSession")({
34
+ id: HarnessSessionId,
35
+ cwd: Schema.NonEmptyString,
36
+ }) {
37
+ }
28
38
  /** Records the session identity and brain actually selected at launch. */
29
- export class SessionStarted extends Schema.TaggedClass("Agent/SessionStarted")("SessionStarted", { session: AgentSession }) {
39
+ export class SessionStarted extends Schema.TaggedClass("Agent/SessionStarted")("SessionStarted", {
40
+ session: AgentSession,
41
+ /** Absent for older transcripts and harnesses without a saved conversation. */
42
+ harnessSession: Schema.OptionFromOptionalKey(HarnessSession).pipe(Schema.withConstructorDefault(Effect.succeed(Option.none()))),
43
+ }) {
30
44
  }
31
45
  /** Completed assistant text emitted during the session, which may precede its final result. */
32
46
  export class TextOutput extends Schema.TaggedClass("Agent/TextOutput")("TextOutput", {
@@ -54,6 +68,15 @@ export class ToolFinished extends Schema.TaggedClass("Agent/ToolFinished")("Tool
54
68
  /** Marks the end of a session's activity in the transcript; the Attempt's outcome is recorded separately. */
55
69
  export class SessionFinished extends Schema.TaggedClass("Agent/SessionFinished")("SessionFinished", { session: AgentSession }) {
56
70
  }
71
+ /** A supervised session finished a turn and remains available for further operator messages. */
72
+ export class SessionIdle extends Schema.TaggedClass("Agent/SessionIdle")("SessionIdle", { session: AgentSession }) {
73
+ }
74
+ /** A live session is processing another user turn in the same conversation. */
75
+ export class SessionResumed extends Schema.TaggedClass("Agent/SessionResumed")("SessionResumed", { session: AgentSession }) {
76
+ }
77
+ /** Cumulative tokens consumed by this session, including its later operator turns. */
78
+ export class SessionTokensUpdated extends Schema.TaggedClass("Agent/SessionTokensUpdated")("SessionTokensUpdated", { session: AgentSession, totalTokens: TokenCount }) {
79
+ }
57
80
  /** The billing source whose meter produced a usage or rate-limit observation. */
58
81
  export const BillingPool = Schema.Literals(["apiKeys", "claudePlan", "chatgptPlan"]);
59
82
  /** A billing pool's observed usage for one allowance window. */
@@ -89,5 +112,8 @@ export const AgentSessionEvent = Schema.Union([
89
112
  ToolFinished,
90
113
  PoolRateLimitsUpdated,
91
114
  SessionFinished,
115
+ SessionIdle,
116
+ SessionResumed,
117
+ SessionTokensUpdated,
92
118
  ]);
93
119
  //# sourceMappingURL=session.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"session.js","sourceRoot":"","sources":["../../src/agent/session.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,MAAM,EAAE,MAAM,QAAQ,CAAC;AAChC,OAAO,EAAE,SAAS,EAAE,MAAM,YAAY,CAAC;AACvC,OAAO,EAAE,SAAS,EAAE,MAAM,YAAY,CAAC;AAEvC,6EAA6E;AAC7E,MAAM,CAAC,MAAM,cAAc,GAAG,MAAM,CAAC,cAAc,CAAC,IAAI,CAAC,MAAM,CAAC,KAAK,CAAC,gBAAgB,CAAC,CAAC,CAAC;AAGzF,MAAM,WAAW,GAAG,MAAM,CAAC,GAAG,CAAC,KAAK,CAAC,MAAM,CAAC,sBAAsB,CAAC,CAAC,CAAC,CAAC,CAAC;AAEvE,mGAAmG;AACnG,MAAM,CAAC,MAAM,kBAAkB,GAAG,WAAW,CAAC,IAAI,CAAC,MAAM,CAAC,KAAK,CAAC,oBAAoB,CAAC,CAAC,CAAC;AAGvF,2GAA2G;AAC3G,MAAM,CAAC,MAAM,iBAAiB,GAAG,WAAW,CAAC,IAAI,CAAC,MAAM,CAAC,KAAK,CAAC,mBAAmB,CAAC,CAAC,CAAC;AAGrF,sFAAsF;AACtF,MAAM,OAAO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e;IACf,WAAW;IACX,cAAc;IACd,oBAAoB;CACrB,CAAC,CAAC"}
@@ -1,4 +1,5 @@
1
1
  import { Schema } from "effect";
2
+ import { Agent } from "../agent/agent.ts";
2
3
  import { BrainSpec } from "../agent/brain.ts";
3
4
  import { AttemptFailure } from "./failure.ts";
4
5
  /** Identity of one execution try; each retry receives a new identity under the same Run and Step. */
@@ -13,6 +14,14 @@ export type AttemptNumber = typeof AttemptNumber.Type;
13
14
  /** Task text given to the agent after loop interpolation or an operator's edit-and-retry amendment. */
14
15
  export declare const AttemptTask: Schema.brand<Schema.String, "AttemptTask">;
15
16
  export type AttemptTask = typeof AttemptTask.Type;
17
+ declare const AttemptContext_base: Schema.Class<AttemptContext, Schema.Struct<{
18
+ readonly task: Schema.brand<Schema.String, "AttemptTask">;
19
+ readonly agent: typeof Agent;
20
+ readonly parentModel: Schema.OptionFromNullOr<Schema.brand<Schema.String, "ModelId">>;
21
+ }>, {}>;
22
+ /** The effective task and roster Agent an operator assigns to a Run's later Attempts. */
23
+ export declare class AttemptContext extends AttemptContext_base {
24
+ }
16
25
  declare const Attempt_base: Schema.Class<Attempt, Schema.Struct<{
17
26
  readonly id: Schema.brand<Schema.NonEmptyString, "AttemptId">;
18
27
  readonly runId: Schema.brand<Schema.NonEmptyString, "RunId">;
@@ -20,6 +29,9 @@ declare const Attempt_base: Schema.Class<Attempt, Schema.Struct<{
20
29
  readonly worker: Schema.brand<Schema.String, "WorkerName">;
21
30
  readonly number: Schema.brand<Schema.Int, "AttemptNumber">;
22
31
  readonly brain: typeof BrainSpec;
32
+ readonly task: Schema.brand<Schema.String, "AttemptTask">;
33
+ readonly agent: Schema.brand<Schema.String, "AgentName">;
34
+ readonly operatorIntervened: Schema.Boolean;
23
35
  readonly parentModel: Schema.OptionFromNullOr<Schema.brand<Schema.String, "ModelId">>;
24
36
  readonly startedAt: Schema.DateTimeUtc;
25
37
  readonly outcome: Schema.Option<Schema.Union<readonly [typeof import("./outcome.ts").AttemptSucceeded, typeof import("./outcome.ts").AttemptFailed, typeof import("./outcome.ts").AttemptCanceled]>>;
@@ -1 +1 @@
1
- {"version":3,"file":"attempt.d.ts","sourceRoot":"","sources":["../../src/attempt/attempt.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,MAAM,EAAE,MAAM,QAAQ,CAAC;AAChC,OAAO,EAAE,SAAS,EAAW,MAAM,mBAAmB,CAAC;AAIvD,OAAO,EAAE,cAAc,EAA0B,MAAM,cAAc,CAAC;AAGtE,qGAAqG;AACrG,eAAO,MAAM,SAAS,kDAAwD,CAAC;AAE/E,MAAM,MAAM,SAAS,GAAG,OAAO,SAAS,CAAC,IAAI,CAAC;AAE9C;;;GAGG;AACH,eAAO,MAAM,aAAa,2CAEzB,CAAC;AACF,MAAM,MAAM,aAAa,GAAG,OAAO,aAAa,CAAC,IAAI,CAAC;AAEtD,uGAAuG;AACvG,eAAO,MAAM,WAAW,4CAEW,CAAC;AACpC,MAAM,MAAM,WAAW,GAAG,OAAO,WAAW,CAAC,IAAI,CAAC;;;;;;;;;;;;AAElD,uFAAuF;AACvF,qBAAa,OAAQ,SAAQ,YAU3B;CAAG;AAEL;;;;GAIG;AACH,eAAO,MAAM,eAAe,YAAa;IACvC,QAAQ,CAAC,OAAO,EAAE,cAAc,CAAC;IACjC,QAAQ,CAAC,MAAM,EAAE,aAAa,CAAC;IAC/B,QAAQ,CAAC,eAAe,EAAE,aAAa,CAAC;CACzC,KAAG,OAA8F,CAAC"}
1
+ {"version":3,"file":"attempt.d.ts","sourceRoot":"","sources":["../../src/attempt/attempt.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,MAAM,EAAE,MAAM,QAAQ,CAAC;AAChC,OAAO,EAAE,KAAK,EAAa,MAAM,mBAAmB,CAAC;AACrD,OAAO,EAAE,SAAS,EAAW,MAAM,mBAAmB,CAAC;AAIvD,OAAO,EAAE,cAAc,EAA0B,MAAM,cAAc,CAAC;AAGtE,qGAAqG;AACrG,eAAO,MAAM,SAAS,kDAAwD,CAAC;AAE/E,MAAM,MAAM,SAAS,GAAG,OAAO,SAAS,CAAC,IAAI,CAAC;AAE9C;;;GAGG;AACH,eAAO,MAAM,aAAa,2CAEzB,CAAC;AACF,MAAM,MAAM,aAAa,GAAG,OAAO,aAAa,CAAC,IAAI,CAAC;AAEtD,uGAAuG;AACvG,eAAO,MAAM,WAAW,4CAEW,CAAC;AACpC,MAAM,MAAM,WAAW,GAAG,OAAO,WAAW,CAAC,IAAI,CAAC;;;;;;AAElD,yFAAyF;AACzF,qBAAa,cAAe,SAAQ,mBAIlC;CAAG;;;;;;;;;;;;;;;AAEL,uFAAuF;AACvF,qBAAa,OAAQ,SAAQ,YAa3B;CAAG;AAEL;;;;GAIG;AACH,eAAO,MAAM,eAAe,YAAa;IACvC,QAAQ,CAAC,OAAO,EAAE,cAAc,CAAC;IACjC,QAAQ,CAAC,MAAM,EAAE,aAAa,CAAC;IAC/B,QAAQ,CAAC,eAAe,EAAE,aAAa,CAAC;CACzC,KAAG,OAA8F,CAAC"}
@@ -1,4 +1,5 @@
1
1
  import { Schema } from "effect";
2
+ import { Agent, AgentName } from "../agent/agent.js";
2
3
  import { BrainSpec, ModelId } from "../agent/brain.js";
3
4
  import { RunId } from "../run/run.js";
4
5
  import { StepName } from "../step/step.js";
@@ -14,6 +15,13 @@ export const AttemptId = Schema.NonEmptyString.pipe(Schema.brand("AttemptId"));
14
15
  export const AttemptNumber = Schema.Int.check(Schema.isGreaterThanOrEqualTo(1)).pipe(Schema.brand("AttemptNumber"));
15
16
  /** Task text given to the agent after loop interpolation or an operator's edit-and-retry amendment. */
16
17
  export const AttemptTask = Schema.String.check(Schema.isPattern(/\S/u, { message: "Expected non-blank task text" })).pipe(Schema.brand("AttemptTask"));
18
+ /** The effective task and roster Agent an operator assigns to a Run's later Attempts. */
19
+ export class AttemptContext extends Schema.Class("AttemptContext")({
20
+ task: AttemptTask,
21
+ agent: Agent,
22
+ parentModel: Schema.OptionFromNullOr(ModelId),
23
+ }) {
24
+ }
17
25
  /** One try of a step on a worker. `outcome` is none while the attempt is in flight. */
18
26
  export class Attempt extends Schema.Class("Attempt")({
19
27
  id: AttemptId,
@@ -22,6 +30,9 @@ export class Attempt extends Schema.Class("Attempt")({
22
30
  worker: WorkerName,
23
31
  number: AttemptNumber,
24
32
  brain: BrainSpec,
33
+ task: AttemptTask,
34
+ agent: AgentName,
35
+ operatorIntervened: Schema.Boolean,
25
36
  parentModel: Schema.OptionFromNullOr(ModelId),
26
37
  startedAt: Schema.DateTimeUtc,
27
38
  outcome: Schema.Option(AttemptOutcome),
@@ -1 +1 @@
1
- {"version":3,"file":"attempt.js","sourceRoot":"","sources":["../../src/attempt/attempt.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,MAAM,EAAE,MAAM,QAAQ,CAAC;AAChC,OAAO,EAAE,SAAS,EAAE,OAAO,EAAE,MAAM,mBAAmB,CAAC;AACvD,OAAO,EAAE,KAAK,EAAE,MAAM,eAAe,CAAC;AACtC,OAAO,EAAE,QAAQ,EAAE,MAAM,iBAAiB,CAAC;AAC3C,OAAO,EAAE,UAAU,EAAE,MAAM,cAAc,CAAC;AAC1C,OAAO,EAAE,cAAc,EAAE,sBAAsB,EAAE,MAAM,cAAc,CAAC;AACtE,OAAO,EAAE,cAAc,EAAE,MAAM,cAAc,CAAC;AAE9C,qGAAqG;AACrG,MAAM,CAAC,MAAM,SAAS,GAAG,MAAM,CAAC,cAAc,CAAC,IAAI,CAAC,MAAM,CAAC,KAAK,CAAC,WAAW,CAAC,CAAC,CAAC;AAI/E;;;GAGG;AACH,MAAM,CAAC,MAAM,aAAa,GAAG,MAAM,CAAC,GAAG,CAAC,KAAK,CAAC,MAAM,CAAC,sBAAsB,CAAC,CAAC,CAAC,CAAC,CAAC,IAAI,CAClF,MAAM,CAAC,KAAK,CAAC,eAAe,CAAC,CAC9B,CAAC;AAGF,uGAAuG;AACvG,MAAM,CAAC,MAAM,WAAW,GAAG,MAAM,CAAC,MAAM,CAAC,KAAK,CAC5C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CAAC,MAAM,CAAC,cAAc,CAAC;CACvC,CAAC;CAAG;AAEL;;;;GAIG;AACH,MAAM,CAAC,MAAM,eAAe,GAAG,CAAC,OAI/B,EAAW,EAAE,CAAC,sBAAsB,CAAC,OAAO,CAAC,OAAO,CAAC,IAAI,OAAO,CAAC,MAAM,GAAG,OAAO,CAAC,eAAe,CAAC"}
@@ -1,9 +1,9 @@
1
- import { Result, Schema, type Effect } from "effect";
1
+ import { Effect, Result, Schema } from "effect";
2
2
  import { Agent } from "../agent/agent.ts";
3
3
  import { AttemptId } from "./attempt.ts";
4
4
  import { StepResult } from "../step/result.ts";
5
5
  import { AttemptFailure } from "./failure.ts";
6
- export declare const PROTOCOL_VERSION: 4;
6
+ export declare const PROTOCOL_VERSION: 6;
7
7
  /**
8
8
  * Per-Attempt, per-direction message sequence, starting at 1. Distinct from the
9
9
  * engine's transcript sequence, which orders persisted rows globally.
@@ -12,7 +12,7 @@ export declare const Sequence: Schema.brand<Schema.Int, "AttemptChannelSequence"
12
12
  export type Sequence = typeof Sequence.Type;
13
13
  /**
14
14
  * Relative to the run host: `inbound` frames go from the orchestrator to the run
15
- * host (Start, Steer, Interrupt) and `outbound` frames go the other way.
15
+ * host (Start, operator input, Cancel) and `outbound` frames go the other way.
16
16
  */
17
17
  export declare const DIRECTIONS: readonly ["inbound", "outbound"];
18
18
  export declare const Direction: Schema.Literals<readonly ["inbound", "outbound"]>;
@@ -42,7 +42,7 @@ declare const Started_base: Schema.Class<Started, Schema.TaggedStruct<"Started",
42
42
  export declare class Started extends Started_base {
43
43
  }
44
44
  declare const SessionEvent_base: Schema.Class<SessionEvent, Schema.TaggedStruct<"SessionEvent", {
45
- readonly event: Schema.Union<readonly [typeof import("../agent/session.ts").SessionStarted, typeof import("../agent/session.ts").TextOutput, typeof import("../agent/session.ts").ToolStarted, typeof import("../agent/session.ts").ToolFinished, typeof import("../agent/session.ts").PoolRateLimitsUpdated, typeof import("../agent/session.ts").SessionFinished]>;
45
+ readonly event: Schema.Union<readonly [typeof import("../agent/session.ts").SessionStarted, typeof import("../agent/session.ts").TextOutput, typeof import("../agent/session.ts").ToolStarted, typeof import("../agent/session.ts").ToolFinished, typeof import("../agent/session.ts").PoolRateLimitsUpdated, typeof import("../agent/session.ts").SessionFinished, typeof import("../agent/session.ts").SessionIdle, typeof import("../agent/session.ts").SessionResumed, typeof import("../agent/session.ts").SessionTokensUpdated]>;
46
46
  }>, {}>;
47
47
  /** One normalized parent or child session event, persisted in the Attempt transcript. */
48
48
  export declare class SessionEvent extends SessionEvent_base {
@@ -58,11 +58,9 @@ declare const Failed_base: Schema.Class<Failed, Schema.TaggedStruct<"Failed", {
58
58
  export declare class Failed extends Failed_base {
59
59
  }
60
60
  declare const Interrupted_base: Schema.Class<Interrupted, Schema.TaggedStruct<"Interrupted", {}>, {}>;
61
- /** The run host stopped on an Interrupt frame. Terminal. */
61
+ /** The run host acknowledged Attempt cancellation. Terminal. */
62
62
  export declare class Interrupted extends Interrupted_base {
63
63
  }
64
- export declare const OutboundPayload: Schema.Union<readonly [typeof Started, typeof SessionEvent, typeof Final, typeof Failed, typeof Interrupted]>;
65
- export type OutboundPayload = typeof OutboundPayload.Type;
66
64
  declare const Steer_base: Schema.Class<Steer, Schema.TaggedStruct<"Steer", {
67
65
  readonly message: Schema.NonEmptyString;
68
66
  }>, {}>;
@@ -71,30 +69,96 @@ export declare class Steer extends Steer_base {
71
69
  declare const Interrupt_base: Schema.Class<Interrupt, Schema.TaggedStruct<"Interrupt", {}>, {}>;
72
70
  export declare class Interrupt extends Interrupt_base {
73
71
  }
74
- export declare const InboundPayload: Schema.Union<readonly [typeof Steer, typeof Interrupt]>;
72
+ declare const Cancel_base: Schema.Class<Cancel, Schema.TaggedStruct<"Cancel", {}>, {}>;
73
+ /** Stops the entire Attempt, including every held or paused session. Used by cancellation and guardrails. */
74
+ export declare class Cancel extends Cancel_base {
75
+ }
76
+ declare const OperatorMessage_base: Schema.Class<OperatorMessage, Schema.TaggedStruct<"OperatorMessage", {
77
+ readonly message: Schema.NonEmptyString;
78
+ }>, {}>;
79
+ /** An operator turn joined to the target session, distinct from a Steer so a takeover can record and hold it (ADR 0018). */
80
+ export declare class OperatorMessage extends OperatorMessage_base {
81
+ }
82
+ declare const Release_base: Schema.Class<Release, Schema.TaggedStruct<"Release", {}>, {}>;
83
+ /** Ends a held child's takeover, letting its idle result return to the awaiting parent (ADR 0018). */
84
+ export declare class Release extends Release_base {
85
+ }
86
+ /** Nonterminal operator controls; cancellation is an Attempt operation. */
87
+ export declare const OperatorAction: Schema.Union<readonly [typeof Steer, typeof Interrupt, typeof OperatorMessage, typeof Release]>;
88
+ export type OperatorAction = typeof OperatorAction.Type;
89
+ export declare const InboundPayload: Schema.Union<readonly [Schema.Union<readonly [typeof Steer, typeof Interrupt, typeof OperatorMessage, typeof Release]>, typeof Cancel]>;
75
90
  export type InboundPayload = typeof InboundPayload.Type;
91
+ declare const ParentTarget_base: Schema.Class<ParentTarget, Schema.TaggedStruct<"Parent", {}>, {}>;
92
+ /** The Pi parent, the default recipient of operator input for an Attempt. */
93
+ export declare class ParentTarget extends ParentTarget_base {
94
+ }
95
+ declare const ChildTarget_base: Schema.Class<ChildTarget, Schema.TaggedStruct<"Child", {
96
+ readonly sessionId: Schema.brand<Schema.NonEmptyString, "AgentSessionId">;
97
+ }>, {}>;
98
+ /** A harness child of the Attempt's parent, addressed by the id it reports in the normalized event stream. */
99
+ export declare class ChildTarget extends ChildTarget_base {
100
+ }
101
+ /** Which session inside an Attempt an inbound frame addresses: the Pi parent, or one of its children. */
102
+ export declare const SessionTarget: Schema.Union<readonly [typeof ParentTarget, typeof ChildTarget]>;
103
+ export type SessionTarget = typeof SessionTarget.Type;
104
+ declare const Intervention_base: Schema.Class<Intervention, Schema.Struct<{
105
+ readonly operator: Schema.NonEmptyString;
106
+ readonly target: Schema.Union<readonly [typeof ParentTarget, typeof ChildTarget]>;
107
+ readonly action: Schema.Union<readonly [typeof Steer, typeof Interrupt, typeof OperatorMessage, typeof Release]>;
108
+ }>, {}>;
109
+ /** Attributed operator input addressed to one live session, never an Event. */
110
+ export declare class Intervention extends Intervention_base {
111
+ }
112
+ declare const InterventionState_base: Schema.Class<InterventionState, Schema.Struct<{
113
+ readonly held: Schema.Boolean;
114
+ readonly paused: Schema.Boolean;
115
+ }>, {}>;
116
+ /** The session's supervision state after an accepted operator action. */
117
+ export declare class InterventionState extends InterventionState_base {
118
+ }
119
+ declare const InterventionApplied_base: Schema.Class<InterventionApplied, Schema.TaggedStruct<"InterventionApplied", {
120
+ readonly inputSequence: Schema.brand<Schema.Int, "AttemptChannelSequence">;
121
+ readonly intervention: typeof Intervention;
122
+ readonly state: typeof InterventionState;
123
+ }>, {}>;
124
+ /** Acknowledges delivery and records the resulting Hold or pause in the transcript. */
125
+ export declare class InterventionApplied extends InterventionApplied_base {
126
+ }
127
+ declare const InterventionRejected_base: Schema.Class<InterventionRejected, Schema.TaggedStruct<"InterventionRejected", {
128
+ readonly inputSequence: Schema.brand<Schema.Int, "AttemptChannelSequence">;
129
+ readonly intervention: typeof Intervention;
130
+ readonly message: Schema.NonEmptyString;
131
+ }>, {}>;
132
+ /** A session closed or refused an operator action; the Attempt itself continues. */
133
+ export declare class InterventionRejected extends InterventionRejected_base {
134
+ }
135
+ export declare const OutboundPayload: Schema.Union<readonly [typeof Started, typeof SessionEvent, typeof Final, typeof Failed, typeof Interrupted, typeof InterventionApplied, typeof InterventionRejected]>;
136
+ export type OutboundPayload = typeof OutboundPayload.Type;
76
137
  declare const OutboundEnvelope_base: Schema.Class<OutboundEnvelope, Schema.TaggedStruct<"OutboundEnvelope", {
77
- readonly version: Schema.Literal<4>;
138
+ readonly version: Schema.Literal<6>;
78
139
  readonly attemptId: Schema.brand<Schema.NonEmptyString, "AttemptId">;
79
140
  readonly sequence: Schema.brand<Schema.Int, "AttemptChannelSequence">;
80
141
  readonly sentAt: Schema.DateTimeUtcFromString;
81
- readonly payload: Schema.Union<readonly [typeof Started, typeof SessionEvent, typeof Final, typeof Failed, typeof Interrupted]>;
142
+ readonly payload: Schema.Union<readonly [typeof Started, typeof SessionEvent, typeof Final, typeof Failed, typeof Interrupted, typeof InterventionApplied, typeof InterventionRejected]>;
82
143
  }>, {}>;
83
144
  export declare class OutboundEnvelope extends OutboundEnvelope_base {
84
145
  }
85
146
  declare const InboundEnvelope_base: Schema.Class<InboundEnvelope, Schema.TaggedStruct<"InboundEnvelope", {
86
- readonly version: Schema.Literal<4>;
147
+ readonly version: Schema.Literal<6>;
87
148
  readonly attemptId: Schema.brand<Schema.NonEmptyString, "AttemptId">;
88
149
  readonly sequence: Schema.brand<Schema.Int, "AttemptChannelSequence">;
89
150
  readonly sentAt: Schema.DateTimeUtcFromString;
90
- readonly payload: Schema.Union<readonly [typeof Steer, typeof Interrupt]>;
151
+ /** The session this frame addresses; the Pi parent unless a child is named. */
152
+ readonly target: Schema.withDecodingDefaultKey<Schema.Union<readonly [typeof ParentTarget, typeof ChildTarget]>, never>;
153
+ readonly operator: Schema.NonEmptyString;
154
+ readonly payload: Schema.Union<readonly [Schema.Union<readonly [typeof Steer, typeof Interrupt, typeof OperatorMessage, typeof Release]>, typeof Cancel]>;
91
155
  }>, {}>;
92
156
  export declare class InboundEnvelope extends InboundEnvelope_base {
93
157
  }
94
158
  export declare const Envelope: Schema.Union<readonly [typeof OutboundEnvelope, typeof InboundEnvelope]>;
95
159
  export type Envelope = typeof Envelope.Type;
96
160
  declare const Start_base: Schema.Class<Start, Schema.TaggedStruct<"Start", {
97
- readonly version: Schema.Literal<4>;
161
+ readonly version: Schema.Literal<6>;
98
162
  readonly spec: typeof RunSpec;
99
163
  }>, {}>;
100
164
  /** The first framed stdin message. Later frames are inbound envelopes. */
@@ -1 +1 @@
1
- {"version":3,"file":"channel.d.ts","sourceRoot":"","sources":["../../src/attempt/channel.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,MAAM,EAAE,MAAM,EAAE,KAAK,MAAM,EAAE,MAAM,QAAQ,CAAC;AACrD,OAAO,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nB,QAAQ,CAAC,MAAM,EAAE,CACf,SAAS,EAAE,SAAS,EACpB,QAAQ,EAAE,QAAQ,KACf,MAAM,CAAC,MAAM,CAAC,IAAI,EAAE,cAAc,CAAC,CAAC;CAC1C;AAED,2DAA2D;AAC3D,MAAM,WAAW,QAAQ;IACvB,QAAQ,CAAC,KAAK,EAAE,iBAAiB,GAAG,SAAS,GAAG,UAAU,CAAC;IAC3D,QAAQ,CAAC,YAAY,EAAE,MAAM,CAAC;CAC/B;AAED,eAAO,MAAM,eAAe,EAAE,QAAwD,CAAC;AAEvF,+EAA+E;AAC/E,MAAM,WAAW,SAAS;IACxB,QAAQ,CAAC,OAAO,EAAE,MAAM,CAAC;IACzB,QAAQ,CAAC,MAAM,EAAE,MAAM,CAAC;CACzB;AAKD;;;;GAIG;AACH,eAAO,MAAM,KAAK,aACN,QAAQ,aACP,SAAS,YACV,gBAAgB,KACzB,MAAM,CAAC,MAAM,CAAC,QAAQ,EAAE,SAAS,CAuCnC,CAAC"}
@@ -1,12 +1,12 @@
1
- import { Result, Schema } from "effect";
1
+ import { Effect, Result, Schema } from "effect";
2
2
  import { Agent } from "../agent/agent.js";
3
3
  import { Effort, ModelId } from "../agent/brain.js";
4
- import { AgentSessionEvent, ChildSessionBudget } from "../agent/session.js";
4
+ import { AgentSessionEvent, AgentSessionId, ChildSessionBudget } from "../agent/session.js";
5
5
  import { AttemptId, AttemptTask } from "./attempt.js";
6
6
  import { RepositoryName, CommitSha, RepositoryRevision } from "../repository.js";
7
7
  import { StepResult } from "../step/result.js";
8
8
  import { AttemptFailure } from "./failure.js";
9
- export const PROTOCOL_VERSION = 4;
9
+ export const PROTOCOL_VERSION = 6;
10
10
  /**
11
11
  * Per-Attempt, per-direction message sequence, starting at 1. Distinct from the
12
12
  * engine's transcript sequence, which orders persisted rows globally.
@@ -14,7 +14,7 @@ export const PROTOCOL_VERSION = 4;
14
14
  export const Sequence = Schema.Int.check(Schema.isGreaterThanOrEqualTo(1)).pipe(Schema.brand("AttemptChannelSequence"));
15
15
  /**
16
16
  * Relative to the run host: `inbound` frames go from the orchestrator to the run
17
- * host (Start, Steer, Interrupt) and `outbound` frames go the other way.
17
+ * host (Start, operator input, Cancel) and `outbound` frames go the other way.
18
18
  */
19
19
  export const DIRECTIONS = ["inbound", "outbound"];
20
20
  export const Direction = Schema.Literals(DIRECTIONS);
@@ -51,17 +51,73 @@ export class Failed extends Schema.TaggedClass("AttemptChannel/Failed")("Failed"
51
51
  failure: AttemptFailure,
52
52
  }) {
53
53
  }
54
- /** The run host stopped on an Interrupt frame. Terminal. */
54
+ /** The run host acknowledged Attempt cancellation. Terminal. */
55
55
  export class Interrupted extends Schema.TaggedClass("AttemptChannel/Interrupted")("Interrupted", {}) {
56
56
  }
57
- export const OutboundPayload = Schema.Union([Started, SessionEvent, Final, Failed, Interrupted]);
58
57
  export class Steer extends Schema.TaggedClass("AttemptChannel/Steer")("Steer", {
59
58
  message: Schema.NonEmptyString,
60
59
  }) {
61
60
  }
62
61
  export class Interrupt extends Schema.TaggedClass("AttemptChannel/Interrupt")("Interrupt", {}) {
63
62
  }
64
- export const InboundPayload = Schema.Union([Steer, Interrupt]);
63
+ /** Stops the entire Attempt, including every held or paused session. Used by cancellation and guardrails. */
64
+ export class Cancel extends Schema.TaggedClass("AttemptChannel/Cancel")("Cancel", {}) {
65
+ }
66
+ /** An operator turn joined to the target session, distinct from a Steer so a takeover can record and hold it (ADR 0018). */
67
+ export class OperatorMessage extends Schema.TaggedClass("AttemptChannel/OperatorMessage")("OperatorMessage", {
68
+ message: Schema.NonEmptyString,
69
+ }) {
70
+ }
71
+ /** Ends a held child's takeover, letting its idle result return to the awaiting parent (ADR 0018). */
72
+ export class Release extends Schema.TaggedClass("AttemptChannel/Release")("Release", {}) {
73
+ }
74
+ /** Nonterminal operator controls; cancellation is an Attempt operation. */
75
+ export const OperatorAction = Schema.Union([Steer, Interrupt, OperatorMessage, Release]);
76
+ export const InboundPayload = Schema.Union([OperatorAction, Cancel]);
77
+ /** The Pi parent, the default recipient of operator input for an Attempt. */
78
+ export class ParentTarget extends Schema.TaggedClass("AttemptChannel/ParentTarget")("Parent", {}) {
79
+ }
80
+ /** A harness child of the Attempt's parent, addressed by the id it reports in the normalized event stream. */
81
+ export class ChildTarget extends Schema.TaggedClass("AttemptChannel/ChildTarget")("Child", { sessionId: AgentSessionId }) {
82
+ }
83
+ /** Which session inside an Attempt an inbound frame addresses: the Pi parent, or one of its children. */
84
+ export const SessionTarget = Schema.Union([ParentTarget, ChildTarget]);
85
+ /** Attributed operator input addressed to one live session, never an Event. */
86
+ export class Intervention extends Schema.Class("AttemptChannel/Intervention")({
87
+ operator: Schema.NonEmptyString,
88
+ target: SessionTarget,
89
+ action: OperatorAction,
90
+ }) {
91
+ }
92
+ /** The session's supervision state after an accepted operator action. */
93
+ export class InterventionState extends Schema.Class("AttemptChannel/InterventionState")({
94
+ held: Schema.Boolean,
95
+ paused: Schema.Boolean,
96
+ }) {
97
+ }
98
+ /** Acknowledges delivery and records the resulting Hold or pause in the transcript. */
99
+ export class InterventionApplied extends Schema.TaggedClass("AttemptChannel/InterventionApplied")("InterventionApplied", {
100
+ inputSequence: Sequence,
101
+ intervention: Intervention,
102
+ state: InterventionState,
103
+ }) {
104
+ }
105
+ /** A session closed or refused an operator action; the Attempt itself continues. */
106
+ export class InterventionRejected extends Schema.TaggedClass("AttemptChannel/InterventionRejected")("InterventionRejected", {
107
+ inputSequence: Sequence,
108
+ intervention: Intervention,
109
+ message: Schema.NonEmptyString,
110
+ }) {
111
+ }
112
+ export const OutboundPayload = Schema.Union([
113
+ Started,
114
+ SessionEvent,
115
+ Final,
116
+ Failed,
117
+ Interrupted,
118
+ InterventionApplied,
119
+ InterventionRejected,
120
+ ]);
65
121
  const EnvelopeFields = {
66
122
  version: Schema.Literal(PROTOCOL_VERSION),
67
123
  attemptId: AttemptId,
@@ -75,6 +131,9 @@ export class OutboundEnvelope extends Schema.TaggedClass("AttemptChannel/Outboun
75
131
  }
76
132
  export class InboundEnvelope extends Schema.TaggedClass("AttemptChannel/InboundEnvelope")("InboundEnvelope", {
77
133
  ...EnvelopeFields,
134
+ /** The session this frame addresses; the Pi parent unless a child is named. */
135
+ target: SessionTarget.pipe(Schema.withDecodingDefaultKey(Effect.succeed({ _tag: "Parent" }))),
136
+ operator: Schema.NonEmptyString,
78
137
  payload: InboundPayload,
79
138
  }) {
80
139
  }
@@ -1 +1 @@
1
- {"version":3,"file":"channel.js","sourceRoot":"","sources":["../../src/attempt/channel.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,MAAM,EAAE,MAAM,EAAe,MAAM,QAAQ,CAAC;AACrD,OAAO,EAAE,KAAK,EAAE,MAAM,mBAAmB,CAAC;AAC1C,OAAO,EAAE,MAAM,EAAE,OAAO,EAAE,MAAM,mBAAmB,CAAC;AACpD,OAAO,EAAE,iBAAiB,EAAE,kBAAkB,EAAE,MAAM,qBAAqB,CAAC;AAC5E,OAAO,EAAE,SAAS,EAAE,WAAW,EAAE,MAAM,cAAc,CAAC;AACtD,OAAO,EAAE,cAAc,EAAE,SAAS,EAAE,kBAAkB,EAAE,MAAM,kBAAkB,CAAC;AACjF,OAAO,EAAE,UAAU,EAAE,MAAM,mBAAmB,CAAC;AAC/C,OAAO,EAAE,cAAc,EAAE,MAAM,cAAc,CAAC;AAE9C,MAAM,CAAC,MAAM,gBAAgB,GAAG,CAAU,CAAC;AAE3C;;;GAGG;AACH,MAAM,CAAC,MAAM,QAAQ,GAAG,MAAM,CAAC,GAAG,CAAC,KAAK,CAAC,MAAM,CAAC,sBAAsB,CAAC,CAAC,CAAC,CAAC,CAAC,IAAI,CAC7E,MAAM,CAAC,KAAK,CAAC,wBAAwB,CAAC,CACvC,CAAC;AAGF;;;GAGG;AACH,MAAM,CAAC,MAAM,UAAU,GAAG,CAAC,SAAS,EAAE,UAAU,CAAU,CAAC;AAC3D,MAAM,CAAC,MAAM,SAAS,GAAG,MAAM,CAAC,QAAQ,CAAC,UAAU,CAAC,CAAC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AM,EAAE,QAAQ,CAAC,OAAO,CAAC,IAAI;SAC9B,CAAC,CAAC;IACL,CAAC;IACD,IACE,QAAQ,CAAC,KAAK,KAAK,iBAAiB;QACpC,QAAQ,CAAC,OAAO,CAAC,IAAI,KAAK,SAAS;QACnC,QAAQ,CAAC,OAAO,CAAC,IAAI,KAAK,QAAQ,EAClC,CAAC;QACD,OAAO,MAAM,CAAC,IAAI,CAAC;YACjB,OAAO,EAAE,8DAA8D;YACvE,MAAM,EAAE,QAAQ,CAAC,OAAO,CAAC,IAAI;SAC9B,CAAC,CAAC;IACL,CAAC;IACD,IAAI,QAAQ,CAAC,KAAK,KAAK,SAAS,IAAI,QAAQ,CAAC,OAAO,CAAC,IAAI,KAAK,SAAS,EAAE,CAAC;QACxE,OAAO,MAAM,CAAC,IAAI,CAAC;YACjB,OAAO,EAAE,qDAAqD;YAC9D,MAAM,EAAE,4BAA4B;SACrC,CAAC,CAAC;IACL,CAAC;IACD,OAAO,MAAM,CAAC,OAAO,CAAC;QACpB,KAAK,EAAE,UAAU,CAAC,QAAQ,CAAC,OAAO,CAAC,CAAC,CAAC,CAAC,UAAU,CAAC,CAAC,CAAC,SAAS;QAC5D,YAAY,EAAE,QAAQ,CAAC,YAAY,GAAG,CAAC;KACxC,CAAC,CAAC;AACL,CAAC,CAAC"}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@usine/core",
3
- "version": "0.2.0",
3
+ "version": "0.3.0",
4
4
  "description": "Domain model for usine: Event → Run → Step → Attempt, branded ids, the run state machine, and the typed attempt-failure taxonomy.",
5
5
  "license": "MIT",
6
6
  "repository": {