@inhuman.tools/plexus-expectations 0.1.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/dist/driver/actor-machine.d.ts +1 -1
- package/dist/driver/actor-machine.d.ts.map +1 -1
- package/dist/executor/kernel-intern.d.ts.map +1 -1
- package/dist/executor/kernel-intern.js +11 -5
- package/dist/executor/kernel-intern.js.map +1 -1
- package/dist/executor/orchestrator.d.ts +1 -0
- package/dist/executor/orchestrator.d.ts.map +1 -1
- package/dist/executor/orchestrator.js +18 -7
- package/dist/executor/orchestrator.js.map +1 -1
- package/package.json +10 -10
- package/src/executor/kernel-intern.ts +12 -5
- package/src/executor/orchestrator.ts +15 -7
- package/dist/driver/PEWDriverConnection.d.ts +0 -139
- package/dist/driver/PEWDriverConnection.d.ts.map +0 -1
- package/dist/driver/PEWDriverConnection.js +0 -298
- package/dist/driver/PEWDriverConnection.js.map +0 -1
- package/dist/error-with-invariant.d.ts +0 -9
- package/dist/error-with-invariant.d.ts.map +0 -1
- package/dist/error-with-invariant.js +0 -12
- package/dist/error-with-invariant.js.map +0 -1
- package/dist/shared/attention.d.ts +0 -27
- package/dist/shared/attention.d.ts.map +0 -1
- package/dist/shared/attention.js +0 -116
- package/dist/shared/attention.js.map +0 -1
- package/dist/shared/models/ApprovableExpectation.d.ts +0 -15
- package/dist/shared/models/ApprovableExpectation.d.ts.map +0 -1
- package/dist/shared/models/ApprovableExpectation.js +0 -138
- package/dist/shared/models/ApprovableExpectation.js.map +0 -1
- package/dist/shared/models/IntrospectingPlexusModel.d.ts +0 -8
- package/dist/shared/models/IntrospectingPlexusModel.d.ts.map +0 -1
- package/dist/shared/models/IntrospectingPlexusModel.js +0 -48
- package/dist/shared/models/IntrospectingPlexusModel.js.map +0 -1
- package/dist/shared/models/ProgrammaticJob.d.ts +0 -6
- package/dist/shared/models/ProgrammaticJob.d.ts.map +0 -1
- package/dist/shared/models/ProgrammaticJob.js +0 -80
- package/dist/shared/models/ProgrammaticJob.js.map +0 -1
- package/dist/shared/models/WorkExpectationWithIntrospection.d.ts +0 -4
- package/dist/shared/models/WorkExpectationWithIntrospection.d.ts.map +0 -1
- package/dist/shared/models/WorkExpectationWithIntrospection.js +0 -28
- package/dist/shared/models/WorkExpectationWithIntrospection.js.map +0 -1
- package/dist/shared/resolution.d.ts +0 -39
- package/dist/shared/resolution.d.ts.map +0 -1
- package/dist/shared/resolution.js +0 -124
- package/dist/shared/resolution.js.map +0 -1
package/dist/shared/attention.js
DELETED
|
@@ -1,116 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Attention occupancy. Clients publish on kernel awareness; PEW reduces to
|
|
3
|
-
* none | ambient | focused. Interned connections outlive a session wrap, so
|
|
4
|
-
* occupancy is not session-plane. Drivers read the reduced token — never clientIds.
|
|
5
|
-
*/
|
|
6
|
-
import { FieldAwareness } from "@here.build/plexus";
|
|
7
|
-
import { ConnectionSpec } from "./models/ConnectionSpec.js";
|
|
8
|
-
import { DriverSpec } from "./models/DriverSpec.js";
|
|
9
|
-
export const ATTENTION_LANE = "attention";
|
|
10
|
-
export const ATTENTION_FOCUS_LANE = "attentionFocus";
|
|
11
|
-
export function attentionRefFromSpec(spec) {
|
|
12
|
-
if (isConnectionSubject(spec))
|
|
13
|
-
return { kind: "connection", id: spec.id };
|
|
14
|
-
return { kind: "driver", name: spec.name };
|
|
15
|
-
}
|
|
16
|
-
export function collectAttentionRefs(source) {
|
|
17
|
-
if (source == null)
|
|
18
|
-
return [];
|
|
19
|
-
if (isAttentionSubject(source))
|
|
20
|
-
return [attentionRefFromSpec(source)];
|
|
21
|
-
const out = [];
|
|
22
|
-
const seen = new Set();
|
|
23
|
-
for (const item of source) {
|
|
24
|
-
if (item == null || !isAttentionSubject(item))
|
|
25
|
-
continue;
|
|
26
|
-
const ref = attentionRefFromSpec(item);
|
|
27
|
-
const key = refKey(ref);
|
|
28
|
-
if (seen.has(key))
|
|
29
|
-
continue;
|
|
30
|
-
seen.add(key);
|
|
31
|
-
out.push(ref);
|
|
32
|
-
}
|
|
33
|
-
return out;
|
|
34
|
-
}
|
|
35
|
-
export function publishAttention(hub, refs) {
|
|
36
|
-
const lane = new FieldAwareness(hub, ATTENTION_LANE);
|
|
37
|
-
if (refs.length === 0) {
|
|
38
|
-
lane.clear();
|
|
39
|
-
return;
|
|
40
|
-
}
|
|
41
|
-
lane.set(refs);
|
|
42
|
-
}
|
|
43
|
-
export function publishAttentionFocus(hub, ref) {
|
|
44
|
-
const lane = new FieldAwareness(hub, ATTENTION_FOCUS_LANE);
|
|
45
|
-
if (ref == null) {
|
|
46
|
-
lane.clear();
|
|
47
|
-
return;
|
|
48
|
-
}
|
|
49
|
-
lane.set(ref);
|
|
50
|
-
}
|
|
51
|
-
/** Union of every client's occupancy. Focused wins over ambient. */
|
|
52
|
-
export function attentionOf(hub, target) {
|
|
53
|
-
const focus = new FieldAwareness(hub, ATTENTION_FOCUS_LANE);
|
|
54
|
-
for (const clientId of focus.clientIds) {
|
|
55
|
-
const value = asAttentionRef(focus.getOther(clientId));
|
|
56
|
-
if (value != null && sameRef(value, target))
|
|
57
|
-
return "focused";
|
|
58
|
-
}
|
|
59
|
-
const ambient = new FieldAwareness(hub, ATTENTION_LANE);
|
|
60
|
-
for (const clientId of ambient.clientIds) {
|
|
61
|
-
const list = asAttentionRefList(ambient.getOther(clientId));
|
|
62
|
-
if (list.some((item) => sameRef(item, target)))
|
|
63
|
-
return "ambient";
|
|
64
|
-
}
|
|
65
|
-
return "none";
|
|
66
|
-
}
|
|
67
|
-
function isConnectionSubject(spec) {
|
|
68
|
-
if (spec instanceof ConnectionSpec)
|
|
69
|
-
return true;
|
|
70
|
-
if (spec instanceof DriverSpec)
|
|
71
|
-
return false;
|
|
72
|
-
return "driver" in spec && "configuration" in spec;
|
|
73
|
-
}
|
|
74
|
-
function isAttentionSubject(value) {
|
|
75
|
-
if (value instanceof ConnectionSpec || value instanceof DriverSpec)
|
|
76
|
-
return true;
|
|
77
|
-
if (typeof value !== "object" || value === null)
|
|
78
|
-
return false;
|
|
79
|
-
if ("driver" in value && "configuration" in value)
|
|
80
|
-
return true;
|
|
81
|
-
return "importPath" in value && "can" in value;
|
|
82
|
-
}
|
|
83
|
-
function asAttentionRef(value) {
|
|
84
|
-
if (typeof value !== "object" || value === null)
|
|
85
|
-
return null;
|
|
86
|
-
const rec = value;
|
|
87
|
-
if (rec.kind === "driver" && typeof rec.name === "string" && rec.name !== "") {
|
|
88
|
-
return { kind: "driver", name: rec.name };
|
|
89
|
-
}
|
|
90
|
-
if (rec.kind === "connection" && typeof rec.id === "string" && rec.id !== "") {
|
|
91
|
-
return { kind: "connection", id: rec.id };
|
|
92
|
-
}
|
|
93
|
-
return null;
|
|
94
|
-
}
|
|
95
|
-
function asAttentionRefList(value) {
|
|
96
|
-
if (!Array.isArray(value))
|
|
97
|
-
return [];
|
|
98
|
-
const out = [];
|
|
99
|
-
for (const item of value) {
|
|
100
|
-
const ref = asAttentionRef(item);
|
|
101
|
-
if (ref != null)
|
|
102
|
-
out.push(ref);
|
|
103
|
-
}
|
|
104
|
-
return out;
|
|
105
|
-
}
|
|
106
|
-
function sameRef(a, b) {
|
|
107
|
-
if (a.kind === "driver" && b.kind === "driver")
|
|
108
|
-
return a.name === b.name;
|
|
109
|
-
if (a.kind === "connection" && b.kind === "connection")
|
|
110
|
-
return a.id === b.id;
|
|
111
|
-
return false;
|
|
112
|
-
}
|
|
113
|
-
function refKey(ref) {
|
|
114
|
-
return ref.kind === "driver" ? `driver:${ref.name}` : `connection:${ref.id}`;
|
|
115
|
-
}
|
|
116
|
-
//# sourceMappingURL=attention.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"attention.js","sourceRoot":"","sources":["../../src/shared/attention.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AACH,OAAO,EAAE,cAAc,EAAwB,MAAM,oBAAoB,CAAC;AAE1E,OAAO,EAAE,cAAc,EAAE,MAAM,4B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AAC;IAC5C,CAAC;IACD,OAAO,IAAI,CAAC;AACd,CAAC;AAED,SAAS,kBAAkB,CAAC,KAAc;IACxC,IAAI,CAAC,KAAK,CAAC,OAAO,CAAC,KAAK,CAAC;QAAE,OAAO,EAAE,CAAC;IACrC,MAAM,GAAG,GAAmB,EAAE,CAAC;IAC/B,KAAK,MAAM,IAAI,IAAI,KAAK,EAAE,CAAC;QACzB,MAAM,GAAG,GAAG,cAAc,CAAC,IAAI,CAAC,CAAC;QACjC,IAAI,GAAG,IAAI,IAAI;YAAE,GAAG,CAAC,IAAI,CAAC,GAAG,CAAC,CAAC;IACjC,CAAC;IACD,OAAO,GAAG,CAAC;AACb,CAAC;AAED,SAAS,OAAO,CAAC,CAAe,EAAE,CAAe;IAC/C,IAAI,CAAC,CAAC,IAAI,KAAK,QAAQ,IAAI,CAAC,CAAC,IAAI,KAAK,QAAQ;QAAE,OAAO,CAAC,CAAC,IAAI,KAAK,CAAC,CAAC,IAAI,CAAC;IACzE,IAAI,CAAC,CAAC,IAAI,KAAK,YAAY,IAAI,CAAC,CAAC,IAAI,KAAK,YAAY;QAAE,OAAO,CAAC,CAAC,EAAE,KAAK,CAAC,CAAC,EAAE,CAAC;IAC7E,OAAO,KAAK,CAAC;AACf,CAAC;AAED,SAAS,MAAM,CAAC,GAAiB;IAC/B,OAAO,GAAG,CAAC,IAAI,KAAK,QAAQ,CAAC,CAAC,CAAC,UAAU,GAAG,CAAC,IAAI,EAAE,CAAC,CAAC,CAAC,cAAc,GAAG,CAAC,EAAE,EAAE,CAAC;AAC/E,CAAC","sourcesContent":["/**\n * Attention occupancy. Clients publish on kernel awareness; PEW reduces to\n * none | ambient | focused. Interned connections outlive a session wrap, so\n * occupancy is not session-plane. Drivers read the reduced token — never clientIds.\n */\nimport { FieldAwareness, type PlexusAwareness } from \"@here.build/plexus\";\n\nimport { ConnectionSpec } from \"./models/ConnectionSpec.js\";\nimport { DriverSpec } from \"./models/DriverSpec.js\";\n\nexport type Attention = \"none\" | \"ambient\" | \"focused\";\n\nexport const ATTENTION_LANE = \"attention\";\nexport const ATTENTION_FOCUS_LANE = \"attentionFocus\";\n\nexport type AttentionRef =\n | { readonly kind: \"driver\"; readonly name: string }\n | { readonly kind: \"connection\"; readonly id: string };\n\nexport type AttentionSubject = DriverSpec | ConnectionSpec;\n\nexport type AttentionSource = AttentionSubject | Iterable<AttentionSubject | null | undefined> | null | undefined;\n\nexport function attentionRefFromSpec(spec: AttentionSubject): AttentionRef {\n if (isConnectionSubject(spec)) return { kind: \"connection\", id: spec.id };\n return { kind: \"driver\", name: spec.name };\n}\n\nexport function collectAttentionRefs(source: AttentionSource): AttentionRef[] {\n if (source == null) return [];\n if (isAttentionSubject(source)) return [attentionRefFromSpec(source)];\n const out: AttentionRef[] = [];\n const seen = new Set<string>();\n for (const item of source) {\n if (item == null || !isAttentionSubject(item)) continue;\n const ref = attentionRefFromSpec(item);\n const key = refKey(ref);\n if (seen.has(key)) continue;\n seen.add(key);\n out.push(ref);\n }\n return out;\n}\n\nexport function publishAttention(hub: PlexusAwareness, refs: readonly AttentionRef[]): void {\n const lane = new FieldAwareness(hub, ATTENTION_LANE);\n if (refs.length === 0) {\n lane.clear();\n return;\n }\n lane.set(refs as never);\n}\n\nexport function publishAttentionFocus(hub: PlexusAwareness, ref: AttentionRef | null): void {\n const lane = new FieldAwareness(hub, ATTENTION_FOCUS_LANE);\n if (ref == null) {\n lane.clear();\n return;\n }\n lane.set(ref as never);\n}\n\n/** Union of every client's occupancy. Focused wins over ambient. */\nexport function attentionOf(hub: PlexusAwareness, target: AttentionRef): Attention {\n const focus = new FieldAwareness(hub, ATTENTION_FOCUS_LANE);\n for (const clientId of focus.clientIds) {\n const value = asAttentionRef(focus.getOther(clientId));\n if (value != null && sameRef(value, target)) return \"focused\";\n }\n const ambient = new FieldAwareness(hub, ATTENTION_LANE);\n for (const clientId of ambient.clientIds) {\n const list = asAttentionRefList(ambient.getOther(clientId));\n if (list.some((item) => sameRef(item, target))) return \"ambient\";\n }\n return \"none\";\n}\n\nfunction isConnectionSubject(spec: AttentionSubject): spec is ConnectionSpec {\n if (spec instanceof ConnectionSpec) return true;\n if (spec instanceof DriverSpec) return false;\n return \"driver\" in spec && \"configuration\" in spec;\n}\n\nfunction isAttentionSubject(value: unknown): value is AttentionSubject {\n if (value instanceof ConnectionSpec || value instanceof DriverSpec) return true;\n if (typeof value !== \"object\" || value === null) return false;\n if (\"driver\" in value && \"configuration\" in value) return true;\n return \"importPath\" in value && \"can\" in value;\n}\n\nfunction asAttentionRef(value: unknown): AttentionRef | null {\n if (typeof value !== \"object\" || value === null) return null;\n const rec = value as { kind?: unknown; name?: unknown; id?: unknown };\n if (rec.kind === \"driver\" && typeof rec.name === \"string\" && rec.name !== \"\") {\n return { kind: \"driver\", name: rec.name };\n }\n if (rec.kind === \"connection\" && typeof rec.id === \"string\" && rec.id !== \"\") {\n return { kind: \"connection\", id: rec.id };\n }\n return null;\n}\n\nfunction asAttentionRefList(value: unknown): AttentionRef[] {\n if (!Array.isArray(value)) return [];\n const out: AttentionRef[] = [];\n for (const item of value) {\n const ref = asAttentionRef(item);\n if (ref != null) out.push(ref);\n }\n return out;\n}\n\nfunction sameRef(a: AttentionRef, b: AttentionRef): boolean {\n if (a.kind === \"driver\" && b.kind === \"driver\") return a.name === b.name;\n if (a.kind === \"connection\" && b.kind === \"connection\") return a.id === b.id;\n return false;\n}\n\nfunction refKey(ref: AttentionRef): string {\n return ref.kind === \"driver\" ? `driver:${ref.name}` : `connection:${ref.id}`;\n}\n"]}
|
|
@@ -1,15 +0,0 @@
|
|
|
1
|
-
import { WorkExpectation } from "./WorkExpectation.js";
|
|
2
|
-
export declare abstract class ApprovableExpectation<TResult = unknown, TReport = unknown, TProposal = never> extends WorkExpectation<TResult, TReport, TProposal> {
|
|
3
|
-
accessor policyResult: Record<string, string>;
|
|
4
|
-
accessor policyAsk: Record<string, string>;
|
|
5
|
-
accessor explicitApprovalResult: true | false | null;
|
|
6
|
-
accessor judges: Record<string, WorkExpectation>;
|
|
7
|
-
policyResultOf(id: string): boolean | null;
|
|
8
|
-
writePolicyResult(id: string, value: boolean): void;
|
|
9
|
-
policyAskOf(id: string): boolean;
|
|
10
|
-
writePolicyAsk(id: string): void;
|
|
11
|
-
effectiveApproval(id: string): boolean | null;
|
|
12
|
-
get approvalWork(): readonly WorkExpectation[];
|
|
13
|
-
get work(): readonly WorkExpectation[];
|
|
14
|
-
}
|
|
15
|
-
//# sourceMappingURL=ApprovableExpectation.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"ApprovableExpectation.d.ts","sourceRoot":"","sources":["../../../src/shared/models/ApprovableExpectation.ts"],"names":[],"mappings":"AAeA,OAAO,EAAE,eAAe,EAAE,MAAM,sBAAsB,CAAC;AAEvD,8BACsB,qBAAqB,CACzC,OAAO,GAAG,OAAO,EACjB,OAAO,GAAG,OAAO,EACjB,SAAS,GAAG,KAAK,CACjB,SAAQ,eAAe,CAAC,OAAO,EAAE,OAAO,EAAE,SAAS,CAAC;IAEpD,QAAQ,CAAC,YAAY,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,CAAM;IAGnD,QAAQ,CAAC,SAAS,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,CAAM;IAGhD,QAAQ,CAAC,sBAAsB,EAAE,IAAI,GAAG,KAAK,GAAG,IAAI,CAAQ;IAG5D,QAAQ,CAAC,MAAM,EAAE,MAAM,CAAC,MAAM,EAAE,eAAe,CAAC,CAAM;IAEtD,cAAc,CAAC,EAAE,EAAE,MAAM,GAAG,OAAO,GAAG,IAAI,CAKzC;IAED,iBAAiB,CAAC,EAAE,EAAE,MAAM,EAAE,KAAK,EAAE,OAAO,GAAG,IAAI,CAElD;IAED,WAAW,CAAC,EAAE,EAAE,MAAM,GAAG,OAAO,CAE/B;IAED,cAAc,CAAC,EAAE,EAAE,MAAM,GAAG,IAAI,CAE/B;IAED,iBAAiB,CAAC,EAAE,EAAE,MAAM,GAAG,OAAO,GAAG,IAAI,CAG5C;IAED,IAAI,YAAY,IAAI,SAAS,eAAe,EAAE,CAE7C;IAED,IACa,IAAI,IAAI,SAAS,eAAe,EAAE,CAE9C;CACF"}
|
|
@@ -1,138 +0,0 @@
|
|
|
1
|
-
var __runInitializers = (this && this.__runInitializers) || function (thisArg, initializers, value) {
|
|
2
|
-
var useValue = arguments.length > 2;
|
|
3
|
-
for (var i = 0; i < initializers.length; i++) {
|
|
4
|
-
value = useValue ? initializers[i].call(thisArg, value) : initializers[i].call(thisArg);
|
|
5
|
-
}
|
|
6
|
-
return useValue ? value : void 0;
|
|
7
|
-
};
|
|
8
|
-
var __esDecorate = (this && this.__esDecorate) || function (ctor, descriptorIn, decorators, contextIn, initializers, extraInitializers) {
|
|
9
|
-
function accept(f) { if (f !== void 0 && typeof f !== "function") throw new TypeError("Function expected"); return f; }
|
|
10
|
-
var kind = contextIn.kind, key = kind === "getter" ? "get" : kind === "setter" ? "set" : "value";
|
|
11
|
-
var target = !descriptorIn && ctor ? contextIn["static"] ? ctor : ctor.prototype : null;
|
|
12
|
-
var descriptor = descriptorIn || (target ? Object.getOwnPropertyDescriptor(target, contextIn.name) : {});
|
|
13
|
-
var _, done = false;
|
|
14
|
-
for (var i = decorators.length - 1; i >= 0; i--) {
|
|
15
|
-
var context = {};
|
|
16
|
-
for (var p in contextIn) context[p] = p === "access" ? {} : contextIn[p];
|
|
17
|
-
for (var p in contextIn.access) context.access[p] = contextIn.access[p];
|
|
18
|
-
context.addInitializer = function (f) { if (done) throw new TypeError("Cannot add initializers after decoration has completed"); extraInitializers.push(accept(f || null)); };
|
|
19
|
-
var result = (0, decorators[i])(kind === "accessor" ? { get: descriptor.get, set: descriptor.set } : descriptor[key], context);
|
|
20
|
-
if (kind === "accessor") {
|
|
21
|
-
if (result === void 0) continue;
|
|
22
|
-
if (result === null || typeof result !== "object") throw new TypeError("Object expected");
|
|
23
|
-
if (_ = accept(result.get)) descriptor.get = _;
|
|
24
|
-
if (_ = accept(result.set)) descriptor.set = _;
|
|
25
|
-
if (_ = accept(result.init)) initializers.unshift(_);
|
|
26
|
-
}
|
|
27
|
-
else if (_ = accept(result)) {
|
|
28
|
-
if (kind === "field") initializers.unshift(_);
|
|
29
|
-
else descriptor[key] = _;
|
|
30
|
-
}
|
|
31
|
-
}
|
|
32
|
-
if (target) Object.defineProperty(target, contextIn.name, descriptor);
|
|
33
|
-
done = true;
|
|
34
|
-
};
|
|
35
|
-
/**
|
|
36
|
-
* Work that always runs the approval flow.
|
|
37
|
-
*
|
|
38
|
-
* `id` is an argument — this model does not read SessionRoot. Explicit wins
|
|
39
|
-
* when not null. `judges` is a child record of WorkExpectation so PEW does
|
|
40
|
-
* not import harness (runtime: harness CompletionExpectation).
|
|
41
|
-
*
|
|
42
|
-
* Per-policy facts are string records (`"true"` | `"false"`; absent = unset)
|
|
43
|
-
* because live `@syncing.record` bags are `Record<string, string>`.
|
|
44
|
-
*
|
|
45
|
-
* docs/design/approval.md
|
|
46
|
-
*/
|
|
47
|
-
import { syncing } from "@here.build/plexus";
|
|
48
|
-
import { computed } from "mobx";
|
|
49
|
-
import { WorkExpectation } from "./WorkExpectation.js";
|
|
50
|
-
let ApprovableExpectation = (() => {
|
|
51
|
-
var _a, _b, _c;
|
|
52
|
-
let _classDecorators = [syncing("@inhuman.tools/plexus-expectations:ApprovableExpectation")];
|
|
53
|
-
let _classDescriptor;
|
|
54
|
-
let _classExtraInitializers = [];
|
|
55
|
-
let _classThis;
|
|
56
|
-
let _classSuper = WorkExpectation;
|
|
57
|
-
let _instanceExtraInitializers = [];
|
|
58
|
-
let _policyResult_decorators;
|
|
59
|
-
let _policyResult_initializers = [];
|
|
60
|
-
let _policyResult_extraInitializers = [];
|
|
61
|
-
let _policyAsk_decorators;
|
|
62
|
-
let _policyAsk_initializers = [];
|
|
63
|
-
let _policyAsk_extraInitializers = [];
|
|
64
|
-
let _explicitApprovalResult_decorators;
|
|
65
|
-
let _explicitApprovalResult_initializers = [];
|
|
66
|
-
let _explicitApprovalResult_extraInitializers = [];
|
|
67
|
-
let _judges_decorators;
|
|
68
|
-
let _judges_initializers = [];
|
|
69
|
-
let _judges_extraInitializers = [];
|
|
70
|
-
let _get_work_decorators;
|
|
71
|
-
var ApprovableExpectation = class extends _classSuper {
|
|
72
|
-
static { _classThis = this; }
|
|
73
|
-
static {
|
|
74
|
-
const _metadata = typeof Symbol === "function" && Symbol.metadata ? Object.create(_classSuper[Symbol.metadata] ?? null) : void 0;
|
|
75
|
-
_policyResult_decorators = [(_a = syncing).record.bind(_a)];
|
|
76
|
-
_policyAsk_decorators = [(_b = syncing).record.bind(_b)];
|
|
77
|
-
_explicitApprovalResult_decorators = [syncing];
|
|
78
|
-
_judges_decorators = [(_c = syncing.child).record.bind(_c)];
|
|
79
|
-
_get_work_decorators = [computed];
|
|
80
|
-
__esDecorate(this, null, _policyResult_decorators, { kind: "accessor", name: "policyResult", static: false, private: false, access: { has: obj => "policyResult" in obj, get: obj => obj.policyResult, set: (obj, value) => { obj.policyResult = value; } }, metadata: _metadata }, _policyResult_initializers, _policyResult_extraInitializers);
|
|
81
|
-
__esDecorate(this, null, _policyAsk_decorators, { kind: "accessor", name: "policyAsk", static: false, private: false, access: { has: obj => "policyAsk" in obj, get: obj => obj.policyAsk, set: (obj, value) => { obj.policyAsk = value; } }, metadata: _metadata }, _policyAsk_initializers, _policyAsk_extraInitializers);
|
|
82
|
-
__esDecorate(this, null, _explicitApprovalResult_decorators, { kind: "accessor", name: "explicitApprovalResult", static: false, private: false, access: { has: obj => "explicitApprovalResult" in obj, get: obj => obj.explicitApprovalResult, set: (obj, value) => { obj.explicitApprovalResult = value; } }, metadata: _metadata }, _explicitApprovalResult_initializers, _explicitApprovalResult_extraInitializers);
|
|
83
|
-
__esDecorate(this, null, _judges_decorators, { kind: "accessor", name: "judges", static: false, private: false, access: { has: obj => "judges" in obj, get: obj => obj.judges, set: (obj, value) => { obj.judges = value; } }, metadata: _metadata }, _judges_initializers, _judges_extraInitializers);
|
|
84
|
-
__esDecorate(this, null, _get_work_decorators, { kind: "getter", name: "work", static: false, private: false, access: { has: obj => "work" in obj, get: obj => obj.work }, metadata: _metadata }, null, _instanceExtraInitializers);
|
|
85
|
-
__esDecorate(null, _classDescriptor = { value: _classThis }, _classDecorators, { kind: "class", name: _classThis.name, metadata: _metadata }, null, _classExtraInitializers);
|
|
86
|
-
ApprovableExpectation = _classThis = _classDescriptor.value;
|
|
87
|
-
if (_metadata) Object.defineProperty(_classThis, Symbol.metadata, { enumerable: true, configurable: true, writable: true, value: _metadata });
|
|
88
|
-
__runInitializers(_classThis, _classExtraInitializers);
|
|
89
|
-
}
|
|
90
|
-
#policyResult_accessor_storage = (__runInitializers(this, _instanceExtraInitializers), __runInitializers(this, _policyResult_initializers, {}));
|
|
91
|
-
get policyResult() { return this.#policyResult_accessor_storage; }
|
|
92
|
-
set policyResult(value) { this.#policyResult_accessor_storage = value; }
|
|
93
|
-
#policyAsk_accessor_storage = (__runInitializers(this, _policyResult_extraInitializers), __runInitializers(this, _policyAsk_initializers, {}));
|
|
94
|
-
get policyAsk() { return this.#policyAsk_accessor_storage; }
|
|
95
|
-
set policyAsk(value) { this.#policyAsk_accessor_storage = value; }
|
|
96
|
-
#explicitApprovalResult_accessor_storage = (__runInitializers(this, _policyAsk_extraInitializers), __runInitializers(this, _explicitApprovalResult_initializers, null));
|
|
97
|
-
get explicitApprovalResult() { return this.#explicitApprovalResult_accessor_storage; }
|
|
98
|
-
set explicitApprovalResult(value) { this.#explicitApprovalResult_accessor_storage = value; }
|
|
99
|
-
#judges_accessor_storage = (__runInitializers(this, _explicitApprovalResult_extraInitializers), __runInitializers(this, _judges_initializers, {}));
|
|
100
|
-
get judges() { return this.#judges_accessor_storage; }
|
|
101
|
-
set judges(value) { this.#judges_accessor_storage = value; }
|
|
102
|
-
policyResultOf(id) {
|
|
103
|
-
const raw = this.policyResult[id];
|
|
104
|
-
if (raw === "true")
|
|
105
|
-
return true;
|
|
106
|
-
if (raw === "false")
|
|
107
|
-
return false;
|
|
108
|
-
return null;
|
|
109
|
-
}
|
|
110
|
-
writePolicyResult(id, value) {
|
|
111
|
-
this.policyResult[id] = value ? "true" : "false";
|
|
112
|
-
}
|
|
113
|
-
policyAskOf(id) {
|
|
114
|
-
return this.policyAsk[id] === "true";
|
|
115
|
-
}
|
|
116
|
-
writePolicyAsk(id) {
|
|
117
|
-
this.policyAsk[id] = "true";
|
|
118
|
-
}
|
|
119
|
-
effectiveApproval(id) {
|
|
120
|
-
if (this.explicitApprovalResult !== null)
|
|
121
|
-
return this.explicitApprovalResult;
|
|
122
|
-
return this.policyResultOf(id);
|
|
123
|
-
}
|
|
124
|
-
get approvalWork() {
|
|
125
|
-
return Object.values(this.judges);
|
|
126
|
-
}
|
|
127
|
-
get work() {
|
|
128
|
-
return [this, ...this.approvalWork];
|
|
129
|
-
}
|
|
130
|
-
constructor() {
|
|
131
|
-
super(...arguments);
|
|
132
|
-
__runInitializers(this, _judges_extraInitializers);
|
|
133
|
-
}
|
|
134
|
-
};
|
|
135
|
-
return ApprovableExpectation = _classThis;
|
|
136
|
-
})();
|
|
137
|
-
export { ApprovableExpectation };
|
|
138
|
-
//# sourceMappingURL=ApprovableExpectation.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"ApprovableExpectation.js","sourceRoot":"","sources":["../../../src/shared/models/ApprovableExpectation.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA;;;;;;;;;;;GAWG;AACH,OAAO,EAAE,OAAO,EAAE,MAAM,oBAAoB,CAAC;AAC7C,OAAO,EAAE,QAAQ,EAAE,MAAM,MAAM,CAAC;AAEhC,OAAO,EAAE,eAAe,EAAE,MAAM,sBAAsB,CAAC;IAGjC,qBAAqB;;4BAD1C,OAAO,CAAC,0DAA0D,CAAC;;;;sBAK1D,eAAe;;;;;;;;;;;;;;;qCAAvB,SAAQ,WAA4C;;;;wCACnD,CAAA,KAA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cAAc,CAAC,EAAU;YACvB,IAAI,CAAC,SAAS,CAAC,EAAE,CAAC,GAAG,MAAM,CAAC;QAC9B,CAAC;QAED,iBAAiB,CAAC,EAAU;YAC1B,IAAI,IAAI,CAAC,sBAAsB,KAAK,IAAI;gBAAE,OAAO,IAAI,CAAC,sBAAsB,CAAC;YAC7E,OAAO,IAAI,CAAC,cAAc,CAAC,EAAE,CAAC,CAAC;QACjC,CAAC;QAED,IAAI,YAAY;YACd,OAAO,MAAM,CAAC,MAAM,CAAC,IAAI,CAAC,MAAM,CAAC,CAAC;QACpC,CAAC;QAGD,IAAa,IAAI;YACf,OAAO,CAAC,IAAI,EAAE,GAAG,IAAI,CAAC,YAAY,CAAC,CAAC;QACtC,CAAC;;;;;;;;SAhDmB,qBAAqB","sourcesContent":["/**\n * Work that always runs the approval flow.\n *\n * `id` is an argument — this model does not read SessionRoot. Explicit wins\n * when not null. `judges` is a child record of WorkExpectation so PEW does\n * not import harness (runtime: harness CompletionExpectation).\n *\n * Per-policy facts are string records (`\"true\"` | `\"false\"`; absent = unset)\n * because live `@syncing.record` bags are `Record<string, string>`.\n *\n * docs/design/approval.md\n */\nimport { syncing } from \"@here.build/plexus\";\nimport { computed } from \"mobx\";\n\nimport { WorkExpectation } from \"./WorkExpectation.js\";\n\n@syncing(\"@inhuman.tools/plexus-expectations:ApprovableExpectation\")\nexport abstract class ApprovableExpectation<\n TResult = unknown,\n TReport = unknown,\n TProposal = never,\n> extends WorkExpectation<TResult, TReport, TProposal> {\n @syncing.record\n accessor policyResult: Record<string, string> = {};\n\n @syncing.record\n accessor policyAsk: Record<string, string> = {};\n\n @syncing\n accessor explicitApprovalResult: true | false | null = null;\n\n @syncing.child.record\n accessor judges: Record<string, WorkExpectation> = {};\n\n policyResultOf(id: string): boolean | null {\n const raw = this.policyResult[id];\n if (raw === \"true\") return true;\n if (raw === \"false\") return false;\n return null;\n }\n\n writePolicyResult(id: string, value: boolean): void {\n this.policyResult[id] = value ? \"true\" : \"false\";\n }\n\n policyAskOf(id: string): boolean {\n return this.policyAsk[id] === \"true\";\n }\n\n writePolicyAsk(id: string): void {\n this.policyAsk[id] = \"true\";\n }\n\n effectiveApproval(id: string): boolean | null {\n if (this.explicitApprovalResult !== null) return this.explicitApprovalResult;\n return this.policyResultOf(id);\n }\n\n get approvalWork(): readonly WorkExpectation[] {\n return Object.values(this.judges);\n }\n\n @computed\n override get work(): readonly WorkExpectation[] {\n return [this, ...this.approvalWork];\n }\n}\n"]}
|
|
@@ -1,8 +0,0 @@
|
|
|
1
|
-
import { type Plexus, type PlexusAwareness, PlexusModel } from "@here.build/plexus";
|
|
2
|
-
export type AwarenessOfPlexus<P extends Plexus<any, any>> = P extends Plexus<any, infer Awareness> ? Awareness : never;
|
|
3
|
-
export declare abstract class IntrospectingPlexusModel<P extends Plexus<any, any> = Plexus<any, any>, Parent extends PlexusModel | null = any> extends PlexusModel<Parent> {
|
|
4
|
-
get plexus(): P | null;
|
|
5
|
-
get awareness(): PlexusAwareness<AwarenessOfPlexus<P>> | null;
|
|
6
|
-
getUniqueLanePresence<T extends string & keyof AwarenessOfPlexus<P>>(lane: T): AwarenessOfPlexus<P>[T] | null;
|
|
7
|
-
}
|
|
8
|
-
//# sourceMappingURL=IntrospectingPlexusModel.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"IntrospectingPlexusModel.d.ts","sourceRoot":"","sources":["../../../src/shared/models/IntrospectingPlexusModel.ts"],"names":[],"mappings":"AAAA,OAAO,EAEL,KAAK,MAAM,EACX,KAAK,eAAe,EACpB,WAAW,EAEZ,MAAM,oBAAoB,CAAC;AAG5B,MAAM,MAAM,iBAAiB,CAAC,CAAC,SAAS,MAAM,CAAC,GAAG,EAAE,GAAG,CAAC,IAAI,CAAC,SAAS,MAAM,CAAC,GAAG,EAAE,MAAM,SAAS,CAAC,GAC9F,SAAS,GACT,KAAK,CAAC;AAEV,8BACsB,wBAAwB,CAC5C,CAAC,SAAS,MAAM,CAAC,GAAG,EAAE,GAAG,CAAC,GAAG,MAAM,CAAC,GAAG,EAAE,GAAG,CAAC,EAC7C,MAAM,SAAS,WAAW,GAAG,IAAI,GAAG,GAAG,CACvC,SAAQ,WAAW,CAAC,MAAM,CAAC;IAC3B,IAAI,MAAM,IAAI,CAAC,GAAG,IAAI,CAOrB;IAED,IAAI,SAAS,IAAI,eAAe,CAAC,iBAAiB,CAAC,CAAC,CAAC,CAAC,GAAG,IAAI,CAE5D;IAED,qBAAqB,CAAC,CAAC,SAAS,MAAM,GAAG,MAAM,iBAAiB,CAAC,CAAC,CAAC,EAAE,IAAI,EAAE,CAAC,GAAG,iBAAiB,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,GAAG,IAAI,CAS5G;CACF"}
|
|
@@ -1,48 +0,0 @@
|
|
|
1
|
-
import { __esDecorate, __runInitializers } from "tslib";
|
|
2
|
-
import { FieldAwareness, PlexusModel, syncing, } from "@here.build/plexus";
|
|
3
|
-
import { docPlexus } from "@here.build/plexus/internals";
|
|
4
|
-
let IntrospectingPlexusModel = (() => {
|
|
5
|
-
let _classDecorators = [syncing("@inhuman.tools/plexus-expectations:IntrospectingPlexusModel")];
|
|
6
|
-
let _classDescriptor;
|
|
7
|
-
let _classExtraInitializers = [];
|
|
8
|
-
let _classThis;
|
|
9
|
-
let _classSuper = PlexusModel;
|
|
10
|
-
var IntrospectingPlexusModel = class extends _classSuper {
|
|
11
|
-
static { _classThis = this; }
|
|
12
|
-
static {
|
|
13
|
-
const _metadata = typeof Symbol === "function" && Symbol.metadata ? Object.create(_classSuper[Symbol.metadata] ?? null) : void 0;
|
|
14
|
-
__esDecorate(null, _classDescriptor = { value: _classThis }, _classDecorators, { kind: "class", name: _classThis.name, metadata: _metadata }, null, _classExtraInitializers);
|
|
15
|
-
IntrospectingPlexusModel = _classThis = _classDescriptor.value;
|
|
16
|
-
if (_metadata) Object.defineProperty(_classThis, Symbol.metadata, { enumerable: true, configurable: true, writable: true, value: _metadata });
|
|
17
|
-
__runInitializers(_classThis, _classExtraInitializers);
|
|
18
|
-
}
|
|
19
|
-
get plexus() {
|
|
20
|
-
const doc = this.__doc__;
|
|
21
|
-
if (!doc)
|
|
22
|
-
return null;
|
|
23
|
-
const plexus = docPlexus.get(doc);
|
|
24
|
-
if (!plexus)
|
|
25
|
-
return null;
|
|
26
|
-
// docPlexus is untyped over root/awareness — narrow at the entity boundary.
|
|
27
|
-
return plexus;
|
|
28
|
-
}
|
|
29
|
-
get awareness() {
|
|
30
|
-
return this.plexus?.awareness ?? null;
|
|
31
|
-
}
|
|
32
|
-
getUniqueLanePresence(lane) {
|
|
33
|
-
const hub = this.awareness;
|
|
34
|
-
if (hub == null)
|
|
35
|
-
return null;
|
|
36
|
-
const field = new FieldAwareness(hub, lane);
|
|
37
|
-
for (const id of field.clientIds) {
|
|
38
|
-
const value = field.getOther(id);
|
|
39
|
-
if (value !== undefined)
|
|
40
|
-
return value;
|
|
41
|
-
}
|
|
42
|
-
return null;
|
|
43
|
-
}
|
|
44
|
-
};
|
|
45
|
-
return IntrospectingPlexusModel = _classThis;
|
|
46
|
-
})();
|
|
47
|
-
export { IntrospectingPlexusModel };
|
|
48
|
-
//# sourceMappingURL=IntrospectingPlexusModel.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"IntrospectingPlexusModel.js","sourceRoot":"","sources":["../../../src/shared/models/IntrospectingPlexusModel.ts"],"names":[],"mappings":";AAAA,OAAO,EACL,cAAc,EAGd,WAAW,EACX,OAAO,GACR,MAAM,oBAAoB,CAAC;AAC5B,OAAO,EAAE,SAAS,EAAE,MAAM,8BAA8B,CAAC;IAOnC,wBAAwB;4BAD7C,OAAO,CAAC,6DAA6D,CAAC;;;;sBAI7D,WAAW;wCAAnB,SAAQ,WAAmB;;;;YAH7B,6KA2BC;;;YA3BqB,uDAAwB;;QAI5C,IAAI,MAAM;YACR,MAAM,GAAG,GAAG,IAAI,CAAC,OAAO,CAAC;YACzB,IAAI,CAAC,GAAG;gBAAE,OAAO,IAAI,CAAC;YACtB,MAAM,MAAM,GAAG,SAAS,CAAC,GAAG,CAAC,GAAG,CAAC,CAAC;YAClC,IAAI,CAAC,MAAM;gBAAE,OAAO,IAAI,CAAC;YACzB,4EAA4E;YAC5E,OAAO,MAAW,CAAC;QACrB,CAAC;QAED,IAAI,SAAS;YACX,OAAO,IAAI,CAAC,MAAM,EAAE,SAAS,IAAI,IAAI,CAAC;QACxC,CAAC;QAED,qBAAqB,CAAgD,IAAO;YAC1E,MAAM,GAAG,GAAG,IAAI,CAAC,SAAS,CAAC;YAC3B,IAAI,GAAG,IAAI,IAAI;gBAAE,OAAO,IAAI,CAAC;YAC7B,MAAM,KAAK,GAAG,IAAI,cAAc,CAAC,GAAG,EAAE,IAAI,CAAC,CAAC;YAC5C,KAAK,MAAM,EAAE,IAAI,KAAK,CAAC,SAAS,EAAE,CAAC;gBACjC,MAAM,KAAK,GAAG,KAAK,CAAC,QAAQ,CAAC,EAAE,CAAC,CAAC;gBACjC,IAAI,KAAK,KAAK,SAAS;oBAAE,OAAO,KAAK,CAAC;YACxC,CAAC;YACD,OAAO,IAAI,CAAC;QACd,CAAC;;;;SA1BmB,wBAAwB","sourcesContent":["import {\n FieldAwareness,\n type Plexus,\n type PlexusAwareness,\n PlexusModel,\n syncing,\n} from \"@here.build/plexus\";\nimport { docPlexus } from \"@here.build/plexus/internals\";\n\nexport type AwarenessOfPlexus<P extends Plexus<any, any>> = P extends Plexus<any, infer Awareness>\n ? Awareness\n : never;\n\n@syncing(\"@inhuman.tools/plexus-expectations:IntrospectingPlexusModel\")\nexport abstract class IntrospectingPlexusModel<\n P extends Plexus<any, any> = Plexus<any, any>,\n Parent extends PlexusModel | null = any,\n> extends PlexusModel<Parent> {\n get plexus(): P | null {\n const doc = this.__doc__;\n if (!doc) return null;\n const plexus = docPlexus.get(doc);\n if (!plexus) return null;\n // docPlexus is untyped over root/awareness — narrow at the entity boundary.\n return plexus as P;\n }\n\n get awareness(): PlexusAwareness<AwarenessOfPlexus<P>> | null {\n return this.plexus?.awareness ?? null;\n }\n\n getUniqueLanePresence<T extends string & keyof AwarenessOfPlexus<P>>(lane: T): AwarenessOfPlexus<P>[T] | null {\n const hub = this.awareness;\n if (hub == null) return null;\n const field = new FieldAwareness(hub, lane);\n for (const id of field.clientIds) {\n const value = field.getOther(id);\n if (value !== undefined) return value;\n }\n return null;\n }\n}\n"]}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"ProgrammaticJob.d.ts","sourceRoot":"","sources":["../../../src/shared/models/ProgrammaticJob.ts"],"names":[],"mappings":"AAMA,OAAO,EAAE,GAAG,EAAE,MAAM,UAAU,CAAC;AAE/B,qBACa,eAAgB,SAAQ,GAAG;IAC7B,QAAQ,CAAC,WAAW,EAAE,MAAM,GAAG,IAAI,CAAQ;IACpD,SAA2B,QAAQ,EAAE,OAAO,CAAS;CACtD"}
|
|
@@ -1,80 +0,0 @@
|
|
|
1
|
-
var __esDecorate = (this && this.__esDecorate) || function (ctor, descriptorIn, decorators, contextIn, initializers, extraInitializers) {
|
|
2
|
-
function accept(f) { if (f !== void 0 && typeof f !== "function") throw new TypeError("Function expected"); return f; }
|
|
3
|
-
var kind = contextIn.kind, key = kind === "getter" ? "get" : kind === "setter" ? "set" : "value";
|
|
4
|
-
var target = !descriptorIn && ctor ? contextIn["static"] ? ctor : ctor.prototype : null;
|
|
5
|
-
var descriptor = descriptorIn || (target ? Object.getOwnPropertyDescriptor(target, contextIn.name) : {});
|
|
6
|
-
var _, done = false;
|
|
7
|
-
for (var i = decorators.length - 1; i >= 0; i--) {
|
|
8
|
-
var context = {};
|
|
9
|
-
for (var p in contextIn) context[p] = p === "access" ? {} : contextIn[p];
|
|
10
|
-
for (var p in contextIn.access) context.access[p] = contextIn.access[p];
|
|
11
|
-
context.addInitializer = function (f) { if (done) throw new TypeError("Cannot add initializers after decoration has completed"); extraInitializers.push(accept(f || null)); };
|
|
12
|
-
var result = (0, decorators[i])(kind === "accessor" ? { get: descriptor.get, set: descriptor.set } : descriptor[key], context);
|
|
13
|
-
if (kind === "accessor") {
|
|
14
|
-
if (result === void 0) continue;
|
|
15
|
-
if (result === null || typeof result !== "object") throw new TypeError("Object expected");
|
|
16
|
-
if (_ = accept(result.get)) descriptor.get = _;
|
|
17
|
-
if (_ = accept(result.set)) descriptor.set = _;
|
|
18
|
-
if (_ = accept(result.init)) initializers.unshift(_);
|
|
19
|
-
}
|
|
20
|
-
else if (_ = accept(result)) {
|
|
21
|
-
if (kind === "field") initializers.unshift(_);
|
|
22
|
-
else descriptor[key] = _;
|
|
23
|
-
}
|
|
24
|
-
}
|
|
25
|
-
if (target) Object.defineProperty(target, contextIn.name, descriptor);
|
|
26
|
-
done = true;
|
|
27
|
-
};
|
|
28
|
-
var __runInitializers = (this && this.__runInitializers) || function (thisArg, initializers, value) {
|
|
29
|
-
var useValue = arguments.length > 2;
|
|
30
|
-
for (var i = 0; i < initializers.length; i++) {
|
|
31
|
-
value = useValue ? initializers[i].call(thisArg, value) : initializers[i].call(thisArg);
|
|
32
|
-
}
|
|
33
|
-
return useValue ? value : void 0;
|
|
34
|
-
};
|
|
35
|
-
/**
|
|
36
|
-
* Stored `resolved` — writing it does not require writing children.
|
|
37
|
-
* `walkBoundary` stays false: not every program is a two-plane contour.
|
|
38
|
-
*/
|
|
39
|
-
import { syncing } from "@here.build/plexus";
|
|
40
|
-
import { Job } from "./Job.js";
|
|
41
|
-
let ProgrammaticJob = (() => {
|
|
42
|
-
let _classDecorators = [syncing("@inhuman.tools/plexus-expectations:ProgrammaticJob")];
|
|
43
|
-
let _classDescriptor;
|
|
44
|
-
let _classExtraInitializers = [];
|
|
45
|
-
let _classThis;
|
|
46
|
-
let _classSuper = Job;
|
|
47
|
-
let _programText_decorators;
|
|
48
|
-
let _programText_initializers = [];
|
|
49
|
-
let _programText_extraInitializers = [];
|
|
50
|
-
let _resolved_decorators;
|
|
51
|
-
let _resolved_initializers = [];
|
|
52
|
-
let _resolved_extraInitializers = [];
|
|
53
|
-
var ProgrammaticJob = class extends _classSuper {
|
|
54
|
-
static { _classThis = this; }
|
|
55
|
-
static {
|
|
56
|
-
const _metadata = typeof Symbol === "function" && Symbol.metadata ? Object.create(_classSuper[Symbol.metadata] ?? null) : void 0;
|
|
57
|
-
_programText_decorators = [syncing];
|
|
58
|
-
_resolved_decorators = [syncing];
|
|
59
|
-
__esDecorate(this, null, _programText_decorators, { kind: "accessor", name: "programText", static: false, private: false, access: { has: obj => "programText" in obj, get: obj => obj.programText, set: (obj, value) => { obj.programText = value; } }, metadata: _metadata }, _programText_initializers, _programText_extraInitializers);
|
|
60
|
-
__esDecorate(this, null, _resolved_decorators, { kind: "accessor", name: "resolved", static: false, private: false, access: { has: obj => "resolved" in obj, get: obj => obj.resolved, set: (obj, value) => { obj.resolved = value; } }, metadata: _metadata }, _resolved_initializers, _resolved_extraInitializers);
|
|
61
|
-
__esDecorate(null, _classDescriptor = { value: _classThis }, _classDecorators, { kind: "class", name: _classThis.name, metadata: _metadata }, null, _classExtraInitializers);
|
|
62
|
-
ProgrammaticJob = _classThis = _classDescriptor.value;
|
|
63
|
-
if (_metadata) Object.defineProperty(_classThis, Symbol.metadata, { enumerable: true, configurable: true, writable: true, value: _metadata });
|
|
64
|
-
__runInitializers(_classThis, _classExtraInitializers);
|
|
65
|
-
}
|
|
66
|
-
#programText_accessor_storage = __runInitializers(this, _programText_initializers, null);
|
|
67
|
-
get programText() { return this.#programText_accessor_storage; }
|
|
68
|
-
set programText(value) { this.#programText_accessor_storage = value; }
|
|
69
|
-
#resolved_accessor_storage = (__runInitializers(this, _programText_extraInitializers), __runInitializers(this, _resolved_initializers, false));
|
|
70
|
-
get resolved() { return this.#resolved_accessor_storage; }
|
|
71
|
-
set resolved(value) { this.#resolved_accessor_storage = value; }
|
|
72
|
-
constructor() {
|
|
73
|
-
super(...arguments);
|
|
74
|
-
__runInitializers(this, _resolved_extraInitializers);
|
|
75
|
-
}
|
|
76
|
-
};
|
|
77
|
-
return ProgrammaticJob = _classThis;
|
|
78
|
-
})();
|
|
79
|
-
export { ProgrammaticJob };
|
|
80
|
-
//# sourceMappingURL=ProgrammaticJob.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"ProgrammaticJob.js","sourceRoot":"","sources":["../../../src/shared/models/ProgrammaticJob.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA;;;GAGG;AACH,OAAO,EAAE,OAAO,EAAE,MAAM,oBAAoB,CAAC;AAE7C,OAAO,EAAE,GAAG,EAAE,MAAM,UAAU,CAAC;IAGlB,eAAe;4BAD3B,OAAO,CAAC,oDAAoD,CAAC;;;;sBACzB,GAAG;;;;;;;+BAAX,SAAQ,WAAG;;;;uCACrC,OAAO;oCACP,OAAO;YADC,sLAAS,WAAW,6BAAX,WAAW,iGAAuB;YAC3C,6KAAkB,QAAQ,6BAAR,QAAQ,2FAAkB;YAFvD,6KAGC;;;YAHY,uDAAe;;QACjB,mFAAsC,IAAI,EAAC;QAA3C,IAAS,WAAW,iDAAuB;QAA3C,IAAS,WAAW,uDAAuB;QAC3C,uIAAsC,KAAK,GAAC;QAA5C,IAAkB,QAAQ,8CAAkB;QAA5C,IAAkB,QAAQ,oDAAkB;;;;;;;;SAF1C,eAAe","sourcesContent":["/**\n * Stored `resolved` — writing it does not require writing children.\n * `walkBoundary` stays false: not every program is a two-plane contour.\n */\nimport { syncing } from \"@here.build/plexus\";\n\nimport { Job } from \"./Job.js\";\n\n@syncing(\"@inhuman.tools/plexus-expectations:ProgrammaticJob\")\nexport class ProgrammaticJob extends Job {\n @syncing accessor programText: string | null = null;\n @syncing override accessor resolved: boolean = false;\n}\n"]}
|
|
@@ -1,4 +0,0 @@
|
|
|
1
|
-
import { WorkExpectation } from "./WorkExpectation.js";
|
|
2
|
-
export declare abstract class WorkExpectationWithIntrospection<TResult = unknown, TReport = unknown, TProposal = never> extends WorkExpectation<TResult, TReport, TProposal> {
|
|
3
|
-
}
|
|
4
|
-
//# sourceMappingURL=WorkExpectationWithIntrospection.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"WorkExpectationWithIntrospection.d.ts","sourceRoot":"","sources":["../../../src/shared/models/WorkExpectationWithIntrospection.ts"],"names":[],"mappings":"AAOA,OAAO,EAAE,eAAe,EAAE,MAAM,sBAAsB,CAAC;AAEvD,8BACsB,gCAAgC,CACpD,OAAO,GAAG,OAAO,EACjB,OAAO,GAAG,OAAO,EACjB,SAAS,GAAG,KAAK,CACjB,SAAQ,eAAe,CAAC,OAAO,EAAE,OAAO,EAAE,SAAS,CAAC;CAAG"}
|
|
@@ -1,28 +0,0 @@
|
|
|
1
|
-
import { __esDecorate, __runInitializers } from "tslib";
|
|
2
|
-
/**
|
|
3
|
-
* Formerly IntrospectingPlexusModel — a PlexusModel helper that WorkExpectation
|
|
4
|
-
* extended. Flipped: this is a WorkExpectation, not a parent of one.
|
|
5
|
-
* `plexus` / `awareness` / `getUniqueLanePresence` live on {@link WorkExpectation}.
|
|
6
|
-
*/
|
|
7
|
-
import { syncing } from "@here.build/plexus";
|
|
8
|
-
import { WorkExpectation } from "./WorkExpectation.js";
|
|
9
|
-
let WorkExpectationWithIntrospection = (() => {
|
|
10
|
-
let _classDecorators = [syncing("@inhuman.tools/plexus-expectations:WorkExpectationWithIntrospection")];
|
|
11
|
-
let _classDescriptor;
|
|
12
|
-
let _classExtraInitializers = [];
|
|
13
|
-
let _classThis;
|
|
14
|
-
let _classSuper = WorkExpectation;
|
|
15
|
-
var WorkExpectationWithIntrospection = class extends _classSuper {
|
|
16
|
-
static { _classThis = this; }
|
|
17
|
-
static {
|
|
18
|
-
const _metadata = typeof Symbol === "function" && Symbol.metadata ? Object.create(_classSuper[Symbol.metadata] ?? null) : void 0;
|
|
19
|
-
__esDecorate(null, _classDescriptor = { value: _classThis }, _classDecorators, { kind: "class", name: _classThis.name, metadata: _metadata }, null, _classExtraInitializers);
|
|
20
|
-
WorkExpectationWithIntrospection = _classThis = _classDescriptor.value;
|
|
21
|
-
if (_metadata) Object.defineProperty(_classThis, Symbol.metadata, { enumerable: true, configurable: true, writable: true, value: _metadata });
|
|
22
|
-
__runInitializers(_classThis, _classExtraInitializers);
|
|
23
|
-
}
|
|
24
|
-
};
|
|
25
|
-
return WorkExpectationWithIntrospection = _classThis;
|
|
26
|
-
})();
|
|
27
|
-
export { WorkExpectationWithIntrospection };
|
|
28
|
-
//# sourceMappingURL=WorkExpectationWithIntrospection.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"WorkExpectationWithIntrospection.js","sourceRoot":"","sources":["../../../src/shared/models/WorkExpectationWithIntrospection.ts"],"names":[],"mappings":";AAAA;;;;GAIG;AACH,OAAO,EAAE,OAAO,EAAE,MAAM,oBAAoB,CAAC;AAE7C,OAAO,EAAE,eAAe,EAAE,MAAM,sBAAsB,CAAC;IAGjC,gCAAgC;4BADrD,OAAO,CAAC,qEAAqE,CAAC;;;;sBAKrE,eAAe;gDAAvB,SAAQ,WAA4C;;;;YAJtD,6KAIyD;;;YAJnC,uDAAgC;;;;;SAAhC,gCAAgC","sourcesContent":["/**\n * Formerly IntrospectingPlexusModel — a PlexusModel helper that WorkExpectation\n * extended. Flipped: this is a WorkExpectation, not a parent of one.\n * `plexus` / `awareness` / `getUniqueLanePresence` live on {@link WorkExpectation}.\n */\nimport { syncing } from \"@here.build/plexus\";\n\nimport { WorkExpectation } from \"./WorkExpectation.js\";\n\n@syncing(\"@inhuman.tools/plexus-expectations:WorkExpectationWithIntrospection\")\nexport abstract class WorkExpectationWithIntrospection<\n TResult = unknown,\n TReport = unknown,\n TProposal = never,\n> extends WorkExpectation<TResult, TReport, TProposal> {}\n"]}
|
|
@@ -1,39 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Resolution request / answer shapes. Separate from ordinary TProposal steer.
|
|
3
|
-
* Transport lives on dedicated awareness lanes; parse functions drop junk.
|
|
4
|
-
*/
|
|
5
|
-
/** One choosable value. `label` is display; identity is `value`. */
|
|
6
|
-
export type ProposalOption = {
|
|
7
|
-
readonly value: string;
|
|
8
|
-
readonly label?: string;
|
|
9
|
-
};
|
|
10
|
-
/**
|
|
11
|
-
* Actor → world ask. Default path is `description` + `options` + `defaults`.
|
|
12
|
-
* `type` / `body` are optional enrichment — unknown `type` is ignored, not rejected.
|
|
13
|
-
*/
|
|
14
|
-
export type ProposalRequest = {
|
|
15
|
-
readonly type: string;
|
|
16
|
-
readonly description: string;
|
|
17
|
-
readonly body?: unknown;
|
|
18
|
-
readonly options: readonly ProposalOption[];
|
|
19
|
-
readonly defaults?: {
|
|
20
|
-
readonly confirm?: string;
|
|
21
|
-
readonly break?: string;
|
|
22
|
-
};
|
|
23
|
-
};
|
|
24
|
-
/** Published ask — {@link ProposalRequest} plus the request id on the resolution-request lane. */
|
|
25
|
-
export type ResolutionRequest = ProposalRequest & {
|
|
26
|
-
readonly requestId: string;
|
|
27
|
-
};
|
|
28
|
-
/** Author → actor answer on the resolution lane. */
|
|
29
|
-
export type Resolution = {
|
|
30
|
-
readonly requestId: string;
|
|
31
|
-
readonly value: string;
|
|
32
|
-
};
|
|
33
|
-
export declare function parseProposalOption(raw: unknown): ProposalOption | null;
|
|
34
|
-
/** Untrusted awareness field → published ask, or null. */
|
|
35
|
-
export declare function parseResolutionRequest(raw: unknown): ResolutionRequest | null;
|
|
36
|
-
/** Untrusted awareness field → answer, or null. Missing `requestId` is ignored (no front-run). */
|
|
37
|
-
export declare function parseResolution(raw: unknown): Resolution | null;
|
|
38
|
-
export declare function normalizeProposalRequest(request: ProposalRequest): ProposalRequest;
|
|
39
|
-
//# sourceMappingURL=resolution.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"resolution.d.ts","sourceRoot":"","sources":["../../src/shared/resolution.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH,oEAAoE;AACpE,MAAM,MAAM,cAAc,GAAG;IAC3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