@kitman-sh/go-to-market 0.14.7 → 0.14.9

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/bundle.js CHANGED
@@ -236,6 +236,9 @@ function isNever(_) {
236
236
  function isUnknown(_) {
237
237
  return true;
238
238
  }
239
+ function isObjectOrArray(input) {
240
+ return typeof input === "object" && input !== null;
241
+ }
239
242
  function isObject(input) {
240
243
  return typeof input === "object" && input !== null && !Array.isArray(input);
241
244
  }
@@ -12077,6 +12080,12 @@ var AgentSandboxPolicy = Struct({
12077
12080
 
12078
12081
  // ../../packages/core/src/runtime-type.ts
12079
12082
  var UnsafeJsonObjectKeys = new Set(["__proto__", "constructor", "prototype"]);
12083
+ function isObject2(value) {
12084
+ return isObjectOrArray(value);
12085
+ }
12086
+ function isJsonObject(value) {
12087
+ return isObject2(value) && value !== null && !Array.isArray(value);
12088
+ }
12080
12089
  function isString2(value) {
12081
12090
  return isString(value);
12082
12091
  }
@@ -14544,10 +14553,12 @@ var RunStartPreview = Struct({
14544
14553
  })
14545
14554
  });
14546
14555
  var LoopVersion = String5.check(isPattern2(/^(0|[1-9]\d*)\.(0|[1-9]\d*)\.(0|[1-9]\d*)(?:-[0-9A-Za-z.-]+)?(?:\+[0-9A-Za-z.-]+)?$/));
14556
+ var LoopDescription = String5.check(isPattern2(/^[^\r\n]{1,160}$/));
14547
14557
  var ProgramLoop = Struct({
14548
14558
  id: String5,
14549
14559
  title: String5,
14550
14560
  version: optionalKey2(LoopVersion),
14561
+ description: optionalKey2(LoopDescription),
14551
14562
  layer: Literals(["team", "workspace"]),
14552
14563
  digest: String5,
14553
14564
  outcome: optionalKey2(String5),
@@ -14608,7 +14619,8 @@ var RunListItem = Struct({
14608
14619
  loop: Struct({ id: String5, title: String5 }),
14609
14620
  task: optionalKey2(Struct({ id: Id, key: String5, title: String5 })),
14610
14621
  display: RunDisplay,
14611
- miniGraph: ArraySchema(Literals(RunDisplayStates))
14622
+ miniGraph: ArraySchema(Literals(RunDisplayStates)),
14623
+ steps: ArraySchema(Literals(RunDisplayStates))
14612
14624
  });
14613
14625
  var RunList = Struct({
14614
14626
  items: ArraySchema(RunListItem),
@@ -14736,6 +14748,7 @@ var LoopCapabilities = [
14736
14748
  "read_project",
14737
14749
  "draft_update"
14738
14750
  ];
14751
+ var LoopRoles = ["review"];
14739
14752
  var JsonObject2 = Record(String5, Json2);
14740
14753
  var SecretName2 = String5.check(isPattern2(/^[A-Za-z_][A-Za-z0-9_]{0,127}$/));
14741
14754
  var EventFilterValue = Union2([String5, Finite, Boolean3, Null2]);
@@ -14751,9 +14764,11 @@ var LoopManifest = Struct({
14751
14764
  id: String5,
14752
14765
  title: String5,
14753
14766
  version: optionalKey2(LoopVersion),
14767
+ description: optionalKey2(LoopDescription),
14754
14768
  input: JsonObject2,
14755
14769
  output: JsonObject2,
14756
14770
  outcome: optionalKey2(Literals(["feature", "bug", "refactor", "investigation", "docs", "migration", "performance"])),
14771
+ role: optionalKey2(Literals(LoopRoles)),
14757
14772
  agents: Record(String5, String5),
14758
14773
  checkout: Literals(["none", "read", "write"]),
14759
14774
  when: ArraySchema(WhenClause),
@@ -14832,6 +14847,100 @@ var KitDeclarations = Struct({
14832
14847
  var sameLoop = toEquivalence2(LoopManifest);
14833
14848
  var sameAgent = toEquivalence2(AgentDeclaration);
14834
14849
 
14850
+ // ../../packages/sdk/src/loop/review.ts
14851
+ var Severity = Literals(["blocker", "major", "minor"]);
14852
+ var Finding = Struct({
14853
+ severity: Severity,
14854
+ file: String5,
14855
+ line: Int,
14856
+ detail: String5
14857
+ });
14858
+ var MergedFinding = Struct({
14859
+ id: String5,
14860
+ ...Finding.fields,
14861
+ seats: ArraySchema(String5),
14862
+ blockingSeats: optionalKey2(ArraySchema(String5))
14863
+ });
14864
+ var Rebuttal = Struct({ findingId: String5, reason: String5 });
14865
+ var RebuttalVerdict = Struct({ findingId: String5, accepted: Boolean3 });
14866
+ var ScopeJudgement = Struct({ met: Boolean3, unmet: ArraySchema(String5) });
14867
+
14868
+ // ../../packages/sdk/src/loop/role.ts
14869
+ var ReviewRoleFinding = Struct({ id: String5, severity: Severity });
14870
+ var ReviewRoleInput = Struct({
14871
+ changeRequestId: optional2(String5),
14872
+ base: optional2(String5),
14873
+ head: optional2(String5),
14874
+ files: optional2(ArraySchema(String5)),
14875
+ since: optional2(String5),
14876
+ approved: optional2(String5),
14877
+ failing: optional2(ArraySchema(String5)),
14878
+ notRun: optional2(ArraySchema(String5)),
14879
+ reviewed: optional2(String5),
14880
+ earlier: optional2(ArraySchema(ReviewRoleFinding))
14881
+ });
14882
+ var ReviewRoleOutput = Struct({
14883
+ findings: ArraySchema(ReviewRoleFinding),
14884
+ blocking: Boolean3,
14885
+ scope: optional2(Struct({ met: Boolean3 })),
14886
+ failing: optional2(ArraySchema(String5))
14887
+ });
14888
+ var roleSchemas = { review: { input: ReviewRoleInput, output: ReviewRoleOutput } };
14889
+ var documentOf = (schema) => ({
14890
+ schema,
14891
+ defs: isJsonObject(schema.$defs) ? schema.$defs : {}
14892
+ });
14893
+ var resolved = (value, defs, seen = new Set) => {
14894
+ if (!isJsonObject(value))
14895
+ return {};
14896
+ const ref = value.$ref;
14897
+ if (!isString2(ref) || !ref.startsWith("#/$defs/") || seen.has(ref))
14898
+ return value;
14899
+ seen.add(ref);
14900
+ return resolved(defs[ref.slice("#/$defs/".length)], defs, seen);
14901
+ };
14902
+ var alternatives = (schema) => Array.isArray(schema.anyOf) ? schema.anyOf : undefined;
14903
+ var stringsOf = (value) => Array.isArray(value) ? value.filter(isString2) : [];
14904
+ var misfit = (loop, role, at, of, path) => {
14905
+ const mine = resolved(at, loop.defs);
14906
+ const theirs = resolved(of, role.defs);
14907
+ const mineAnyOf = alternatives(mine);
14908
+ if (mineAnyOf !== undefined)
14909
+ return mineAnyOf.map((option) => misfit(loop, role, option, theirs, path)).find((problem) => problem !== undefined);
14910
+ const theirsAnyOf = alternatives(theirs);
14911
+ if (theirsAnyOf !== undefined)
14912
+ return theirsAnyOf.some((option) => misfit(loop, role, mine, option, path) === undefined) ? undefined : `${path} has another type`;
14913
+ const type = theirs.type;
14914
+ if (type === undefined)
14915
+ return;
14916
+ if (!(mine.type === type || type === "number" && mine.type === "integer"))
14917
+ return `${path} has another type`;
14918
+ if (theirs.enum !== undefined) {
14919
+ const allowed = Array.isArray(theirs.enum) ? theirs.enum : [];
14920
+ if (!Array.isArray(mine.enum) || !mine.enum.every((value) => allowed.includes(value)))
14921
+ return `${path} takes values the role does not`;
14922
+ }
14923
+ if (type === "array")
14924
+ return misfit(loop, role, mine.items, theirs.items, `${path}[]`);
14925
+ if (type !== "object")
14926
+ return;
14927
+ const properties = isJsonObject(mine.properties) ? mine.properties : {};
14928
+ const required = stringsOf(mine.required);
14929
+ const needed = stringsOf(theirs.required);
14930
+ for (const [name, field] of Object.entries(isJsonObject(theirs.properties) ? theirs.properties : {})) {
14931
+ const named = path === "" ? name : `${path}.${name}`;
14932
+ if (properties[name] === undefined)
14933
+ return `${named} is missing`;
14934
+ if (needed.includes(name) && !required.includes(name))
14935
+ return `${named} is optional, and the role needs it always`;
14936
+ const problem = misfit(loop, role, properties[name], field, named);
14937
+ if (problem !== undefined)
14938
+ return problem;
14939
+ }
14940
+ return;
14941
+ };
14942
+ var roleMisfit = (loop, role) => misfit(documentOf(loop), documentOf(role), loop, role, "");
14943
+
14835
14944
  // ../../packages/sdk/src/loop/define.ts
14836
14945
  var LoopOutcome = Literals([
14837
14946
  "feature",
@@ -14876,6 +14985,18 @@ var declarationsAreData = (definition) => decodeEffect2(JsonObjectSchema)({
14876
14985
  offers: definition.offers ?? [],
14877
14986
  schedule: definition.schedule ?? null
14878
14987
  }).pipe(mapError3((error) => new ManifestInvalid({ loop: definition.id, message: `Declarations must be data: ${error.message}` })));
14988
+ var carriesRole = (loop, role, declared) => gen2(function* () {
14989
+ if (!LoopRoles.includes(role))
14990
+ return yield* new ManifestInvalid({ loop, message: `role "${String(role)}" is no role` });
14991
+ for (const side of ["input", "output"]) {
14992
+ const problem = roleMisfit(declared[side], yield* jsonSchemaOf(loop, roleSchemas[role][side]));
14993
+ if (problem !== undefined)
14994
+ return yield* new ManifestInvalid({
14995
+ loop,
14996
+ message: `role "${role}" reads the ${side === "input" ? "Input" : "Output"}'s fields, and ${problem}`
14997
+ });
14998
+ }
14999
+ });
14879
15000
  var loopManifest = (definition) => gen2(function* () {
14880
15001
  yield* declarationsAreData(definition);
14881
15002
  if (definition.version !== undefined && !is2(LoopVersion)(definition.version))
@@ -14883,13 +15004,24 @@ var loopManifest = (definition) => gen2(function* () {
14883
15004
  loop: definition.id,
14884
15005
  message: `version "${String(definition.version)}" is not semver, such as 2.0.0`
14885
15006
  });
15007
+ if (definition.description !== undefined && !is2(LoopDescription)(definition.description))
15008
+ return yield* new ManifestInvalid({
15009
+ loop: definition.id,
15010
+ message: "description must be one line of 1 to 160 characters"
15011
+ });
15012
+ const input = yield* jsonSchemaOf(definition.id, definition.input);
15013
+ const output = yield* jsonSchemaOf(definition.id, definition.output);
15014
+ if (definition.role !== undefined)
15015
+ yield* carriesRole(definition.id, definition.role, { input, output });
14886
15016
  return {
14887
15017
  id: definition.id,
14888
15018
  title: definition.title,
14889
15019
  ...definition.version === undefined ? undefined : { version: definition.version },
14890
- input: yield* jsonSchemaOf(definition.id, definition.input),
14891
- output: yield* jsonSchemaOf(definition.id, definition.output),
15020
+ ...definition.description === undefined ? undefined : { description: definition.description },
15021
+ input,
15022
+ output,
14892
15023
  ...definition.outcome === undefined ? undefined : { outcome: definition.outcome },
15024
+ ...definition.role === undefined ? undefined : { role: definition.role },
14893
15025
  agents: definition.agents,
14894
15026
  checkout: definition.checkout,
14895
15027
  when: definition.when ?? [],
@@ -20393,23 +20525,6 @@ var testLoop = (loop, script) => {
20393
20525
  };
20394
20526
  }).pipe(provide4(workflow.toLayer(execute).pipe(provideMerge(layerMemory))));
20395
20527
  };
20396
- // ../../packages/sdk/src/loop/review.ts
20397
- var Severity = Literals(["blocker", "major", "minor"]);
20398
- var Finding = Struct({
20399
- severity: Severity,
20400
- file: String5,
20401
- line: Int,
20402
- detail: String5
20403
- });
20404
- var MergedFinding = Struct({
20405
- id: String5,
20406
- ...Finding.fields,
20407
- seats: ArraySchema(String5),
20408
- blockingSeats: optionalKey2(ArraySchema(String5))
20409
- });
20410
- var Rebuttal = Struct({ findingId: String5, reason: String5 });
20411
- var RebuttalVerdict = Struct({ findingId: String5, accepted: Boolean3 });
20412
- var ScopeJudgement = Struct({ met: Boolean3, unmet: ArraySchema(String5) });
20413
20528
  // ../../packages/sdk/src/loop/check.ts
20414
20529
  class CheckFailed extends TaggedError3()("CheckFailed", {
20415
20530
  loop: String5,
@@ -25616,4 +25731,4 @@ var runKit = (config, identity, packages) => {
25616
25731
  runMain2(program.pipe(flatMap3((code) => sync2(() => process.exit(code)))));
25617
25732
  };
25618
25733
  // .kitman-build-entry.ts
25619
- runKit(kitman_config_default, { name: "@kitman-sh/go-to-market", version: "0.14.7" }, []);
25734
+ runKit(kitman_config_default, { name: "@kitman-sh/go-to-market", version: "0.14.9" }, []);
@@ -4,7 +4,7 @@
4
4
  "carried": [
5
5
  {
6
6
  "name": "@kitman-sh/go-to-market",
7
- "version": "0.14.7",
7
+ "version": "0.14.9",
8
8
  "setup": "0270b1c80a2c382c905693fede77fcb29c404d97404546c95d45de274fa6b087",
9
9
  "loops": [],
10
10
  "agents": []
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@kitman-sh/go-to-market",
3
- "version": "0.14.7",
3
+ "version": "0.14.9",
4
4
  "description": "Copywriting, marketing psychology and SEO audits.",
5
5
  "type": "module",
6
6
  "license": "SEE LICENSE IN LICENSE.md",
@@ -15,11 +15,11 @@
15
15
  "LICENSE.md"
16
16
  ],
17
17
  "dependencies": {
18
- "@kitman-sh/sdk": "0.14.7"
18
+ "@kitman-sh/sdk": "0.14.9"
19
19
  },
20
20
  "kitman": {
21
21
  "bundle": "dist/bundle.js",
22
- "digest": "0b5d4d43720b83b4f3c689a72345fcab0defadb22623e365a37f976798a43e46",
22
+ "digest": "ea256e44a983b4c4c18be725cc954a1c1ad0ff6f49a5c802ed152b7540d28f79",
23
23
  "protocolVersion": 5,
24
24
  "declarations": "dist/declarations.json",
25
25
  "setup": {