@oneie/sdk 0.14.9 → 0.14.11
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/client.d.ts +1 -0
- package/dist/client.d.ts.map +1 -1
- package/dist/client.js +27 -4
- package/dist/client.js.map +1 -1
- package/dist/gateway.d.ts +13 -1
- package/dist/gateway.d.ts.map +1 -1
- package/dist/gateway.js +36 -8
- package/dist/gateway.js.map +1 -1
- package/dist/generated/base-manifest.d.ts.map +1 -1
- package/dist/generated/base-manifest.js +25 -0
- package/dist/generated/base-manifest.js.map +1 -1
- package/dist/generated/schemas.d.ts +13 -0
- package/dist/generated/schemas.d.ts.map +1 -1
- package/dist/generated/schemas.js +13 -0
- package/dist/generated/schemas.js.map +1 -1
- package/dist/market.d.ts +2 -0
- package/dist/market.d.ts.map +1 -1
- package/dist/market.js +2 -0
- package/dist/market.js.map +1 -1
- package/dist/receivers.d.ts +208 -0
- package/dist/receivers.d.ts.map +1 -1
- package/dist/receivers.js +153 -4
- package/dist/receivers.js.map +1 -1
- package/dist/templates.d.ts.map +1 -1
- package/dist/templates.js +3 -1
- package/dist/templates.js.map +1 -1
- package/dist/types.d.ts +6 -0
- package/dist/types.d.ts.map +1 -1
- package/dist/types.js.map +1 -1
- package/dist/work-contract-grammar.json +20 -1
- package/package.json +2 -2
package/dist/receivers.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"receivers.d.ts","sourceRoot":"","sources":["../src/receivers.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAcxB;;;;;;;;;;;;;GAaG;AAEH;sEACsE;AACtE,MAAM,MAAM,UAAU,GAAG,MAAM,CAAC;AAEhC,+DAA+D;AAC/D,MAAM,MAAM,YAAY,GAAG,MAAM,GAAG,UAAU,GAAG;IAAE,KAAK,EAAE,MAAM,CAAA;CAAE,CAAC;AAEnE,oDAAoD;AACpD,MAAM,M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C,CAAC;AAEpD,8BAA8B;AAC9B,MAAM,MAAM,UAAU,GAAG,MAAM,OAAO,OAAO,CAAC"}
|
package/dist/receivers.js
CHANGED
|
@@ -734,24 +734,49 @@ export const RECEIVERS = {
|
|
|
734
734
|
}),
|
|
735
735
|
"world:route": receiver({
|
|
736
736
|
receiver: "world:route",
|
|
737
|
-
summary: "Route a tagged signal to THE handler via the ladder: learned tag-node path (follow_route) → staked subscribers (reputation-ranked) → CEO standing workflow; marks the delivery path so the next route is smarter. reply:true also invokes the resolved actor and returns its answer inline",
|
|
737
|
+
summary: "Route a tagged signal to THE handler via the ladder: learned tag-node path (follow_route) → staked subscribers (reputation-ranked) → CEO standing workflow; marks the delivery path so the next route is smarter. reply:true also invokes the resolved actor and returns its answer inline. decide:true instead answers the deterministic verdict { receiver, rung, reason } (reason: highway|classified|ceo) from the learned lane — a pure read, zero side effects, zero tokens; TypeQL twin: route_verdict (migration 0043)",
|
|
738
738
|
request: z.object({
|
|
739
739
|
tags: z.array(z.string()),
|
|
740
|
+
decide: z.boolean().optional(), // true → verdict-only: no delivery, no mark, no CEO trigger
|
|
740
741
|
deliver: z.boolean().optional(),
|
|
741
742
|
reply: z.boolean().optional(),
|
|
742
743
|
board: z.literal("marketplace").optional(),
|
|
743
744
|
slug: z.string().optional(),
|
|
744
745
|
workspace: z.string().optional(),
|
|
745
|
-
}).catchall(z.unknown()), // extra keys = the message payload (e.g. content) — carried through to the resolved actor, never stripped
|
|
746
|
+
}).catchall(z.unknown()), // extra keys = the message payload (e.g. content, text) — carried through to the resolved actor, never stripped
|
|
746
747
|
response: z.object({
|
|
747
748
|
ok: z.boolean(),
|
|
748
749
|
routed: z.enum(["learned", "staked", "explore", "ceo"]).optional(),
|
|
749
750
|
actor: z.string().optional(),
|
|
751
|
+
// decide:true verdict fields — receiver null ⇔ reason 'ceo'; rung 1:1 with reason (highway→1 classified→2 ceo→3)
|
|
752
|
+
receiver: z.string().nullable().optional(),
|
|
753
|
+
rung: z.number().optional(),
|
|
754
|
+
reason: z.enum(["highway", "classified", "ceo"]).optional(),
|
|
750
755
|
tags: z.array(z.string()).optional(),
|
|
751
756
|
reply: z.object({ ok: z.boolean(), text: z.string().optional(), error: z.string().optional() }).optional(),
|
|
752
757
|
}),
|
|
753
758
|
effect: "ask",
|
|
754
759
|
}),
|
|
760
|
+
"world:suggest-workflow": receiver({
|
|
761
|
+
receiver: "world:suggest-workflow",
|
|
762
|
+
summary: "Rank staked workflows by tag match + earned track record (claw_paths), read-only — no delivery, no run, no auto-trigger. Requires >=3 successful runs before a workflow is surfaced; caps at 3 suggestions",
|
|
763
|
+
request: z.object({
|
|
764
|
+
tags: z.array(z.string()),
|
|
765
|
+
workspace: z.string().optional(),
|
|
766
|
+
slug: z.string().optional(),
|
|
767
|
+
}).catchall(z.unknown()),
|
|
768
|
+
response: z.object({
|
|
769
|
+
ok: z.boolean(),
|
|
770
|
+
suggestions: z.array(z.object({
|
|
771
|
+
workflowId: z.string(),
|
|
772
|
+
name: z.string(),
|
|
773
|
+
weight: z.number(),
|
|
774
|
+
tags: z.array(z.string()),
|
|
775
|
+
})).optional(),
|
|
776
|
+
error: z.string().optional(),
|
|
777
|
+
}),
|
|
778
|
+
effect: "ask", idempotent: true,
|
|
779
|
+
}),
|
|
755
780
|
"tasks:announce": receiver({
|
|
756
781
|
receiver: "tasks:announce",
|
|
757
782
|
summary: "Announce a task into the world by its tags — the first caller of world:announce",
|
|
@@ -979,6 +1004,8 @@ export const RECEIVERS = {
|
|
|
979
1004
|
price: z.number().nonnegative(),
|
|
980
1005
|
currency: z.string().default("credits"),
|
|
981
1006
|
deadline: z.string().datetime(),
|
|
1007
|
+
pid: z.string().optional(),
|
|
1008
|
+
ppid: z.string().optional(),
|
|
982
1009
|
}),
|
|
983
1010
|
response: z.union([
|
|
984
1011
|
z.object({ ok: z.literal(true), deal: z.object({ id: z.string(), stage: z.string(), version: z.number() }) }),
|
|
@@ -1077,6 +1104,20 @@ export const RECEIVERS = {
|
|
|
1077
1104
|
]),
|
|
1078
1105
|
effect: "ask", auth: "required", reversible: false, idempotent: false,
|
|
1079
1106
|
}),
|
|
1107
|
+
"market:offers": receiver({
|
|
1108
|
+
receiver: "market:offers",
|
|
1109
|
+
summary: "List the caller's own deals (as buyer or seller), optionally filtered by stage",
|
|
1110
|
+
request: z.object({ stage: z.string().optional() }),
|
|
1111
|
+
response: z.union([
|
|
1112
|
+
z.object({ ok: z.literal(true), deals: z.array(z.object({
|
|
1113
|
+
id: z.string(), buyer: z.string(), seller: z.string(), skill: z.string(),
|
|
1114
|
+
price: z.number(), currency: z.string(), stage: z.string(), version: z.number(),
|
|
1115
|
+
pid: z.string().optional(), ppid: z.string().optional(),
|
|
1116
|
+
})) }),
|
|
1117
|
+
z.object({ ok: z.literal(false), error: z.string() }),
|
|
1118
|
+
]),
|
|
1119
|
+
effect: "ask", auth: "required", cost: "free", idempotent: true,
|
|
1120
|
+
}),
|
|
1080
1121
|
// ── market (TRADE) ──
|
|
1081
1122
|
"market:hire": receiver({
|
|
1082
1123
|
receiver: "market:hire",
|
|
@@ -1911,6 +1952,76 @@ export const RECEIVERS = {
|
|
|
1911
1952
|
response: z.object({ ok: z.boolean(), slug: z.string().optional(), title: z.string().optional(), url: z.string().optional(), status: z.string().optional(), error: z.string().optional() }),
|
|
1912
1953
|
effect: "ask", cost: "free", reversible: true, idempotent: true, auth: "member",
|
|
1913
1954
|
}),
|
|
1955
|
+
'pages:publish-pack': receiver({
|
|
1956
|
+
receiver: "pages:publish-pack",
|
|
1957
|
+
summary: "Publish all (or a listed subset of) a workspace's draft pack pages in one call — the go-live step. Reuses pages:publish's exact UPDATE, looped once, gated once.",
|
|
1958
|
+
request: z.object({ slug: z.string(), pages: z.array(z.union([z.string(), z.object({ slug: z.string() })])).optional() }),
|
|
1959
|
+
response: z.object({ ok: z.boolean(), published: z.number().optional(), error: z.string().optional() }),
|
|
1960
|
+
effect: "ask", cost: "free", reversible: true, idempotent: true, auth: "member",
|
|
1961
|
+
}),
|
|
1962
|
+
"pages:fill-pack": receiver({
|
|
1963
|
+
receiver: "pages:fill-pack",
|
|
1964
|
+
summary: "Fill a pack's instantiated pages with real business facts — one call, still drafts. Never fabricates a testimonial; pricing derives from one rate, not typed per page.",
|
|
1965
|
+
request: z.object({
|
|
1966
|
+
slug: z.string(),
|
|
1967
|
+
pages: z.array(z.object({ pageSlug: z.string(), slug: z.string() })),
|
|
1968
|
+
facts: z.object({
|
|
1969
|
+
identity: z.object({
|
|
1970
|
+
company: z.string(),
|
|
1971
|
+
ownerName: z.string(),
|
|
1972
|
+
phone: z.string(),
|
|
1973
|
+
foundedYear: z.number(),
|
|
1974
|
+
city: z.string(),
|
|
1975
|
+
state: z.string(),
|
|
1976
|
+
metro: z.string(),
|
|
1977
|
+
streetAddress: z.string(),
|
|
1978
|
+
}),
|
|
1979
|
+
licensing: z.object({
|
|
1980
|
+
usdot: z.string().optional(),
|
|
1981
|
+
mc: z.string().optional(),
|
|
1982
|
+
stateLicenseNumber: z.string(),
|
|
1983
|
+
regulatorOverride: z.string().optional(),
|
|
1984
|
+
}),
|
|
1985
|
+
reputation: z.object({ starRating: z.number(), reviewCount: z.number(), movesCompleted: z.number() }),
|
|
1986
|
+
serviceArea: z.object({ neighborhoods: z.array(z.string()).min(1) }),
|
|
1987
|
+
pricing: z.object({
|
|
1988
|
+
hourlyRatePerMover: z.number(),
|
|
1989
|
+
truckFee: z.number(),
|
|
1990
|
+
tiers: z.record(z.string(), z.object({ low: z.number(), high: z.number() })).optional(),
|
|
1991
|
+
}),
|
|
1992
|
+
story: z.object({ originSentence: z.string().optional() }).optional(),
|
|
1993
|
+
testimonials: z.array(z.object({ quote: z.string(), reviewerName: z.string(), moveType: z.string() })).optional(),
|
|
1994
|
+
source: z.object({ url: z.string().optional() }).optional(),
|
|
1995
|
+
}),
|
|
1996
|
+
}),
|
|
1997
|
+
response: z.object({ ok: z.boolean(), filled: z.number().optional(), error: z.string().optional() }),
|
|
1998
|
+
effect: "ask", cost: "free", reversible: true, idempotent: false, auth: "member",
|
|
1999
|
+
}),
|
|
2000
|
+
"pages:fill-pack-extract": receiver({
|
|
2001
|
+
receiver: "pages:fill-pack-extract",
|
|
2002
|
+
summary: "Best-effort business facts from an operator's own URL or a free-text description — fetch-then-confirm, never fetch-then-apply. Returns candidate facts for a form to pre-fill; nothing here writes a page.",
|
|
2003
|
+
request: z.object({ slug: z.string(), url: z.string().optional(), text: z.string().optional() }),
|
|
2004
|
+
response: z.object({ ok: z.boolean(), facts: z.record(z.string(), z.unknown()).optional(), error: z.string().optional() }),
|
|
2005
|
+
effect: "ask", cost: "variable", reversible: true, idempotent: true, auth: "member",
|
|
2006
|
+
}),
|
|
2007
|
+
"movers:build": receiver({
|
|
2008
|
+
receiver: "movers:build",
|
|
2009
|
+
summary: "The one intake orchestrator — takes a URL or a free-text description, extracts MoverBusinessFacts, clones the movers-factory template, and starts the run. The single op every door (web form, chat) shares; composes pages:fill-pack-extract + workflow:create + workflow:run, adds no new build primitive.",
|
|
2010
|
+
request: z.object({ slug: z.string(), url: z.string().optional(), describe: z.string().optional() }),
|
|
2011
|
+
response: z.object({ ok: z.boolean(), runId: z.string().optional(), facts: z.record(z.string(), z.unknown()).optional(), error: z.string().optional() }),
|
|
2012
|
+
effect: "ask", cost: "variable", reversible: false, idempotent: false, auth: "member",
|
|
2013
|
+
examples: [{ slug: "summit-movers", describe: "We're Summit Movers, family-run in Austin since 2015, licensed CAL-T, $65/hr per mover." }],
|
|
2014
|
+
surfaces: { chat: true },
|
|
2015
|
+
}),
|
|
2016
|
+
"movers:funnel-provision": receiver({
|
|
2017
|
+
receiver: "movers:funnel-provision",
|
|
2018
|
+
summary: "Open, sponsored no-account provision — takes a company name plus a URL or description, provisions a capped child workspace under moverchat, and starts movers:build. Rate-limited per visitor + a global daily ceiling; refuses past any wall rather than draining moverchat's operating credits. The single writer behind both the homepage door and this chat tool.",
|
|
2019
|
+
request: z.object({ name: z.string(), url: z.string().optional(), describe: z.string().optional(), phone: z.string().optional(), email: z.string().optional(), visitorHash: z.string() }),
|
|
2020
|
+
response: z.object({ ok: z.boolean(), previewToken: z.string().optional(), slug: z.string().optional(), error: z.string().optional() }),
|
|
2021
|
+
effect: "ask", cost: "variable", reversible: false, idempotent: false, auth: "public",
|
|
2022
|
+
examples: [{ name: "Summit Movers", url: "https://summitmovers.example.com", visitorHash: "chat:web:conv-123" }],
|
|
2023
|
+
surfaces: { chat: true },
|
|
2024
|
+
}),
|
|
1914
2025
|
"pages:versions": receiver({
|
|
1915
2026
|
receiver: "pages:versions",
|
|
1916
2027
|
summary: "List a page's saved version snapshots, newest first",
|
|
@@ -1925,6 +2036,13 @@ export const RECEIVERS = {
|
|
|
1925
2036
|
response: z.object({ ok: z.boolean(), slug: z.string().optional(), title: z.string().optional(), url: z.string().optional(), status: z.string().optional(), restoredTs: z.number().optional(), error: z.string().optional() }),
|
|
1926
2037
|
effect: "ask", cost: "free", reversible: false, idempotent: false, auth: "member",
|
|
1927
2038
|
}),
|
|
2039
|
+
"mover:agent-context": receiver({
|
|
2040
|
+
receiver: "mover:agent-context",
|
|
2041
|
+
summary: "The fact→agent bridge — render MoverBusinessFacts into ground-truth prose and write it to the workspace's company_context, so the mounted chat agent answers as the operator's real business. Never invents a service/review/policy; same facts as pages:fill-pack, one intake, two artifacts.",
|
|
2042
|
+
request: z.object({ slug: z.string(), facts: z.record(z.string(), z.unknown()) }),
|
|
2043
|
+
response: z.object({ ok: z.boolean(), chars: z.number().optional(), error: z.string().optional() }),
|
|
2044
|
+
effect: "ask", cost: "free", reversible: true, idempotent: true, auth: "member",
|
|
2045
|
+
}),
|
|
1928
2046
|
"settings:write": receiver({
|
|
1929
2047
|
receiver: "settings:write",
|
|
1930
2048
|
summary: "Write a workspace setting value (caller or authorized descendant)",
|
|
@@ -2088,7 +2206,7 @@ export const RECEIVERS = {
|
|
|
2088
2206
|
slug: z.string(), // provider workspace
|
|
2089
2207
|
service: z.string().optional(), // service_id; omitted → the workspace's first active
|
|
2090
2208
|
date: z.string().optional(), // 'YYYY-MM-DD'; omitted → next N open days
|
|
2091
|
-
days: z.number().int().min(1).max(
|
|
2209
|
+
days: z.number().int().min(1).max(62).optional(), // window size when date omitted (month calendar needs ~2 months)
|
|
2092
2210
|
}),
|
|
2093
2211
|
response: z.object({
|
|
2094
2212
|
service: z.object({
|
|
@@ -2387,13 +2505,31 @@ export const RECEIVERS = {
|
|
|
2387
2505
|
response: z.object({
|
|
2388
2506
|
ok: z.boolean(),
|
|
2389
2507
|
stepCount: z.number().optional(),
|
|
2508
|
+
warnings: z.array(z.string()).optional(), // §9 advisories (never block); grammar: code | code:stepId
|
|
2390
2509
|
idMap: z.record(z.string(), z.string()).optional(), // tempId → persisted id
|
|
2391
|
-
error: z.string().optional(), // 'cycle_detected' | 'conflict' | 'invalid_diff'
|
|
2510
|
+
error: z.string().optional(), // 'cycle_detected' | 'conflict' | 'invalid_diff' | 'multiple_triggers' | 'edge_unknown_step' | 'invalid_config' | 'bad_expr' | 'unsupported_field'
|
|
2392
2511
|
}),
|
|
2393
2512
|
effect: "ask", cost: "free", reversible: true, idempotent: false, simulatable: true,
|
|
2394
2513
|
auth: "manage_workflows",
|
|
2395
2514
|
examples: [{ workflowId: "wf_abc", diff: { add: [{ tempId: "s1", kind: "trigger", name: "On signup", config: "{}" }] }, simulate: true }],
|
|
2396
2515
|
}),
|
|
2516
|
+
"workflow:validate": receiver({
|
|
2517
|
+
receiver: "workflow:validate",
|
|
2518
|
+
summary: "Run the §9 gate on a WorkflowDiff without persisting — kinds/config shapes, exactly-one-trigger, edges reference real steps, chain cycles; advisories ride back as warnings (grammar: code | code:stepId, never block). Every save door calls this.",
|
|
2519
|
+
request: z.object({
|
|
2520
|
+
workflowId: z.string(),
|
|
2521
|
+
diff: WorkflowDiffSchema,
|
|
2522
|
+
}),
|
|
2523
|
+
response: z.object({
|
|
2524
|
+
ok: z.boolean(),
|
|
2525
|
+
stepCount: z.number().optional(),
|
|
2526
|
+
warnings: z.array(z.string()).optional(),
|
|
2527
|
+
error: z.string().optional(), // 'multiple_triggers'|'edge_unknown_step'|'invalid_config'|'bad_expr'|'cycle_detected'|'invalid_diff'|'unsupported_field'
|
|
2528
|
+
}),
|
|
2529
|
+
effect: "ask", cost: "free", reversible: true, idempotent: true, simulatable: true,
|
|
2530
|
+
auth: "manage_workflows",
|
|
2531
|
+
examples: [{ workflowId: "wf_abc", diff: { add: [{ tempId: "s1", kind: "trigger", name: "On signup", config: "{}" }] } }],
|
|
2532
|
+
}),
|
|
2397
2533
|
"workflow:run": receiver({
|
|
2398
2534
|
receiver: "workflow:run",
|
|
2399
2535
|
summary: "Start a run — spawns the WorkflowRun DO, executes each step, marks path strength on traversed edges",
|
|
@@ -2497,6 +2633,19 @@ export const RECEIVERS = {
|
|
|
2497
2633
|
effect: "signal", cost: "free", idempotent: true, simulatable: false, auth: "manage_workflows",
|
|
2498
2634
|
examples: [{ runId: "run_1", stepId: "s2", stepName: "Approve contract" }],
|
|
2499
2635
|
}),
|
|
2636
|
+
"workflow:settled-notify": receiver({
|
|
2637
|
+
receiver: "workflow:settled-notify",
|
|
2638
|
+
summary: "Tell a run's started_by that it finished when there is no chat conversation to carry the outcome (manual/canvas/scheduled runs). settle() fires this group-less terminal only; a plain status line, never approval markup. Sibling of workflow:resumed-notify.",
|
|
2639
|
+
request: z.object({
|
|
2640
|
+
runId: z.string(),
|
|
2641
|
+
group: z.string(), // started_by — the workspace to notify
|
|
2642
|
+
status: z.string().optional(), // 'done' | 'failed'
|
|
2643
|
+
workflowName: z.string().optional(),
|
|
2644
|
+
}),
|
|
2645
|
+
response: z.object({ ok: z.boolean(), group: z.string().optional(), error: z.string().optional() }),
|
|
2646
|
+
effect: "signal", cost: "free", idempotent: true, simulatable: false, auth: "manage_workflows",
|
|
2647
|
+
examples: [{ runId: "run_1", group: "acme", status: "done" }],
|
|
2648
|
+
}),
|
|
2500
2649
|
"workflow:stop": receiver({
|
|
2501
2650
|
receiver: "workflow:stop",
|
|
2502
2651
|
summary: "Park a live run at its current step (status → paused); preserves the resume cursor so human:resolve or a re-run continues it",
|