@intentic/sandbox-contract 1.239.0 → 1.242.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 +52 -16
- package/dist/agent-catalog.d.ts +5 -28
- package/dist/agent-catalog.d.ts.map +1 -1
- package/dist/agent-catalog.js +21 -157
- package/dist/agent-catalog.js.map +1 -1
- package/dist/agent-run-model.d.ts +3 -2
- package/dist/agent-run-model.d.ts.map +1 -1
- package/dist/agent-run-model.js +9 -6
- package/dist/agent-run-model.js.map +1 -1
- package/dist/agent-runtimes.d.ts +27 -0
- package/dist/agent-runtimes.d.ts.map +1 -0
- package/dist/agent-runtimes.js +113 -0
- package/dist/agent-runtimes.js.map +1 -0
- package/dist/approvals-execution.d.ts +11 -0
- package/dist/approvals-execution.d.ts.map +1 -0
- package/dist/approvals-execution.js +44 -0
- package/dist/approvals-execution.js.map +1 -0
- package/dist/arrival.d.ts +151 -0
- package/dist/arrival.d.ts.map +1 -0
- package/dist/arrival.js +56 -0
- package/dist/arrival.js.map +1 -0
- package/dist/card-status.d.ts +5 -0
- package/dist/card-status.d.ts.map +1 -0
- package/dist/card-status.js +74 -0
- package/dist/card-status.js.map +1 -0
- package/dist/chores/chores.d.ts.map +1 -1
- package/dist/chores/chores.js +1 -1
- package/dist/chores/chores.js.map +1 -1
- package/dist/command-classes.d.ts +0 -1
- package/dist/command-classes.d.ts.map +1 -1
- package/dist/command-classes.js +9 -2
- package/dist/command-classes.js.map +1 -1
- package/dist/command-run.d.ts +10 -0
- package/dist/command-run.d.ts.map +1 -0
- package/dist/command-run.js +46 -0
- package/dist/command-run.js.map +1 -0
- package/dist/contracts/agent.contract.d.ts +991 -771
- package/dist/contracts/agent.contract.d.ts.map +1 -1
- package/dist/contracts/agents.contract.d.ts +483 -1
- package/dist/contracts/agents.contract.d.ts.map +1 -1
- package/dist/contracts/agents.contract.js +20 -2
- package/dist/contracts/agents.contract.js.map +1 -1
- package/dist/contracts/approvals.contract.d.ts +99 -0
- package/dist/contracts/approvals.contract.d.ts.map +1 -0
- package/dist/contracts/approvals.contract.js +32 -0
- package/dist/contracts/approvals.contract.js.map +1 -0
- package/dist/contracts/ci.contract.d.ts +1 -4
- package/dist/contracts/ci.contract.d.ts.map +1 -1
- package/dist/contracts/ci.contract.js +1 -9
- package/dist/contracts/ci.contract.js.map +1 -1
- package/dist/contracts/claude.contract.d.ts +9 -0
- package/dist/contracts/claude.contract.d.ts.map +1 -1
- package/dist/contracts/cursor.contract.d.ts +6 -0
- package/dist/contracts/cursor.contract.d.ts.map +1 -1
- package/dist/contracts/git.contract.d.ts +63 -1
- package/dist/contracts/git.contract.d.ts.map +1 -1
- package/dist/contracts/git.contract.js +22 -4
- package/dist/contracts/git.contract.js.map +1 -1
- package/dist/contracts/grok.contract.d.ts +3 -0
- package/dist/contracts/grok.contract.d.ts.map +1 -1
- package/dist/contracts/keys.contract.d.ts +81 -0
- package/dist/contracts/keys.contract.d.ts.map +1 -0
- package/dist/contracts/keys.contract.js +51 -0
- package/dist/contracts/keys.contract.js.map +1 -0
- package/dist/contracts/panels.contract.d.ts +7 -0
- package/dist/contracts/panels.contract.d.ts.map +1 -1
- package/dist/contracts/prepush.contract.js +2 -2
- package/dist/contracts/providers.contract.d.ts +2 -0
- package/dist/contracts/providers.contract.d.ts.map +1 -1
- package/dist/contracts/runner.contract.d.ts +99 -101
- package/dist/contracts/runner.contract.d.ts.map +1 -1
- package/dist/contracts/safety.contract.d.ts +35 -0
- package/dist/contracts/safety.contract.d.ts.map +1 -0
- package/dist/contracts/safety.contract.js +32 -0
- package/dist/contracts/safety.contract.js.map +1 -0
- package/dist/contracts/sessions.contract.d.ts +211 -1
- package/dist/contracts/sessions.contract.d.ts.map +1 -1
- package/dist/contracts/settings.contract.d.ts +30 -32
- package/dist/contracts/settings.contract.d.ts.map +1 -1
- package/dist/contracts/system.contract.d.ts +277 -1
- package/dist/contracts/system.contract.d.ts.map +1 -1
- package/dist/contracts/translator.contract.d.ts +31 -3
- package/dist/contracts/translator.contract.d.ts.map +1 -1
- package/dist/contracts/usage.contract.d.ts +29 -20
- package/dist/contracts/usage.contract.d.ts.map +1 -1
- package/dist/contracts/usage.contract.js +13 -0
- package/dist/contracts/usage.contract.js.map +1 -1
- package/dist/contracts/workspace.contract.d.ts +8 -0
- package/dist/contracts/workspace.contract.d.ts.map +1 -1
- package/dist/conversation-ids.d.ts +2 -0
- package/dist/conversation-ids.d.ts.map +1 -1
- package/dist/conversation-ids.js +8 -0
- package/dist/conversation-ids.js.map +1 -1
- package/dist/credential-material.d.ts +1 -0
- package/dist/credential-material.d.ts.map +1 -1
- package/dist/credential-material.js +24 -2
- package/dist/credential-material.js.map +1 -1
- package/dist/definition.d.ts +51 -93
- package/dist/definition.d.ts.map +1 -1
- package/dist/definition.js +6 -28
- package/dist/definition.js.map +1 -1
- package/dist/events.d.ts +2947 -991
- package/dist/events.d.ts.map +1 -1
- package/dist/events.js +233 -82
- package/dist/events.js.map +1 -1
- package/dist/history-state.d.ts.map +1 -1
- package/dist/history-state.js +1 -0
- package/dist/history-state.js.map +1 -1
- package/dist/index.d.ts +2532 -1054
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +20 -5
- package/dist/index.js.map +1 -1
- package/dist/ingress-protocol.d.ts +13 -1
- package/dist/ingress-protocol.d.ts.map +1 -1
- package/dist/ingress-protocol.js +19 -0
- package/dist/ingress-protocol.js.map +1 -1
- package/dist/mentions.d.ts +3 -0
- package/dist/mentions.d.ts.map +1 -0
- package/dist/mentions.js +13 -0
- package/dist/mentions.js.map +1 -0
- package/dist/needs-action.d.ts +7 -0
- package/dist/needs-action.d.ts.map +1 -0
- package/dist/needs-action.js +3 -0
- package/dist/needs-action.js.map +1 -0
- package/dist/overlay-lint.d.ts +7 -0
- package/dist/overlay-lint.d.ts.map +1 -0
- package/dist/overlay-lint.js +68 -0
- package/dist/overlay-lint.js.map +1 -0
- package/dist/owner-ticket.d.ts +18 -0
- package/dist/owner-ticket.d.ts.map +1 -0
- package/dist/owner-ticket.js +51 -0
- package/dist/owner-ticket.js.map +1 -0
- package/dist/plan-pools.d.ts +12 -0
- package/dist/plan-pools.d.ts.map +1 -0
- package/dist/plan-pools.js +30 -0
- package/dist/plan-pools.js.map +1 -0
- package/dist/provider-specs.d.ts +228 -0
- package/dist/provider-specs.d.ts.map +1 -0
- package/dist/provider-specs.js +124 -0
- package/dist/provider-specs.js.map +1 -0
- package/dist/quick-model.d.ts.map +1 -1
- package/dist/quick-model.js +2 -1
- package/dist/quick-model.js.map +1 -1
- package/dist/runner-protocol.js +2 -2
- package/dist/runner-protocol.js.map +1 -1
- package/dist/runtime-state.d.ts +2 -2
- package/dist/runtime-state.d.ts.map +1 -1
- package/dist/runtime-state.js +1 -1
- package/dist/runtime-state.js.map +1 -1
- package/dist/safety-policy.d.ts +49 -0
- package/dist/safety-policy.d.ts.map +1 -0
- package/dist/safety-policy.js +52 -0
- package/dist/safety-policy.js.map +1 -0
- package/dist/schemas/agent.d.ts +21 -3
- package/dist/schemas/agent.d.ts.map +1 -1
- package/dist/schemas/agent.js +18 -8
- package/dist/schemas/agent.js.map +1 -1
- package/dist/schemas/agents.d.ts +19 -0
- package/dist/schemas/agents.d.ts.map +1 -1
- package/dist/schemas/agents.js +15 -0
- package/dist/schemas/agents.js.map +1 -1
- package/dist/schemas/approvals.d.ts +241 -0
- package/dist/schemas/approvals.d.ts.map +1 -0
- package/dist/schemas/approvals.js +63 -0
- package/dist/schemas/approvals.js.map +1 -0
- package/dist/schemas/automations.d.ts +5 -0
- package/dist/schemas/automations.d.ts.map +1 -1
- package/dist/schemas/ci.d.ts +5 -9
- package/dist/schemas/ci.d.ts.map +1 -1
- package/dist/schemas/ci.js +3 -10
- package/dist/schemas/ci.js.map +1 -1
- package/dist/schemas/computers.d.ts +31 -5
- package/dist/schemas/computers.d.ts.map +1 -1
- package/dist/schemas/computers.js +7 -5
- package/dist/schemas/computers.js.map +1 -1
- package/dist/schemas/environment.d.ts +11 -131
- package/dist/schemas/environment.d.ts.map +1 -1
- package/dist/schemas/environment.js +5 -42
- package/dist/schemas/environment.js.map +1 -1
- package/dist/schemas/git-history.d.ts +4 -0
- package/dist/schemas/git-history.d.ts.map +1 -1
- package/dist/schemas/git.d.ts +179 -0
- package/dist/schemas/git.d.ts.map +1 -1
- package/dist/schemas/git.js +39 -1
- package/dist/schemas/git.js.map +1 -1
- package/dist/schemas/panels.d.ts +21 -0
- package/dist/schemas/panels.d.ts.map +1 -1
- package/dist/schemas/panels.js +5 -0
- package/dist/schemas/panels.js.map +1 -1
- package/dist/schemas/plan-limits.d.ts +50 -3
- package/dist/schemas/plan-limits.d.ts.map +1 -1
- package/dist/schemas/plan-limits.js +11 -6
- package/dist/schemas/plan-limits.js.map +1 -1
- package/dist/schemas/provider-oauth.d.ts +6 -0
- package/dist/schemas/provider-oauth.d.ts.map +1 -1
- package/dist/schemas/provider-subscriptions.d.ts +2 -1
- package/dist/schemas/provider-subscriptions.d.ts.map +1 -1
- package/dist/schemas/provider-subscriptions.js +2 -1
- package/dist/schemas/provider-subscriptions.js.map +1 -1
- package/dist/schemas/settings.d.ts +29 -16
- package/dist/schemas/settings.d.ts.map +1 -1
- package/dist/schemas/settings.js +13 -20
- package/dist/schemas/settings.js.map +1 -1
- package/dist/schemas/system.d.ts +3 -0
- package/dist/schemas/system.d.ts.map +1 -1
- package/dist/schemas/system.js +5 -1
- package/dist/schemas/system.js.map +1 -1
- package/dist/schemas/workspace-repos.d.ts +14 -0
- package/dist/schemas/workspace-repos.d.ts.map +1 -1
- package/dist/schemas/workspace-repos.js +5 -0
- package/dist/schemas/workspace-repos.js.map +1 -1
- package/dist/schemas/workspace-tree.d.ts +1 -0
- package/dist/schemas/workspace-tree.d.ts.map +1 -1
- package/dist/schemas/workspace-tree.js +3 -0
- package/dist/schemas/workspace-tree.js.map +1 -1
- package/dist/transcript-fold.d.ts +31 -0
- package/dist/transcript-fold.d.ts.map +1 -0
- package/dist/transcript-fold.js +457 -0
- package/dist/transcript-fold.js.map +1 -0
- package/dist/workspace-state.d.ts +20 -3
- package/dist/workspace-state.d.ts.map +1 -1
- package/dist/workspace-state.js +22 -2
- package/dist/workspace-state.js.map +1 -1
- package/package.json +27 -5
- package/src/agent-catalog.test.ts +1 -1
- package/src/agent-catalog.ts +76 -555
- package/src/agent-run-model.test.ts +31 -15
- package/src/agent-run-model.ts +26 -12
- package/src/agent-runtimes.ts +419 -0
- package/src/approvals-execution.ts +96 -0
- package/src/arrival.ts +160 -0
- package/src/capability-ledger.test.ts +6 -4
- package/src/card-status.ts +93 -0
- package/src/chores/chores.ts +6 -3
- package/src/command-classes.test.ts +25 -0
- package/src/command-classes.ts +47 -5
- package/src/command-run.ts +78 -0
- package/src/contract-lock.test.ts +1 -1
- package/src/contract-lock.ts +2 -2
- package/src/contracts/agents.contract.ts +35 -2
- package/src/contracts/approvals.contract.ts +37 -0
- package/src/contracts/ci.contract.ts +0 -13
- package/src/contracts/git.contract.ts +28 -3
- package/src/contracts/keys.contract.ts +79 -0
- package/src/contracts/prepush.contract.ts +3 -3
- package/src/contracts/safety.contract.ts +48 -0
- package/src/contracts/usage.contract.ts +22 -0
- package/src/conversation-ids.test.ts +31 -1
- package/src/conversation-ids.ts +37 -3
- package/src/credential-material.test.ts +69 -1
- package/src/credential-material.ts +86 -5
- package/src/definition.ts +25 -53
- package/src/events.ts +508 -198
- package/src/history-state.ts +6 -0
- package/src/index.ts +24 -5
- package/src/ingress-protocol.ts +52 -1
- package/src/mentions.test.ts +22 -0
- package/src/mentions.ts +25 -0
- package/src/needs-action.ts +14 -0
- package/src/overlay-lint.test.ts +89 -0
- package/src/overlay-lint.ts +116 -0
- package/src/owner-ticket.test.ts +54 -0
- package/src/owner-ticket.ts +102 -0
- package/src/plan-pools.test.ts +71 -0
- package/src/plan-pools.ts +82 -0
- package/src/provider-specs.test.ts +130 -0
- package/src/provider-specs.ts +352 -0
- package/src/quick-model.ts +9 -5
- package/src/runner-protocol.ts +2 -2
- package/src/runtime-state.ts +6 -6
- package/src/safety-policy.ts +165 -0
- package/src/schemas/agent.ts +62 -17
- package/src/schemas/agents.ts +71 -0
- package/src/schemas/approvals.ts +174 -0
- package/src/schemas/ci.ts +19 -26
- package/src/schemas/computers.ts +52 -11
- package/src/schemas/environment.ts +21 -100
- package/src/schemas/git.ts +121 -6
- package/src/schemas/issues.ts +1 -1
- package/src/schemas/panels.ts +20 -0
- package/src/schemas/plan-limits.ts +58 -11
- package/src/schemas/provider-subscriptions.ts +7 -2
- package/src/schemas/settings.ts +67 -93
- package/src/schemas/system.ts +12 -1
- package/src/schemas/workspace-repos.ts +9 -0
- package/src/schemas/workspace-tree.ts +11 -0
- package/src/transcript-fold.test.ts +493 -0
- package/src/transcript-fold.ts +655 -0
- package/src/workspace-state.test.ts +77 -29
- package/src/workspace-state.ts +99 -31
- package/dist/contracts/drafts.contract.d.ts +0 -57
- package/dist/contracts/drafts.contract.d.ts.map +0 -1
- package/dist/contracts/drafts.contract.js +0 -32
- package/dist/contracts/drafts.contract.js.map +0 -1
- package/dist/definition-action.d.ts +0 -7
- package/dist/definition-action.d.ts.map +0 -1
- package/dist/definition-action.js +0 -3
- package/dist/definition-action.js.map +0 -1
- package/dist/publish-drafts.d.ts +0 -7
- package/dist/publish-drafts.d.ts.map +0 -1
- package/dist/publish-drafts.js +0 -20
- package/dist/publish-drafts.js.map +0 -1
- package/dist/schemas/drafts.d.ts +0 -84
- package/dist/schemas/drafts.d.ts.map +0 -1
- package/dist/schemas/drafts.js +0 -44
- package/dist/schemas/drafts.js.map +0 -1
- package/src/contracts/drafts.contract.ts +0 -35
- package/src/definition-action.ts +0 -8
- package/src/publish-drafts.ts +0 -59
- package/src/schemas/drafts.ts +0 -108
package/dist/schemas/drafts.d.ts
DELETED
|
@@ -1,84 +0,0 @@
|
|
|
1
|
-
import { z } from "zod";
|
|
2
|
-
export declare const DraftStatusSchema: z.ZodEnum<{
|
|
3
|
-
approved: "approved";
|
|
4
|
-
failed: "failed";
|
|
5
|
-
posted: "posted";
|
|
6
|
-
posting: "posting";
|
|
7
|
-
proposed: "proposed";
|
|
8
|
-
}>;
|
|
9
|
-
export type DraftStatus = z.infer<typeof DraftStatusSchema>;
|
|
10
|
-
export declare const DraftSchema: z.ZodObject<{
|
|
11
|
-
platform: z.ZodString;
|
|
12
|
-
actsAs: z.ZodOptional<z.ZodString>;
|
|
13
|
-
content: z.ZodString;
|
|
14
|
-
title: z.ZodOptional<z.ZodString>;
|
|
15
|
-
target: z.ZodOptional<z.ZodString>;
|
|
16
|
-
media: z.ZodOptional<z.ZodArray<z.ZodString>>;
|
|
17
|
-
scheduledAt: z.ZodOptional<z.ZodNumber>;
|
|
18
|
-
status: z.ZodDefault<z.ZodEnum<{
|
|
19
|
-
approved: "approved";
|
|
20
|
-
failed: "failed";
|
|
21
|
-
posted: "posted";
|
|
22
|
-
posting: "posting";
|
|
23
|
-
proposed: "proposed";
|
|
24
|
-
}>>;
|
|
25
|
-
createdAt: z.ZodOptional<z.ZodNumber>;
|
|
26
|
-
postingAt: z.ZodOptional<z.ZodNumber>;
|
|
27
|
-
postedAt: z.ZodOptional<z.ZodNumber>;
|
|
28
|
-
postedUrl: z.ZodOptional<z.ZodString>;
|
|
29
|
-
error: z.ZodOptional<z.ZodString>;
|
|
30
|
-
}, z.core.$strip>;
|
|
31
|
-
export type Draft = z.infer<typeof DraftSchema>;
|
|
32
|
-
export declare const DraftSummarySchema: z.ZodObject<{
|
|
33
|
-
platform: z.ZodString;
|
|
34
|
-
actsAs: z.ZodOptional<z.ZodString>;
|
|
35
|
-
content: z.ZodString;
|
|
36
|
-
title: z.ZodOptional<z.ZodString>;
|
|
37
|
-
target: z.ZodOptional<z.ZodString>;
|
|
38
|
-
media: z.ZodOptional<z.ZodArray<z.ZodString>>;
|
|
39
|
-
scheduledAt: z.ZodOptional<z.ZodNumber>;
|
|
40
|
-
status: z.ZodDefault<z.ZodEnum<{
|
|
41
|
-
approved: "approved";
|
|
42
|
-
failed: "failed";
|
|
43
|
-
posted: "posted";
|
|
44
|
-
posting: "posting";
|
|
45
|
-
proposed: "proposed";
|
|
46
|
-
}>>;
|
|
47
|
-
createdAt: z.ZodOptional<z.ZodNumber>;
|
|
48
|
-
postingAt: z.ZodOptional<z.ZodNumber>;
|
|
49
|
-
postedAt: z.ZodOptional<z.ZodNumber>;
|
|
50
|
-
postedUrl: z.ZodOptional<z.ZodString>;
|
|
51
|
-
error: z.ZodOptional<z.ZodString>;
|
|
52
|
-
id: z.ZodString;
|
|
53
|
-
}, z.core.$strip>;
|
|
54
|
-
export type DraftSummary = z.infer<typeof DraftSummarySchema>;
|
|
55
|
-
export declare const DraftsListSchema: z.ZodObject<{
|
|
56
|
-
drafts: z.ZodArray<z.ZodObject<{
|
|
57
|
-
platform: z.ZodString;
|
|
58
|
-
actsAs: z.ZodOptional<z.ZodString>;
|
|
59
|
-
content: z.ZodString;
|
|
60
|
-
title: z.ZodOptional<z.ZodString>;
|
|
61
|
-
target: z.ZodOptional<z.ZodString>;
|
|
62
|
-
media: z.ZodOptional<z.ZodArray<z.ZodString>>;
|
|
63
|
-
scheduledAt: z.ZodOptional<z.ZodNumber>;
|
|
64
|
-
status: z.ZodDefault<z.ZodEnum<{
|
|
65
|
-
approved: "approved";
|
|
66
|
-
failed: "failed";
|
|
67
|
-
posted: "posted";
|
|
68
|
-
posting: "posting";
|
|
69
|
-
proposed: "proposed";
|
|
70
|
-
}>>;
|
|
71
|
-
createdAt: z.ZodOptional<z.ZodNumber>;
|
|
72
|
-
postingAt: z.ZodOptional<z.ZodNumber>;
|
|
73
|
-
postedAt: z.ZodOptional<z.ZodNumber>;
|
|
74
|
-
postedUrl: z.ZodOptional<z.ZodString>;
|
|
75
|
-
error: z.ZodOptional<z.ZodString>;
|
|
76
|
-
id: z.ZodString;
|
|
77
|
-
}, z.core.$strip>>;
|
|
78
|
-
invalid: z.ZodArray<z.ZodString>;
|
|
79
|
-
}, z.core.$strip>;
|
|
80
|
-
export type DraftsList = z.infer<typeof DraftsListSchema>;
|
|
81
|
-
export declare const DraftIdParamSchema: z.ZodObject<{
|
|
82
|
-
id: z.ZodString;
|
|
83
|
-
}, z.core.$strip>;
|
|
84
|
-
//# sourceMappingURL=drafts.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"drafts.d.ts","sourceRoot":"","sources":["../../src/schemas/drafts.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAQxB,eAAO,MAAM,iBAAiB;;;;;;EAAkE,CAAC;AACjG,MAAM,MAAM,WAAW,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,iBAAiB,CAAC,CAAC;AAG5D,eAAO,MAAM,WAAW;;;;;;;;;;;;;;;;;;;;iBA6EtB,CAAC;AACH,MAAM,MAAM,KAAK,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,WAAW,CAAC,CAAC;AAEhD,eAAO,MAAM,kBAAkB;;;;;;;;;;;;;;;;;;;;;iBAAkE,CAAC;AAClG,MAAM,MAAM,YAAY,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,kBAAkB,CAAC,CAAC;AAG9D,eAAO,MAAM,gBAAgB;;;;;;;;;;;;;;;;;;;;;;;;iBAO3B,CAAC;AACH,MAAM,MAAM,UAAU,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,gBAAgB,CAAC,CAAC;AAE1D,eAAO,MAAM,kBAAkB;;iBAAqD,CAAC"}
|
package/dist/schemas/drafts.js
DELETED
|
@@ -1,44 +0,0 @@
|
|
|
1
|
-
import { z } from "zod";
|
|
2
|
-
import { entryId } from "./internal.js";
|
|
3
|
-
export const DraftStatusSchema = z.enum(["proposed", "approved", "posting", "posted", "failed"]);
|
|
4
|
-
export const DraftSchema = z.object({
|
|
5
|
-
platform: z
|
|
6
|
-
.string()
|
|
7
|
-
.min(1)
|
|
8
|
-
.describe("Where it should go. A plain name, so a new site needs no change here; an unknown one simply fails when it tries to post."),
|
|
9
|
-
actsAs: entryId
|
|
10
|
-
.optional()
|
|
11
|
-
.describe("Whose name it goes out under. Needed for anywhere that requires being logged in, because an unwatched turn naming nobody is allowed no account at all. Never guessed: one site can be connected five times over, and picking for you means picking wrong in public with no undo."),
|
|
12
|
-
content: z.string().min(1).describe("The post itself."),
|
|
13
|
-
title: z.string().optional().describe("A title, where the site wants one."),
|
|
14
|
-
target: z
|
|
15
|
-
.string()
|
|
16
|
-
.optional()
|
|
17
|
-
.describe("Where on the site: a community, a channel. Or the address of the thing this replies to, in which case it is a reply, and on some sites the difference between a thread's address and one comment's is the difference between talking to the room and answering the person."),
|
|
18
|
-
media: z.array(z.string()).optional().describe("Anything to attach, as workspace paths."),
|
|
19
|
-
scheduledAt: z
|
|
20
|
-
.number()
|
|
21
|
-
.optional()
|
|
22
|
-
.describe("When it should go out, in milliseconds. An agent may propose without one and you set it when approving; an approved draft with no time goes as soon as it is picked up."),
|
|
23
|
-
status: DraftStatusSchema.default("proposed").describe("Where it is: proposed by the agent, approved by you, being sent, sent, or failed. Rejecting is deleting it; retrying is approving a failed one again."),
|
|
24
|
-
createdAt: z.number().optional().describe("When it was written, in milliseconds."),
|
|
25
|
-
postingAt: z
|
|
26
|
-
.number()
|
|
27
|
-
.optional()
|
|
28
|
-
.describe("When sending started, in milliseconds. Needed to tell a send that is under way from one whose run died mid-flight, which the scheduled time cannot: a post due last week is not a post that has been sending since last week."),
|
|
29
|
-
postedAt: z.number().optional().describe("When it went out, in milliseconds."),
|
|
30
|
-
postedUrl: z
|
|
31
|
-
.string()
|
|
32
|
-
.optional()
|
|
33
|
-
.describe("Where it landed, when the site hands back an address. The one thing a sent draft can offer that reading it cannot: the post itself, to go and look at."),
|
|
34
|
-
error: z.string().optional().describe("Why it failed, written as a sentence for a person to read rather than as a code."),
|
|
35
|
-
});
|
|
36
|
-
export const DraftSummarySchema = DraftSchema.extend({ id: entryId.describe("The draft's id.") });
|
|
37
|
-
export const DraftsListSchema = z.object({
|
|
38
|
-
drafts: z.array(DraftSummarySchema).describe("The queue."),
|
|
39
|
-
invalid: z
|
|
40
|
-
.array(z.string())
|
|
41
|
-
.describe("Drafts that could not be read at all. Listed rather than skipped, because an agent writes these files directly and a malformed one would otherwise never post and never say why."),
|
|
42
|
-
});
|
|
43
|
-
export const DraftIdParamSchema = z.object({ id: entryId.describe("Which draft.") });
|
|
44
|
-
//# sourceMappingURL=drafts.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"drafts.js","sourceRoot":"","sources":["../../src/schemas/drafts.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AACxB,OAAO,EAAE,OAAO,EAAE,MAAM,eAAe,CAAC;AAOxC,MAAM,CAAC,MAAM,iBAAiB,GAAG,CAAC,CAAC,IAAI,CAAC,CAAC,UAAU,EAAE,UAAU,EAAE,SAAS,EAAE,QAAQ,EAAE,QAAQ,CAAC,CAAC,CAAC;AAIjG,MAAM,CAAC,MAAM,WAAW,GAAG,CAAC,CAAC,MAAM,CAAC;IAGhC,QAAQ,EAAE,CAAC;SACN,MAAM,EAAE;SACR,GAAG,CAAC,CAAC,CAAC;SACN,QAAQ,CAAC,0HAA0H,CAAC;IAgBzI,MAAM,EAAE,OAAO;SACV,QAAQ,EAAE;SACV,QAAQ,CACL,kRAAkR,CACrR;IACL,OAAO,EAAE,CAAC,CAAC,MAAM,EAAE,CAAC,GAAG,CAAC,CAAC,CAAC,CAAC,QAAQ,CAAC,kBAAkB,CAAC;IAEvD,KAAK,EAAE,CAAC,CAAC,MAAM,EAAE,CAAC,QAAQ,EAAE,CAAC,QAAQ,CAAC,oCAAoC,CAAC;IAK3E,MAAM,EAAE,CAAC;SACJ,MAAM,EAAE;SACR,QAAQ,EAAE;SACV,QAAQ,CACL,4QAA4Q,CAC/Q;IAEL,KAAK,EAAE,CAAC,CAAC,KAAK,CAAC,CAAC,CAAC,MAAM,EAAE,CAAC,CAAC,QAAQ,EAAE,CAAC,QAAQ,CAAC,yCAAyC,CAAC;IAGzF,WAAW,EAAE,CAAC;SACT,MAAM,EAAE;SACR,QAAQ,EAAE;SACV,QAAQ,CACL,yKAAyK,CAC5K;IAGL,MAAM,EAAE,iBAAiB,CAAC,OAAO,CAAC,UAAU,CAAC,CAAC,QAAQ,CAClD,uJAAuJ,CAC1J;IACD,SAAS,EAAE,CAAC,CAAC,MAAM,EAAE,CAAC,QAAQ,EAAE,CAAC,QAAQ,CAAC,uCAAuC,CAAC;IAIlF,SAAS,EAAE,CAAC;SACP,MAAM,EAAE;SACR,QAAQ,EAAE;SACV,QAAQ,CACL,+NAA+N,CAClO;IACL,QAAQ,EAAE,CAAC,CAAC,MAAM,EAAE,CAAC,QAAQ,EAAE,CAAC,QAAQ,CAAC,oCAAoC,CAAC;IAG9E,SAAS,EAAE,CAAC;SACP,MAAM,EAAE;SACR,QAAQ,EAAE;SACV,QAAQ,CACL,wJAAwJ,CAC3J;IAGL,KAAK,EAAE,CAAC,CAAC,MAAM,EAAE,CAAC,QAAQ,EAAE,CAAC,QAAQ,CAAC,kFAAkF,CAAC;CAC5H,CAAC,CAAC;AAGH,MAAM,CAAC,MAAM,kBAAkB,GAAG,WAAW,CAAC,MAAM,CAAC,EAAE,EAAE,EAAE,OAAO,CAAC,QAAQ,CAAC,iBAAiB,CAAC,EAAE,CAAC,CAAC;AAIlG,MAAM,CAAC,MAAM,gBAAgB,GAAG,CAAC,CAAC,MAAM,CAAC;IACrC,MAAM,EAAE,CAAC,CAAC,KAAK,CAAC,kBAAkB,CAAC,CAAC,QAAQ,CAAC,YAAY,CAAC;IAC1D,OAAO,EAAE,CAAC;SACL,KAAK,CAAC,CAAC,CAAC,MAAM,EAAE,CAAC;SACjB,QAAQ,CACL,kLAAkL,CACrL;CACR,CAAC,CAAC;AAGH,MAAM,CAAC,MAAM,kBAAkB,GAAG,CAAC,CAAC,MAAM,CAAC,EAAE,EAAE,EAAE,OAAO,CAAC,QAAQ,CAAC,cAAc,CAAC,EAAE,CAAC,CAAC"}
|
|
@@ -1,35 +0,0 @@
|
|
|
1
|
-
import { oc } from "@orpc/contract";
|
|
2
|
-
import { DraftIdParamSchema, DraftsListSchema, DraftSummarySchema } from "../schemas/drafts.js";
|
|
3
|
-
import { OkSchema } from "../schemas/shared.js";
|
|
4
|
-
|
|
5
|
-
// The sandbox's post-drafts queue (agent-proposed posts awaiting approval). The agent creates draft files
|
|
6
|
-
// directly, these routes are the OWNER's side: `list` is the approval inbox, `upsert` covers approve / edit /
|
|
7
|
-
// retry (all a plain re-post with a field changed, like the automations enabled toggle), `remove` is reject.
|
|
8
|
-
export const draftsContract = {
|
|
9
|
-
list: oc
|
|
10
|
-
.route({
|
|
11
|
-
method: "GET",
|
|
12
|
-
path: "/drafts",
|
|
13
|
-
summary: "Posts waiting for your approval",
|
|
14
|
-
description: "The queue of things an agent has written and would like to publish. Nothing here has gone anywhere yet.",
|
|
15
|
-
})
|
|
16
|
-
.output(DraftsListSchema),
|
|
17
|
-
upsert: oc
|
|
18
|
-
.route({
|
|
19
|
-
method: "POST",
|
|
20
|
-
path: "/drafts",
|
|
21
|
-
summary: "Approve, edit or retry a draft",
|
|
22
|
-
description: "All three are the same act with a different field changed, so they share one call. Send the draft back as you want it.",
|
|
23
|
-
})
|
|
24
|
-
.input(DraftSummarySchema)
|
|
25
|
-
.output(OkSchema),
|
|
26
|
-
remove: oc
|
|
27
|
-
.route({
|
|
28
|
-
method: "DELETE",
|
|
29
|
-
path: "/drafts/{id}",
|
|
30
|
-
summary: "Reject a draft",
|
|
31
|
-
description: "Throws one away unposted.",
|
|
32
|
-
})
|
|
33
|
-
.input(DraftIdParamSchema)
|
|
34
|
-
.output(OkSchema),
|
|
35
|
-
};
|
package/src/definition-action.ts
DELETED
|
@@ -1,8 +0,0 @@
|
|
|
1
|
-
import { z } from "zod";
|
|
2
|
-
|
|
3
|
-
/* One "do this by hand" line, the definition surface's honesty unit (definition.ts is the home story; this
|
|
4
|
-
* lives in its own leaf module because runner-protocol.ts also speaks it, and THAT file is imported by
|
|
5
|
-
* schemas/agent.ts, which definition.ts imports — the schema living in definition.ts made a cycle that left
|
|
6
|
-
* schemas half-initialized under module-eval). A subject the UI bolds, a detail written as an instruction. */
|
|
7
|
-
export const DefinitionActionSchema = z.object({ subject: z.string(), detail: z.string() });
|
|
8
|
-
export type DefinitionAction = z.infer<typeof DefinitionActionSchema>;
|
package/src/publish-drafts.ts
DELETED
|
@@ -1,59 +0,0 @@
|
|
|
1
|
-
/* HOW AN APPROVED POST GETS SENT, the shared half, written once because the daemon acts on it, the app draws
|
|
2
|
-
* it, and the two have to agree on the same seconds.
|
|
3
|
-
*
|
|
4
|
-
* THERE IS NO PUBLISHER AUTOMATION ANY MORE, and its absence is the design. Publishing used to be a scheduled
|
|
5
|
-
* automation: a cron waking every few minutes, running a shell guard over the drafts directory, almost always
|
|
6
|
-
* finding nothing, a job whose entire job was to ask "yet?" forever. It also made the approve button
|
|
7
|
-
* conditional on a row in a list nobody had asked for: delete the automation and approvals silently went
|
|
8
|
-
* nowhere, with the button still there and still saying yes. The daemon owns publishing now
|
|
9
|
-
* (drafts-publisher.ts). It knows the moment a draft comes due because it is the process that wrote the draft,
|
|
10
|
-
* so it sleeps until exactly then and costs nothing in between.
|
|
11
|
-
*
|
|
12
|
-
* APPROVAL IS NOT "SEND NOW", IT IS "SEND UNLESS I STOP YOU". A post is public and permanent the instant it
|
|
13
|
-
* lands, and the gap between realising and clicking is about two seconds, so an approved draft carrying no
|
|
14
|
-
* date of its own is dated HOLD into the future, and the queue counts it down in the open. The hold is stored
|
|
15
|
-
* as an ordinary scheduledAt rather than as a new state, which is what keeps it honest: it survives a restart,
|
|
16
|
-
* it reads as one number in the same place a scheduled post's date is already read, and calling it off is the
|
|
17
|
-
* "put it back in review" click that was there before any of this.
|
|
18
|
-
*
|
|
19
|
-
* A MINUTE, because that is the whole width of the decision: long enough to catch the wrong word you see the
|
|
20
|
-
* moment the row stops being a form, short enough that approving something still feels like sending it. */
|
|
21
|
-
export const APPROVAL_HOLD_MS = 60_000;
|
|
22
|
-
|
|
23
|
-
/* WHO CAN BE SENT BY CODE ALONE. A connector reached through a real API with a stored credential is a request
|
|
24
|
-
* the daemon can make itself, no model, no browser, no turn, and it either got a 200 or it did not. A
|
|
25
|
-
* connector that IS a logged-in browser session (reddit, x) has no such door: posting there means driving a
|
|
26
|
-
* page whose markup moves under you, past dialogs and rate screens nobody can enumerate in advance, which is
|
|
27
|
-
* precisely the work an agent turn exists to absorb.
|
|
28
|
-
*
|
|
29
|
-
* So the split follows what the platform actually offers rather than what would be cheaper, and it is stated
|
|
30
|
-
* here rather than guessed at a call site, because being wrong in the optimistic direction means a post that
|
|
31
|
-
* silently never goes out. A platform absent from this set is published by an agent turn, which always works
|
|
32
|
-
* and merely costs more. */
|
|
33
|
-
export const DIRECT_PUBLISH_PLATFORMS: ReadonlySet<string> = new Set(["discord"]);
|
|
34
|
-
|
|
35
|
-
/* WHAT THE PUBLISH TURN IS TOLD, for the drafts no API can carry. It NAMES the drafts rather than saying "go
|
|
36
|
-
* and look": the daemon has already decided what is due, and a turn that re-derives that decision can disagree
|
|
37
|
-
* with it, sending something the owner pulled back a second ago, or skipping something it judged not ready.
|
|
38
|
-
* The turn's job is the part only it can do, which is working the platform's own UI.
|
|
39
|
-
*
|
|
40
|
-
* It still writes the outcome back into the file, because the file is where the queue reads it, and a post
|
|
41
|
-
* that went out without saying so is a post the owner sends twice. */
|
|
42
|
-
export const publishTurnPrompt = (drafts: readonly { readonly id: string; readonly platform: string }[]): string =>
|
|
43
|
-
[
|
|
44
|
-
`Publish these approved post drafts, which are due now. They live in .intentic/config/drafts/, one JSON file each:`,
|
|
45
|
-
``,
|
|
46
|
-
...drafts.map((draft) => `- ${draft.id}.json (${draft.platform})`),
|
|
47
|
-
``,
|
|
48
|
-
`Take them ONE AT A TIME, and for each:`,
|
|
49
|
-
`1. Read the file. Set "status":"posting" BEFORE you act, so a turn that dies here cannot double-post.`,
|
|
50
|
-
`2. Post exactly its "content": with its "title", "target" and "media", using that platform's skill.`,
|
|
51
|
-
` A "target" that is a URL means this draft is a REPLY to whatever is at it: open that exact URL and`,
|
|
52
|
-
` reply where it lands. On reddit a comment permalink (.../comments/<post>/<slug>/<comment>/) has to`,
|
|
53
|
-
` nest under that comment rather than becoming a new top-level comment on the thread.`,
|
|
54
|
-
`3. Set "status":"posted" plus "postedAt" (epoch ms) and, when the platform gives you one, "postedUrl".`,
|
|
55
|
-
` If it failed, set "status":"failed" plus an "error" saying what went wrong in plain words the owner`,
|
|
56
|
-
` can act on, then move to the next draft instead of retrying in a loop.`,
|
|
57
|
-
``,
|
|
58
|
-
`Never rewrite the content: the owner approved these exact words. Never touch a draft not listed above.`,
|
|
59
|
-
].join(`\n`);
|
package/src/schemas/drafts.ts
DELETED
|
@@ -1,108 +0,0 @@
|
|
|
1
|
-
// drafts: agent-proposed posts awaiting owner approval (.intentic/config/drafts/<id>.json)
|
|
2
|
-
import { z } from "zod";
|
|
3
|
-
import { entryId } from "./internal.js";
|
|
4
|
-
// One JSON file per draft. The AGENT creates drafts with its normal file tools, it can't call daemon routes,
|
|
5
|
-
// the same split as the environment proposal, while the daemon edits/deletes them on the owner's behalf, so
|
|
6
|
-
// the two writers never share a file. The id IS the filename (entryId charset ⇒ path-safe); the body never
|
|
7
|
-
// carries it. Posting is the agent's job too (there is no typed publish path): a "publish approved drafts"
|
|
8
|
-
// automation wakes the agent for due drafts, which posts via the platform skills and flips the status.
|
|
9
|
-
|
|
10
|
-
export const DraftStatusSchema = z.enum(["proposed", "approved", "posting", "posted", "failed"]);
|
|
11
|
-
export type DraftStatus = z.infer<typeof DraftStatusSchema>;
|
|
12
|
-
// The on-disk file body. proposed (agent) → approved (owner) → posting (publisher, set BEFORE acting so a dead
|
|
13
|
-
// turn can't double-post) → posted | failed. Reject = delete the file; retry = re-approve a failed draft.
|
|
14
|
-
export const DraftSchema = z.object({
|
|
15
|
-
// Which skill posts it: "x" | "reddit" | "youtube" | "discord" | …, a bare string so new platforms need
|
|
16
|
-
// no contract change; an unknown platform simply fails at posting time.
|
|
17
|
-
platform: z
|
|
18
|
-
.string()
|
|
19
|
-
.min(1)
|
|
20
|
-
.describe("Where it should go. A plain name, so a new site needs no change here; an unknown one simply fails when it tries to post."),
|
|
21
|
-
/* WHOSE NAME THIS GOES OUT UNDER, a PersonaSchema id, handed to the publish turn as AgentTurnSchema.actsAs.
|
|
22
|
-
* Required in practice for every platform outside DIRECT_PUBLISH_PLATFORMS, and the reason is the whole
|
|
23
|
-
* shape of turnPersona: publishing through a browser needs a logged-in account, and an UNATTENDED turn that
|
|
24
|
-
* names no persona is denied every account there is. Without this field the publisher could only wake such a
|
|
25
|
-
* turn, one structurally unable to reach the login the post needs, which read from inside the turn as "this
|
|
26
|
-
* account is not connected" and cost two approved posts before anyone traced it back here.
|
|
27
|
-
*
|
|
28
|
-
* A PERSONA RATHER THAN AN ACCOUNT ID, because that is the vocabulary the rest of the system already speaks:
|
|
29
|
-
* `actsAs` is the only pin turnPersona honours, and a card carries the workspace scope the turn also needs to
|
|
30
|
-
* write this file's own status back. Naming the account directly would invent a second way to say the same
|
|
31
|
-
* thing, and the two would disagree the first time a card's accounts changed.
|
|
32
|
-
*
|
|
33
|
-
* The daemon never guesses it. One site can be connected several times over, five Reddit logins here, and
|
|
34
|
-
* picking for the owner means picking wrong in public, with no undo. A draft that needs a turn and names
|
|
35
|
-
* nobody is failed with that sentence instead of sent. */
|
|
36
|
-
actsAs: entryId
|
|
37
|
-
.optional()
|
|
38
|
-
.describe(
|
|
39
|
-
"Whose name it goes out under. Needed for anywhere that requires being logged in, because an unwatched turn naming nobody is allowed no account at all. Never guessed: one site can be connected five times over, and picking for you means picking wrong in public with no undo.",
|
|
40
|
-
),
|
|
41
|
-
content: z.string().min(1).describe("The post itself."),
|
|
42
|
-
// Reddit posts / YouTube uploads need one.
|
|
43
|
-
title: z.string().optional().describe("A title, where the site wants one."),
|
|
44
|
-
/* Where on the platform: subreddit / Discord channel id / community. OR the URL of the thing this draft
|
|
45
|
-
* replies to. A URL target means the draft is a reply, and on reddit the difference between a thread's
|
|
46
|
-
* address and one comment's permalink is the difference between talking to the room and answering the
|
|
47
|
-
* person: the publisher opens exactly this and replies where it lands. */
|
|
48
|
-
target: z
|
|
49
|
-
.string()
|
|
50
|
-
.optional()
|
|
51
|
-
.describe(
|
|
52
|
-
"Where on the site: a community, a channel. Or the address of the thing this replies to, in which case it is a reply, and on some sites the difference between a thread's address and one comment's is the difference between talking to the room and answering the person.",
|
|
53
|
-
),
|
|
54
|
-
// Workspace-relative attachment paths, e.g. ".intentic/config/drafts/media/chart.png".
|
|
55
|
-
media: z.array(z.string()).optional().describe("Anything to attach, as workspace paths."),
|
|
56
|
-
// Suggested post time (epoch ms, the at/nextRun convention). Optional, the agent may propose without a
|
|
57
|
-
// date and the owner sets one at approval; an approved draft with no date posts as soon as it's picked up.
|
|
58
|
-
scheduledAt: z
|
|
59
|
-
.number()
|
|
60
|
-
.optional()
|
|
61
|
-
.describe(
|
|
62
|
-
"When it should go out, in milliseconds. An agent may propose without one and you set it when approving; an approved draft with no time goes as soon as it is picked up.",
|
|
63
|
-
),
|
|
64
|
-
// Agent-written files only need platform + content; status defaults, the rest are optional, so a
|
|
65
|
-
// well-formed proposal never lands in `invalid` just for omitting bookkeeping fields.
|
|
66
|
-
status: DraftStatusSchema.default("proposed").describe(
|
|
67
|
-
"Where it is: proposed by the agent, approved by you, being sent, sent, or failed. Rejecting is deleting it; retrying is approving a failed one again.",
|
|
68
|
-
),
|
|
69
|
-
createdAt: z.number().optional().describe("When it was written, in milliseconds."),
|
|
70
|
-
// When sending STARTED, stamped with status "posting". The publisher needs it to tell a send that is under
|
|
71
|
-
// way from one whose run died mid-flight, and those two are indistinguishable from the due time, a post
|
|
72
|
-
// scheduled for last week is not a post that has been sending since last week.
|
|
73
|
-
postingAt: z
|
|
74
|
-
.number()
|
|
75
|
-
.optional()
|
|
76
|
-
.describe(
|
|
77
|
-
"When sending started, in milliseconds. Needed to tell a send that is under way from one whose run died mid-flight, which the scheduled time cannot: a post due last week is not a post that has been sending since last week.",
|
|
78
|
-
),
|
|
79
|
-
postedAt: z.number().optional().describe("When it went out, in milliseconds."),
|
|
80
|
-
// Where it landed, when the platform hands back an address for it. The one thing a posted row can offer
|
|
81
|
-
// that reading the draft cannot: the post itself, to go and look at.
|
|
82
|
-
postedUrl: z
|
|
83
|
-
.string()
|
|
84
|
-
.optional()
|
|
85
|
-
.describe(
|
|
86
|
-
"Where it landed, when the site hands back an address. The one thing a sent draft can offer that reading it cannot: the post itself, to go and look at.",
|
|
87
|
-
),
|
|
88
|
-
// Why posting failed; set with status "failed". Written for the owner to read in the queue, so it is a
|
|
89
|
-
// sentence rather than a code.
|
|
90
|
-
error: z.string().optional().describe("Why it failed, written as a sentence for a person to read rather than as a code."),
|
|
91
|
-
});
|
|
92
|
-
export type Draft = z.infer<typeof DraftSchema>;
|
|
93
|
-
// The list row / upsert input: the file body plus its filename id.
|
|
94
|
-
export const DraftSummarySchema = DraftSchema.extend({ id: entryId.describe("The draft's id.") });
|
|
95
|
-
export type DraftSummary = z.infer<typeof DraftSummarySchema>;
|
|
96
|
-
// `invalid` = filenames that failed to parse. Agent-written files are a trust boundary, without this a typo'd
|
|
97
|
-
// draft would silently never post.
|
|
98
|
-
export const DraftsListSchema = z.object({
|
|
99
|
-
drafts: z.array(DraftSummarySchema).describe("The queue."),
|
|
100
|
-
invalid: z
|
|
101
|
-
.array(z.string())
|
|
102
|
-
.describe(
|
|
103
|
-
"Drafts that could not be read at all. Listed rather than skipped, because an agent writes these files directly and a malformed one would otherwise never post and never say why.",
|
|
104
|
-
),
|
|
105
|
-
});
|
|
106
|
-
export type DraftsList = z.infer<typeof DraftsListSchema>;
|
|
107
|
-
// entryId, not a bare string: the id becomes a filename under .intentic/config/drafts/.
|
|
108
|
-
export const DraftIdParamSchema = z.object({ id: entryId.describe("Which draft.") });
|