@lobu/runtime-device 20.2.0 → 21.0.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/component.json +1 -1
- package/dist/dependencies.bun.lock +42 -36
- package/npm-shrinkwrap.json +270 -224
- package/package.json +1 -1
- package/vendor/cli/dist/commands/_lib/apply/apply-cmd.d.ts +7 -2
- package/vendor/cli/dist/commands/_lib/apply/apply-cmd.js +77 -75
- package/vendor/cli/dist/commands/_lib/apply/client.d.ts +40 -25
- package/vendor/cli/dist/commands/_lib/apply/client.js +31 -39
- package/vendor/cli/dist/commands/_lib/apply/deployment.d.ts +1 -1
- package/vendor/cli/dist/commands/_lib/apply/deployment.js +2 -2
- package/vendor/cli/dist/commands/_lib/apply/desired-state.d.ts +47 -11
- package/vendor/cli/dist/commands/_lib/apply/desired-state.js +106 -7
- package/vendor/cli/dist/commands/_lib/apply/diff.d.ts +14 -6
- package/vendor/cli/dist/commands/_lib/apply/diff.js +42 -23
- package/vendor/cli/dist/commands/_lib/apply/map-config.js +2 -3
- package/vendor/cli/dist/commands/_lib/apply/render.js +2 -0
- package/vendor/cli/dist/commands/_lib/apply/rollback-cmd.js +3 -3
- package/vendor/cli/dist/commands/_lib/connector-loader.d.ts +5 -1
- package/vendor/cli/dist/commands/_lib/connector-loader.js +1 -1
- package/vendor/cli/dist/commands/_lib/ensure-deps-installed.d.ts +15 -26
- package/vendor/cli/dist/commands/_lib/ensure-deps-installed.js +227 -136
- package/vendor/cli/dist/commands/_lib/view-bundler.d.ts +33 -0
- package/vendor/cli/dist/commands/_lib/view-bundler.js +207 -0
- package/vendor/cli/dist/commands/_lib/view-reapply.d.ts +60 -0
- package/vendor/cli/dist/commands/_lib/view-reapply.js +182 -0
- package/vendor/cli/dist/commands/dev.d.ts +14 -5
- package/vendor/cli/dist/commands/dev.js +56 -8
- package/vendor/cli/dist/commands/init.d.ts +1 -1
- package/vendor/cli/dist/commands/init.js +4 -4
- package/vendor/cli/dist/config/define.d.ts +25 -8
- package/vendor/cli/dist/config/define.js +24 -0
- package/vendor/cli/dist/connectors/README.md +15 -16
- package/vendor/cli/dist/connectors/github.ts +15 -9
- package/vendor/cli/dist/connectors/google_calendar.ts +21 -31
- package/vendor/cli/dist/connectors/google_drive.ts +106 -131
- package/vendor/cli/dist/connectors/google_gmail.ts +53 -30
- package/vendor/cli/dist/connectors/hackernews.ts +2 -5
- package/vendor/cli/dist/connectors/jira.ts +62 -27
- package/vendor/cli/dist/connectors/linear.ts +55 -21
- package/vendor/cli/dist/connectors/microsoft_outlook.ts +151 -110
- package/vendor/cli/dist/connectors/postgres.ts +19 -11
- package/vendor/cli/dist/connectors/producthunt.ts +8 -6
- package/vendor/cli/dist/connectors/reddit.ts +2 -2
- package/vendor/cli/dist/connectors/rss.ts +2 -2
- package/vendor/cli/dist/connectors/whatsapp_web.ts +5 -4
- package/vendor/cli/dist/connectors/x.ts +32 -17
- package/vendor/cli/dist/connectors/youtube.ts +18 -5
- package/vendor/cli/dist/internal/connector-compiler.d.ts +1 -1
- package/vendor/cli/dist/internal/connector-compiler.js +216 -17
- package/vendor/cli/dist/runtime-components.json +4 -4
- package/vendor/cli/package.json +2 -1
- package/vendor/connector-sdk/dist/connector-runtime.d.ts +4 -6
- package/vendor/connector-sdk/dist/connector-runtime.js +3 -5
- package/vendor/connector-sdk/dist/connector-types.d.ts +28 -13
- package/vendor/connector-sdk/dist/define-connector.d.ts +4 -1
- package/vendor/connector-sdk/dist/define-connector.js +4 -1
- package/vendor/connector-sdk/dist/http-client.d.ts +18 -7
- package/vendor/connector-sdk/dist/http-client.js +15 -13
- package/vendor/connector-sdk/dist/index.d.ts +1 -1
- package/vendor/connector-sdk/dist/retry.d.ts +15 -3
- package/vendor/connector-sdk/dist/retry.js +40 -64
- package/vendor/connector-sdk/package.json +1 -1
- package/vendor/connector-worker/dist/agent-turn/guest-entry.js +122 -10
- package/vendor/connector-worker/dist/agent-turn/guest.bundle.js +78 -10
- package/vendor/connector-worker/dist/agent-turn/types.d.ts +34 -4
- package/vendor/connector-worker/dist/compile/index.d.ts +21 -2
- package/vendor/connector-worker/dist/compile/index.js +41 -8
- package/vendor/connector-worker/dist/compile/source-capture.d.ts +10 -0
- package/vendor/connector-worker/dist/compile/source-capture.js +108 -0
- package/vendor/connector-worker/dist/daemon/agent-turn.js +97 -10
- package/vendor/connector-worker/dist/daemon/automation.d.ts +1 -1
- package/vendor/connector-worker/dist/daemon/executor.d.ts +0 -1
- package/vendor/connector-worker/dist/daemon/executor.js +42 -51
- package/vendor/connector-worker/dist/daemon/start.js +5 -1
- package/vendor/connector-worker/dist/executor/interface.d.ts +12 -8
- package/vendor/connector-worker/dist/executor/isolate.js +45 -28
- package/vendor/connector-worker/dist/self-check/index.js +15 -13
- package/vendor/connector-worker/package.json +1 -1
- package/vendor/core/dist/agent-policy.js +3 -0
- package/vendor/core/dist/connector-query-errors.d.ts +3 -3
- package/vendor/core/dist/connector-query-errors.js +8 -3
- package/vendor/core/dist/contracts/tools/manage-connections.d.ts +24 -0
- package/vendor/core/dist/contracts/tools/manage-connections.js +13 -0
- package/vendor/core/dist/contracts/tools/manage-entity-schema.d.ts +15 -25
- package/vendor/core/dist/contracts/tools/manage-entity-schema.js +3 -5
- package/vendor/core/dist/contracts/tools/manage-feeds.d.ts +11 -0
- package/vendor/core/dist/contracts/tools/manage-feeds.js +12 -1
- package/vendor/core/dist/contracts/tools/manage-operations.d.ts +47 -6
- package/vendor/core/dist/contracts/tools/manage-operations.js +36 -1
- package/vendor/core/dist/contracts/tools/manage-views.d.ts +293 -0
- package/vendor/core/dist/contracts/tools/manage-views.js +203 -0
- package/vendor/core/dist/contracts/tools/source-files-schema.d.ts +7 -0
- package/vendor/core/dist/contracts/tools/source-files-schema.js +19 -0
- package/vendor/core/dist/contracts/tools/source-files.d.ts +14 -0
- package/vendor/core/dist/contracts/tools/source-files.js +55 -0
- package/vendor/core/dist/contracts/tools/view-content-hash.d.ts +37 -0
- package/vendor/core/dist/contracts/tools/view-content-hash.js +58 -0
- package/vendor/core/dist/contracts/tools/view-path.d.ts +18 -0
- package/vendor/core/dist/contracts/tools/view-path.js +24 -0
- package/vendor/core/dist/contracts/worker/protocol.d.ts +73 -8
- package/vendor/core/dist/contracts/worker/protocol.js +58 -9
- package/vendor/core/dist/reserved.d.ts +3 -3
- package/vendor/core/dist/reserved.js +9 -1
- package/vendor/core/dist/utils/secret-redaction.js +2 -0
- package/vendor/core/package.json +25 -5
- package/vendor/core/dist/contracts/tools/manage-view-templates.d.ts +0 -165
- package/vendor/core/dist/contracts/tools/manage-view-templates.js +0 -130
|
@@ -0,0 +1,293 @@
|
|
|
1
|
+
import { type Static } from "@sinclair/typebox";
|
|
2
|
+
import type { ActionInput } from "./action-input";
|
|
3
|
+
export declare const ViewKeySchema: import("@sinclair/typebox").TString;
|
|
4
|
+
export declare const ViewAttachmentSchema: import("@sinclair/typebox").TUnion<[import("@sinclair/typebox").TObject<{
|
|
5
|
+
type: import("@sinclair/typebox").TString;
|
|
6
|
+
placement: import("@sinclair/typebox").TOptional<import("@sinclair/typebox").TUnion<[import("@sinclair/typebox").TLiteral<"tab">, import("@sinclair/typebox").TLiteral<"overview">]>>;
|
|
7
|
+
event_kind: import("@sinclair/typebox").TOptional<import("@sinclair/typebox").TNever>;
|
|
8
|
+
}>, import("@sinclair/typebox").TObject<{
|
|
9
|
+
entity: import("@sinclair/typebox").TUnion<[import("@sinclair/typebox").TInteger, import("@sinclair/typebox").TString]>;
|
|
10
|
+
placement: import("@sinclair/typebox").TOptional<import("@sinclair/typebox").TUnion<[import("@sinclair/typebox").TLiteral<"tab">, import("@sinclair/typebox").TLiteral<"overview">]>>;
|
|
11
|
+
event_kind: import("@sinclair/typebox").TOptional<import("@sinclair/typebox").TNever>;
|
|
12
|
+
}>, import("@sinclair/typebox").TObject<{
|
|
13
|
+
workspace: import("@sinclair/typebox").TLiteral<true>;
|
|
14
|
+
placement: import("@sinclair/typebox").TOptional<import("@sinclair/typebox").TUnion<[import("@sinclair/typebox").TLiteral<"tab">, import("@sinclair/typebox").TLiteral<"overview">]>>;
|
|
15
|
+
event_kind: import("@sinclair/typebox").TOptional<import("@sinclair/typebox").TNever>;
|
|
16
|
+
}>, import("@sinclair/typebox").TObject<{
|
|
17
|
+
event_kind: import("@sinclair/typebox").TString;
|
|
18
|
+
type: import("@sinclair/typebox").TString;
|
|
19
|
+
}>]>;
|
|
20
|
+
export type ViewAttachment = Static<typeof ViewAttachmentSchema>;
|
|
21
|
+
export declare const ViewParamDeclSchema: import("@sinclair/typebox").TObject<{
|
|
22
|
+
type: import("@sinclair/typebox").TUnion<[import("@sinclair/typebox").TLiteral<"string">, import("@sinclair/typebox").TLiteral<"number">, import("@sinclair/typebox").TLiteral<"boolean">]>;
|
|
23
|
+
default: import("@sinclair/typebox").TOptional<import("@sinclair/typebox").TUnknown>;
|
|
24
|
+
description: import("@sinclair/typebox").TOptional<import("@sinclair/typebox").TString>;
|
|
25
|
+
}>;
|
|
26
|
+
export type ViewParamDecl = Static<typeof ViewParamDeclSchema>;
|
|
27
|
+
export declare const ViewActionDeclSchema: import("@sinclair/typebox").TObject<{
|
|
28
|
+
emits: import("@sinclair/typebox").TString;
|
|
29
|
+
}>;
|
|
30
|
+
export type ViewActionDecl = Static<typeof ViewActionDeclSchema>;
|
|
31
|
+
export declare const ViewRowSchema: import("@sinclair/typebox").TObject<{
|
|
32
|
+
key: import("@sinclair/typebox").TString;
|
|
33
|
+
name: import("@sinclair/typebox").TString;
|
|
34
|
+
description: import("@sinclair/typebox").TString;
|
|
35
|
+
content_hash: import("@sinclair/typebox").TString;
|
|
36
|
+
attach: import("@sinclair/typebox").TArray<import("@sinclair/typebox").TUnion<[import("@sinclair/typebox").TObject<{
|
|
37
|
+
type: import("@sinclair/typebox").TString;
|
|
38
|
+
placement: import("@sinclair/typebox").TOptional<import("@sinclair/typebox").TUnion<[import("@sinclair/typebox").TLiteral<"tab">, import("@sinclair/typebox").TLiteral<"overview">]>>;
|
|
39
|
+
event_kind: import("@sinclair/typebox").TOptional<import("@sinclair/typebox").TNever>;
|
|
40
|
+
}>, import("@sinclair/typebox").TObject<{
|
|
41
|
+
entity: import("@sinclair/typebox").TUnion<[import("@sinclair/typebox").TInteger, import("@sinclair/typebox").TString]>;
|
|
42
|
+
placement: import("@sinclair/typebox").TOptional<import("@sinclair/typebox").TUnion<[import("@sinclair/typebox").TLiteral<"tab">, import("@sinclair/typebox").TLiteral<"overview">]>>;
|
|
43
|
+
event_kind: import("@sinclair/typebox").TOptional<import("@sinclair/typebox").TNever>;
|
|
44
|
+
}>, import("@sinclair/typebox").TObject<{
|
|
45
|
+
workspace: import("@sinclair/typebox").TLiteral<true>;
|
|
46
|
+
placement: import("@sinclair/typebox").TOptional<import("@sinclair/typebox").TUnion<[import("@sinclair/typebox").TLiteral<"tab">, import("@sinclair/typebox").TLiteral<"overview">]>>;
|
|
47
|
+
event_kind: import("@sinclair/typebox").TOptional<import("@sinclair/typebox").TNever>;
|
|
48
|
+
}>, import("@sinclair/typebox").TObject<{
|
|
49
|
+
event_kind: import("@sinclair/typebox").TString;
|
|
50
|
+
type: import("@sinclair/typebox").TString;
|
|
51
|
+
}>]>>;
|
|
52
|
+
params: import("@sinclair/typebox").TRecord<import("@sinclair/typebox").TString, import("@sinclair/typebox").TObject<{
|
|
53
|
+
type: import("@sinclair/typebox").TUnion<[import("@sinclair/typebox").TLiteral<"string">, import("@sinclair/typebox").TLiteral<"number">, import("@sinclair/typebox").TLiteral<"boolean">]>;
|
|
54
|
+
default: import("@sinclair/typebox").TOptional<import("@sinclair/typebox").TUnknown>;
|
|
55
|
+
description: import("@sinclair/typebox").TOptional<import("@sinclair/typebox").TString>;
|
|
56
|
+
}>>;
|
|
57
|
+
actions: import("@sinclair/typebox").TRecord<import("@sinclair/typebox").TString, import("@sinclair/typebox").TObject<{
|
|
58
|
+
emits: import("@sinclair/typebox").TString;
|
|
59
|
+
}>>;
|
|
60
|
+
last_writer: import("@sinclair/typebox").TString;
|
|
61
|
+
updated_at: import("@sinclair/typebox").TString;
|
|
62
|
+
compiled_bytes: import("@sinclair/typebox").TInteger;
|
|
63
|
+
source_bytes: import("@sinclair/typebox").TInteger;
|
|
64
|
+
}>;
|
|
65
|
+
export type ViewRow = Static<typeof ViewRowSchema>;
|
|
66
|
+
export declare const SetViewAction: import("@sinclair/typebox").TObject<{
|
|
67
|
+
action: import("@sinclair/typebox").TLiteral<"set">;
|
|
68
|
+
key: import("@sinclair/typebox").TString;
|
|
69
|
+
name: import("@sinclair/typebox").TOptional<import("@sinclair/typebox").TString>;
|
|
70
|
+
description: import("@sinclair/typebox").TOptional<import("@sinclair/typebox").TString>;
|
|
71
|
+
source_code: import("@sinclair/typebox").TString;
|
|
72
|
+
compiled_code: import("@sinclair/typebox").TOptional<import("@sinclair/typebox").TString>;
|
|
73
|
+
source_files: import("@sinclair/typebox").TOptional<import("@sinclair/typebox").TObject<{
|
|
74
|
+
entrypoint: import("@sinclair/typebox").TString;
|
|
75
|
+
files: import("@sinclair/typebox").TRecord<import("@sinclair/typebox").TString, import("@sinclair/typebox").TString>;
|
|
76
|
+
}>>;
|
|
77
|
+
dependencies: import("@sinclair/typebox").TOptional<import("@sinclair/typebox").TRecord<import("@sinclair/typebox").TString, import("@sinclair/typebox").TString>>;
|
|
78
|
+
attach: import("@sinclair/typebox").TOptional<import("@sinclair/typebox").TArray<import("@sinclair/typebox").TUnion<[import("@sinclair/typebox").TObject<{
|
|
79
|
+
type: import("@sinclair/typebox").TString;
|
|
80
|
+
placement: import("@sinclair/typebox").TOptional<import("@sinclair/typebox").TUnion<[import("@sinclair/typebox").TLiteral<"tab">, import("@sinclair/typebox").TLiteral<"overview">]>>;
|
|
81
|
+
event_kind: import("@sinclair/typebox").TOptional<import("@sinclair/typebox").TNever>;
|
|
82
|
+
}>, import("@sinclair/typebox").TObject<{
|
|
83
|
+
entity: import("@sinclair/typebox").TUnion<[import("@sinclair/typebox").TInteger, import("@sinclair/typebox").TString]>;
|
|
84
|
+
placement: import("@sinclair/typebox").TOptional<import("@sinclair/typebox").TUnion<[import("@sinclair/typebox").TLiteral<"tab">, import("@sinclair/typebox").TLiteral<"overview">]>>;
|
|
85
|
+
event_kind: import("@sinclair/typebox").TOptional<import("@sinclair/typebox").TNever>;
|
|
86
|
+
}>, import("@sinclair/typebox").TObject<{
|
|
87
|
+
workspace: import("@sinclair/typebox").TLiteral<true>;
|
|
88
|
+
placement: import("@sinclair/typebox").TOptional<import("@sinclair/typebox").TUnion<[import("@sinclair/typebox").TLiteral<"tab">, import("@sinclair/typebox").TLiteral<"overview">]>>;
|
|
89
|
+
event_kind: import("@sinclair/typebox").TOptional<import("@sinclair/typebox").TNever>;
|
|
90
|
+
}>, import("@sinclair/typebox").TObject<{
|
|
91
|
+
event_kind: import("@sinclair/typebox").TString;
|
|
92
|
+
type: import("@sinclair/typebox").TString;
|
|
93
|
+
}>]>>>;
|
|
94
|
+
params: import("@sinclair/typebox").TOptional<import("@sinclair/typebox").TRecord<import("@sinclair/typebox").TString, import("@sinclair/typebox").TObject<{
|
|
95
|
+
type: import("@sinclair/typebox").TUnion<[import("@sinclair/typebox").TLiteral<"string">, import("@sinclair/typebox").TLiteral<"number">, import("@sinclair/typebox").TLiteral<"boolean">]>;
|
|
96
|
+
default: import("@sinclair/typebox").TOptional<import("@sinclair/typebox").TUnknown>;
|
|
97
|
+
description: import("@sinclair/typebox").TOptional<import("@sinclair/typebox").TString>;
|
|
98
|
+
}>>>;
|
|
99
|
+
actions: import("@sinclair/typebox").TOptional<import("@sinclair/typebox").TRecord<import("@sinclair/typebox").TString, import("@sinclair/typebox").TObject<{
|
|
100
|
+
emits: import("@sinclair/typebox").TString;
|
|
101
|
+
}>>>;
|
|
102
|
+
last_writer: import("@sinclair/typebox").TOptional<import("@sinclair/typebox").TString>;
|
|
103
|
+
}>;
|
|
104
|
+
export declare const GetViewAction: import("@sinclair/typebox").TObject<{
|
|
105
|
+
action: import("@sinclair/typebox").TLiteral<"get">;
|
|
106
|
+
key: import("@sinclair/typebox").TString;
|
|
107
|
+
}>;
|
|
108
|
+
export declare const ListViewsAction: import("@sinclair/typebox").TObject<{
|
|
109
|
+
action: import("@sinclair/typebox").TLiteral<"list">;
|
|
110
|
+
}>;
|
|
111
|
+
export declare const RemoveViewAction: import("@sinclair/typebox").TObject<{
|
|
112
|
+
action: import("@sinclair/typebox").TLiteral<"remove">;
|
|
113
|
+
key: import("@sinclair/typebox").TString;
|
|
114
|
+
}>;
|
|
115
|
+
export declare const ManageViewsSchema: import("@sinclair/typebox").TUnion<[import("@sinclair/typebox").TObject<{
|
|
116
|
+
action: import("@sinclair/typebox").TLiteral<"set">;
|
|
117
|
+
key: import("@sinclair/typebox").TString;
|
|
118
|
+
name: import("@sinclair/typebox").TOptional<import("@sinclair/typebox").TString>;
|
|
119
|
+
description: import("@sinclair/typebox").TOptional<import("@sinclair/typebox").TString>;
|
|
120
|
+
source_code: import("@sinclair/typebox").TString;
|
|
121
|
+
compiled_code: import("@sinclair/typebox").TOptional<import("@sinclair/typebox").TString>;
|
|
122
|
+
source_files: import("@sinclair/typebox").TOptional<import("@sinclair/typebox").TObject<{
|
|
123
|
+
entrypoint: import("@sinclair/typebox").TString;
|
|
124
|
+
files: import("@sinclair/typebox").TRecord<import("@sinclair/typebox").TString, import("@sinclair/typebox").TString>;
|
|
125
|
+
}>>;
|
|
126
|
+
dependencies: import("@sinclair/typebox").TOptional<import("@sinclair/typebox").TRecord<import("@sinclair/typebox").TString, import("@sinclair/typebox").TString>>;
|
|
127
|
+
attach: import("@sinclair/typebox").TOptional<import("@sinclair/typebox").TArray<import("@sinclair/typebox").TUnion<[import("@sinclair/typebox").TObject<{
|
|
128
|
+
type: import("@sinclair/typebox").TString;
|
|
129
|
+
placement: import("@sinclair/typebox").TOptional<import("@sinclair/typebox").TUnion<[import("@sinclair/typebox").TLiteral<"tab">, import("@sinclair/typebox").TLiteral<"overview">]>>;
|
|
130
|
+
event_kind: import("@sinclair/typebox").TOptional<import("@sinclair/typebox").TNever>;
|
|
131
|
+
}>, import("@sinclair/typebox").TObject<{
|
|
132
|
+
entity: import("@sinclair/typebox").TUnion<[import("@sinclair/typebox").TInteger, import("@sinclair/typebox").TString]>;
|
|
133
|
+
placement: import("@sinclair/typebox").TOptional<import("@sinclair/typebox").TUnion<[import("@sinclair/typebox").TLiteral<"tab">, import("@sinclair/typebox").TLiteral<"overview">]>>;
|
|
134
|
+
event_kind: import("@sinclair/typebox").TOptional<import("@sinclair/typebox").TNever>;
|
|
135
|
+
}>, import("@sinclair/typebox").TObject<{
|
|
136
|
+
workspace: import("@sinclair/typebox").TLiteral<true>;
|
|
137
|
+
placement: import("@sinclair/typebox").TOptional<import("@sinclair/typebox").TUnion<[import("@sinclair/typebox").TLiteral<"tab">, import("@sinclair/typebox").TLiteral<"overview">]>>;
|
|
138
|
+
event_kind: import("@sinclair/typebox").TOptional<import("@sinclair/typebox").TNever>;
|
|
139
|
+
}>, import("@sinclair/typebox").TObject<{
|
|
140
|
+
event_kind: import("@sinclair/typebox").TString;
|
|
141
|
+
type: import("@sinclair/typebox").TString;
|
|
142
|
+
}>]>>>;
|
|
143
|
+
params: import("@sinclair/typebox").TOptional<import("@sinclair/typebox").TRecord<import("@sinclair/typebox").TString, import("@sinclair/typebox").TObject<{
|
|
144
|
+
type: import("@sinclair/typebox").TUnion<[import("@sinclair/typebox").TLiteral<"string">, import("@sinclair/typebox").TLiteral<"number">, import("@sinclair/typebox").TLiteral<"boolean">]>;
|
|
145
|
+
default: import("@sinclair/typebox").TOptional<import("@sinclair/typebox").TUnknown>;
|
|
146
|
+
description: import("@sinclair/typebox").TOptional<import("@sinclair/typebox").TString>;
|
|
147
|
+
}>>>;
|
|
148
|
+
actions: import("@sinclair/typebox").TOptional<import("@sinclair/typebox").TRecord<import("@sinclair/typebox").TString, import("@sinclair/typebox").TObject<{
|
|
149
|
+
emits: import("@sinclair/typebox").TString;
|
|
150
|
+
}>>>;
|
|
151
|
+
last_writer: import("@sinclair/typebox").TOptional<import("@sinclair/typebox").TString>;
|
|
152
|
+
}>, import("@sinclair/typebox").TObject<{
|
|
153
|
+
action: import("@sinclair/typebox").TLiteral<"get">;
|
|
154
|
+
key: import("@sinclair/typebox").TString;
|
|
155
|
+
}>, import("@sinclair/typebox").TObject<{
|
|
156
|
+
action: import("@sinclair/typebox").TLiteral<"list">;
|
|
157
|
+
}>, import("@sinclair/typebox").TObject<{
|
|
158
|
+
action: import("@sinclair/typebox").TLiteral<"remove">;
|
|
159
|
+
key: import("@sinclair/typebox").TString;
|
|
160
|
+
}>]>;
|
|
161
|
+
export type ManageViewsArgs = Static<typeof ManageViewsSchema>;
|
|
162
|
+
export type ViewSetInput = ActionInput<ManageViewsArgs, "set">;
|
|
163
|
+
export type ViewGetInput = ActionInput<ManageViewsArgs, "get">;
|
|
164
|
+
export type ViewListInput = ActionInput<ManageViewsArgs, "list">;
|
|
165
|
+
export type ViewRemoveInput = ActionInput<ManageViewsArgs, "remove">;
|
|
166
|
+
/**
|
|
167
|
+
* Result of `manage_views` — discriminated union keyed on `action`.
|
|
168
|
+
* TypeBox-first: `Static<>` derives the TS type from the same schema exposed as
|
|
169
|
+
* the tool's `outputSchema`.
|
|
170
|
+
*/
|
|
171
|
+
export declare const ManageViewsResultSchema: import("@sinclair/typebox").TUnion<[import("@sinclair/typebox").TObject<{
|
|
172
|
+
action: import("@sinclair/typebox").TLiteral<"set">;
|
|
173
|
+
view: import("@sinclair/typebox").TObject<{
|
|
174
|
+
key: import("@sinclair/typebox").TString;
|
|
175
|
+
name: import("@sinclair/typebox").TString;
|
|
176
|
+
description: import("@sinclair/typebox").TString;
|
|
177
|
+
content_hash: import("@sinclair/typebox").TString;
|
|
178
|
+
attach: import("@sinclair/typebox").TArray<import("@sinclair/typebox").TUnion<[import("@sinclair/typebox").TObject<{
|
|
179
|
+
type: import("@sinclair/typebox").TString;
|
|
180
|
+
placement: import("@sinclair/typebox").TOptional<import("@sinclair/typebox").TUnion<[import("@sinclair/typebox").TLiteral<"tab">, import("@sinclair/typebox").TLiteral<"overview">]>>;
|
|
181
|
+
event_kind: import("@sinclair/typebox").TOptional<import("@sinclair/typebox").TNever>;
|
|
182
|
+
}>, import("@sinclair/typebox").TObject<{
|
|
183
|
+
entity: import("@sinclair/typebox").TUnion<[import("@sinclair/typebox").TInteger, import("@sinclair/typebox").TString]>;
|
|
184
|
+
placement: import("@sinclair/typebox").TOptional<import("@sinclair/typebox").TUnion<[import("@sinclair/typebox").TLiteral<"tab">, import("@sinclair/typebox").TLiteral<"overview">]>>;
|
|
185
|
+
event_kind: import("@sinclair/typebox").TOptional<import("@sinclair/typebox").TNever>;
|
|
186
|
+
}>, import("@sinclair/typebox").TObject<{
|
|
187
|
+
workspace: import("@sinclair/typebox").TLiteral<true>;
|
|
188
|
+
placement: import("@sinclair/typebox").TOptional<import("@sinclair/typebox").TUnion<[import("@sinclair/typebox").TLiteral<"tab">, import("@sinclair/typebox").TLiteral<"overview">]>>;
|
|
189
|
+
event_kind: import("@sinclair/typebox").TOptional<import("@sinclair/typebox").TNever>;
|
|
190
|
+
}>, import("@sinclair/typebox").TObject<{
|
|
191
|
+
event_kind: import("@sinclair/typebox").TString;
|
|
192
|
+
type: import("@sinclair/typebox").TString;
|
|
193
|
+
}>]>>;
|
|
194
|
+
params: import("@sinclair/typebox").TRecord<import("@sinclair/typebox").TString, import("@sinclair/typebox").TObject<{
|
|
195
|
+
type: import("@sinclair/typebox").TUnion<[import("@sinclair/typebox").TLiteral<"string">, import("@sinclair/typebox").TLiteral<"number">, import("@sinclair/typebox").TLiteral<"boolean">]>;
|
|
196
|
+
default: import("@sinclair/typebox").TOptional<import("@sinclair/typebox").TUnknown>;
|
|
197
|
+
description: import("@sinclair/typebox").TOptional<import("@sinclair/typebox").TString>;
|
|
198
|
+
}>>;
|
|
199
|
+
actions: import("@sinclair/typebox").TRecord<import("@sinclair/typebox").TString, import("@sinclair/typebox").TObject<{
|
|
200
|
+
emits: import("@sinclair/typebox").TString;
|
|
201
|
+
}>>;
|
|
202
|
+
last_writer: import("@sinclair/typebox").TString;
|
|
203
|
+
updated_at: import("@sinclair/typebox").TString;
|
|
204
|
+
compiled_bytes: import("@sinclair/typebox").TInteger;
|
|
205
|
+
source_bytes: import("@sinclair/typebox").TInteger;
|
|
206
|
+
}>;
|
|
207
|
+
written: import("@sinclair/typebox").TBoolean;
|
|
208
|
+
}>, import("@sinclair/typebox").TObject<{
|
|
209
|
+
action: import("@sinclair/typebox").TLiteral<"get">;
|
|
210
|
+
view: import("@sinclair/typebox").TObject<{
|
|
211
|
+
key: import("@sinclair/typebox").TString;
|
|
212
|
+
name: import("@sinclair/typebox").TString;
|
|
213
|
+
description: import("@sinclair/typebox").TString;
|
|
214
|
+
content_hash: import("@sinclair/typebox").TString;
|
|
215
|
+
attach: import("@sinclair/typebox").TArray<import("@sinclair/typebox").TUnion<[import("@sinclair/typebox").TObject<{
|
|
216
|
+
type: import("@sinclair/typebox").TString;
|
|
217
|
+
placement: import("@sinclair/typebox").TOptional<import("@sinclair/typebox").TUnion<[import("@sinclair/typebox").TLiteral<"tab">, import("@sinclair/typebox").TLiteral<"overview">]>>;
|
|
218
|
+
event_kind: import("@sinclair/typebox").TOptional<import("@sinclair/typebox").TNever>;
|
|
219
|
+
}>, import("@sinclair/typebox").TObject<{
|
|
220
|
+
entity: import("@sinclair/typebox").TUnion<[import("@sinclair/typebox").TInteger, import("@sinclair/typebox").TString]>;
|
|
221
|
+
placement: import("@sinclair/typebox").TOptional<import("@sinclair/typebox").TUnion<[import("@sinclair/typebox").TLiteral<"tab">, import("@sinclair/typebox").TLiteral<"overview">]>>;
|
|
222
|
+
event_kind: import("@sinclair/typebox").TOptional<import("@sinclair/typebox").TNever>;
|
|
223
|
+
}>, import("@sinclair/typebox").TObject<{
|
|
224
|
+
workspace: import("@sinclair/typebox").TLiteral<true>;
|
|
225
|
+
placement: import("@sinclair/typebox").TOptional<import("@sinclair/typebox").TUnion<[import("@sinclair/typebox").TLiteral<"tab">, import("@sinclair/typebox").TLiteral<"overview">]>>;
|
|
226
|
+
event_kind: import("@sinclair/typebox").TOptional<import("@sinclair/typebox").TNever>;
|
|
227
|
+
}>, import("@sinclair/typebox").TObject<{
|
|
228
|
+
event_kind: import("@sinclair/typebox").TString;
|
|
229
|
+
type: import("@sinclair/typebox").TString;
|
|
230
|
+
}>]>>;
|
|
231
|
+
params: import("@sinclair/typebox").TRecord<import("@sinclair/typebox").TString, import("@sinclair/typebox").TObject<{
|
|
232
|
+
type: import("@sinclair/typebox").TUnion<[import("@sinclair/typebox").TLiteral<"string">, import("@sinclair/typebox").TLiteral<"number">, import("@sinclair/typebox").TLiteral<"boolean">]>;
|
|
233
|
+
default: import("@sinclair/typebox").TOptional<import("@sinclair/typebox").TUnknown>;
|
|
234
|
+
description: import("@sinclair/typebox").TOptional<import("@sinclair/typebox").TString>;
|
|
235
|
+
}>>;
|
|
236
|
+
actions: import("@sinclair/typebox").TRecord<import("@sinclair/typebox").TString, import("@sinclair/typebox").TObject<{
|
|
237
|
+
emits: import("@sinclair/typebox").TString;
|
|
238
|
+
}>>;
|
|
239
|
+
last_writer: import("@sinclair/typebox").TString;
|
|
240
|
+
updated_at: import("@sinclair/typebox").TString;
|
|
241
|
+
compiled_bytes: import("@sinclair/typebox").TInteger;
|
|
242
|
+
source_bytes: import("@sinclair/typebox").TInteger;
|
|
243
|
+
}>;
|
|
244
|
+
source_code: import("@sinclair/typebox").TString;
|
|
245
|
+
source_files: import("@sinclair/typebox").TUnion<[import("@sinclair/typebox").TObject<{
|
|
246
|
+
entrypoint: import("@sinclair/typebox").TString;
|
|
247
|
+
files: import("@sinclair/typebox").TRecord<import("@sinclair/typebox").TString, import("@sinclair/typebox").TString>;
|
|
248
|
+
}>, import("@sinclair/typebox").TNull]>;
|
|
249
|
+
dependencies: import("@sinclair/typebox").TUnion<[import("@sinclair/typebox").TRecord<import("@sinclair/typebox").TString, import("@sinclair/typebox").TString>, import("@sinclair/typebox").TNull]>;
|
|
250
|
+
source_complete: import("@sinclair/typebox").TBoolean;
|
|
251
|
+
}>, import("@sinclair/typebox").TObject<{
|
|
252
|
+
action: import("@sinclair/typebox").TLiteral<"list">;
|
|
253
|
+
views: import("@sinclair/typebox").TArray<import("@sinclair/typebox").TObject<{
|
|
254
|
+
key: import("@sinclair/typebox").TString;
|
|
255
|
+
name: import("@sinclair/typebox").TString;
|
|
256
|
+
description: import("@sinclair/typebox").TString;
|
|
257
|
+
content_hash: import("@sinclair/typebox").TString;
|
|
258
|
+
attach: import("@sinclair/typebox").TArray<import("@sinclair/typebox").TUnion<[import("@sinclair/typebox").TObject<{
|
|
259
|
+
type: import("@sinclair/typebox").TString;
|
|
260
|
+
placement: import("@sinclair/typebox").TOptional<import("@sinclair/typebox").TUnion<[import("@sinclair/typebox").TLiteral<"tab">, import("@sinclair/typebox").TLiteral<"overview">]>>;
|
|
261
|
+
event_kind: import("@sinclair/typebox").TOptional<import("@sinclair/typebox").TNever>;
|
|
262
|
+
}>, import("@sinclair/typebox").TObject<{
|
|
263
|
+
entity: import("@sinclair/typebox").TUnion<[import("@sinclair/typebox").TInteger, import("@sinclair/typebox").TString]>;
|
|
264
|
+
placement: import("@sinclair/typebox").TOptional<import("@sinclair/typebox").TUnion<[import("@sinclair/typebox").TLiteral<"tab">, import("@sinclair/typebox").TLiteral<"overview">]>>;
|
|
265
|
+
event_kind: import("@sinclair/typebox").TOptional<import("@sinclair/typebox").TNever>;
|
|
266
|
+
}>, import("@sinclair/typebox").TObject<{
|
|
267
|
+
workspace: import("@sinclair/typebox").TLiteral<true>;
|
|
268
|
+
placement: import("@sinclair/typebox").TOptional<import("@sinclair/typebox").TUnion<[import("@sinclair/typebox").TLiteral<"tab">, import("@sinclair/typebox").TLiteral<"overview">]>>;
|
|
269
|
+
event_kind: import("@sinclair/typebox").TOptional<import("@sinclair/typebox").TNever>;
|
|
270
|
+
}>, import("@sinclair/typebox").TObject<{
|
|
271
|
+
event_kind: import("@sinclair/typebox").TString;
|
|
272
|
+
type: import("@sinclair/typebox").TString;
|
|
273
|
+
}>]>>;
|
|
274
|
+
params: import("@sinclair/typebox").TRecord<import("@sinclair/typebox").TString, import("@sinclair/typebox").TObject<{
|
|
275
|
+
type: import("@sinclair/typebox").TUnion<[import("@sinclair/typebox").TLiteral<"string">, import("@sinclair/typebox").TLiteral<"number">, import("@sinclair/typebox").TLiteral<"boolean">]>;
|
|
276
|
+
default: import("@sinclair/typebox").TOptional<import("@sinclair/typebox").TUnknown>;
|
|
277
|
+
description: import("@sinclair/typebox").TOptional<import("@sinclair/typebox").TString>;
|
|
278
|
+
}>>;
|
|
279
|
+
actions: import("@sinclair/typebox").TRecord<import("@sinclair/typebox").TString, import("@sinclair/typebox").TObject<{
|
|
280
|
+
emits: import("@sinclair/typebox").TString;
|
|
281
|
+
}>>;
|
|
282
|
+
last_writer: import("@sinclair/typebox").TString;
|
|
283
|
+
updated_at: import("@sinclair/typebox").TString;
|
|
284
|
+
compiled_bytes: import("@sinclair/typebox").TInteger;
|
|
285
|
+
source_bytes: import("@sinclair/typebox").TInteger;
|
|
286
|
+
}>>;
|
|
287
|
+
}>, import("@sinclair/typebox").TObject<{
|
|
288
|
+
action: import("@sinclair/typebox").TLiteral<"remove">;
|
|
289
|
+
key: import("@sinclair/typebox").TString;
|
|
290
|
+
removed: import("@sinclair/typebox").TBoolean;
|
|
291
|
+
}>]>;
|
|
292
|
+
export type ManageViewsResult = Static<typeof ManageViewsResultSchema>;
|
|
293
|
+
//# sourceMappingURL=manage-views.d.ts.map
|
|
@@ -0,0 +1,203 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.ManageViewsResultSchema = exports.ManageViewsSchema = exports.RemoveViewAction = exports.ListViewsAction = exports.GetViewAction = exports.SetViewAction = exports.ViewRowSchema = exports.ViewActionDeclSchema = exports.ViewParamDeclSchema = exports.ViewAttachmentSchema = exports.ViewKeySchema = void 0;
|
|
4
|
+
const typebox_1 = require("@sinclair/typebox");
|
|
5
|
+
const source_files_schema_1 = require("./source-files-schema");
|
|
6
|
+
// ============================================
|
|
7
|
+
// Lobu views: React modules rendered in the sandboxed frame.
|
|
8
|
+
// ============================================
|
|
9
|
+
// A view key names the module: lowercase, dashes, 1-64 chars. The folder is
|
|
10
|
+
// only a convention — the key is the identity (no `custom:<name>` prefix).
|
|
11
|
+
exports.ViewKeySchema = typebox_1.Type.String({
|
|
12
|
+
pattern: "^[a-z0-9][a-z0-9-]{0,63}$",
|
|
13
|
+
minLength: 1,
|
|
14
|
+
maxLength: 64,
|
|
15
|
+
description: "View key, e.g. 'pipeline'.",
|
|
16
|
+
});
|
|
17
|
+
// Where a view appears. The attach line lives in the module source; there are
|
|
18
|
+
// no attach/detach verbs — changing placement means re-saving the view.
|
|
19
|
+
const ViewPlacementSchema = typebox_1.Type.Optional(typebox_1.Type.Union([typebox_1.Type.Literal("tab"), typebox_1.Type.Literal("overview")], {
|
|
20
|
+
description: "Type-attached views render as a full tab or an Overview card.",
|
|
21
|
+
}));
|
|
22
|
+
// `event_kind` belongs to the event variant alone. The subject variants stay
|
|
23
|
+
// open objects (the handler reports a mixed entry itself), so each one forbids
|
|
24
|
+
// the key: otherwise `{ event_kind, type, placement }` would validate as a
|
|
25
|
+
// type attachment and render as a type tab.
|
|
26
|
+
const NoEventKind = typebox_1.Type.Optional(typebox_1.Type.Never());
|
|
27
|
+
exports.ViewAttachmentSchema = typebox_1.Type.Union([
|
|
28
|
+
typebox_1.Type.Object({
|
|
29
|
+
type: typebox_1.Type.String({
|
|
30
|
+
minLength: 1,
|
|
31
|
+
maxLength: 120,
|
|
32
|
+
description: "Entity-type slug this view attaches to.",
|
|
33
|
+
}),
|
|
34
|
+
placement: ViewPlacementSchema,
|
|
35
|
+
event_kind: NoEventKind,
|
|
36
|
+
}),
|
|
37
|
+
typebox_1.Type.Object({
|
|
38
|
+
entity: typebox_1.Type.Union([typebox_1.Type.Integer(), typebox_1.Type.String()], {
|
|
39
|
+
description: "Entity id (number) or slug (string) this view attaches to.",
|
|
40
|
+
}),
|
|
41
|
+
placement: ViewPlacementSchema,
|
|
42
|
+
event_kind: NoEventKind,
|
|
43
|
+
}),
|
|
44
|
+
typebox_1.Type.Object({
|
|
45
|
+
workspace: typebox_1.Type.Literal(true, {
|
|
46
|
+
description: "A tab on the Data hub, at /data/-/views/<key>.",
|
|
47
|
+
}),
|
|
48
|
+
placement: ViewPlacementSchema,
|
|
49
|
+
event_kind: NoEventKind,
|
|
50
|
+
}),
|
|
51
|
+
// An event subject: the view renders one event (scope.event) on the event's
|
|
52
|
+
// own page, /events/<id>/-/views/<key>. It matches an event whose kind is
|
|
53
|
+
// `event_kind` AND that links at least one entity of `type`. Closed, and no
|
|
54
|
+
// placement: the event page has one layout.
|
|
55
|
+
typebox_1.Type.Object({
|
|
56
|
+
event_kind: typebox_1.Type.String({
|
|
57
|
+
minLength: 1,
|
|
58
|
+
maxLength: 128,
|
|
59
|
+
description: "Event kind (semantic_type) this view renders, e.g. 'deal.won'.",
|
|
60
|
+
}),
|
|
61
|
+
type: typebox_1.Type.String({
|
|
62
|
+
minLength: 1,
|
|
63
|
+
maxLength: 120,
|
|
64
|
+
description: "Entity-type slug the event must link at least one entity of.",
|
|
65
|
+
}),
|
|
66
|
+
}, { additionalProperties: false }),
|
|
67
|
+
]);
|
|
68
|
+
// Declared, typed URL params. Unknown params are ignored; `peek` and `peek_*`
|
|
69
|
+
// are reserved (the web shell's peek pane reads them on every page).
|
|
70
|
+
exports.ViewParamDeclSchema = typebox_1.Type.Object({
|
|
71
|
+
type: typebox_1.Type.Union([typebox_1.Type.Literal("string"), typebox_1.Type.Literal("number"), typebox_1.Type.Literal("boolean")], { description: "Param type used to validate the URL value." }),
|
|
72
|
+
default: typebox_1.Type.Optional(typebox_1.Type.Unknown({ description: "Default when the URL omits the param." })),
|
|
73
|
+
description: typebox_1.Type.Optional(typebox_1.Type.String()),
|
|
74
|
+
});
|
|
75
|
+
// Actions a view declares as metadata; each emits an event kind through the
|
|
76
|
+
// template-action chokepoint. A removed action stops working on the next read
|
|
77
|
+
// because the check runs against the CURRENT view row.
|
|
78
|
+
exports.ViewActionDeclSchema = typebox_1.Type.Object({
|
|
79
|
+
emits: typebox_1.Type.String({
|
|
80
|
+
minLength: 1,
|
|
81
|
+
maxLength: 128,
|
|
82
|
+
description: "Event kind appended when the action fires, e.g. 'deal.won'.",
|
|
83
|
+
}),
|
|
84
|
+
});
|
|
85
|
+
// Public projection of a stored view: metadata only, never the bundle. The
|
|
86
|
+
// bundle travels over the view resource / shell route; the source over get.
|
|
87
|
+
exports.ViewRowSchema = typebox_1.Type.Object({
|
|
88
|
+
key: exports.ViewKeySchema,
|
|
89
|
+
name: typebox_1.Type.String(),
|
|
90
|
+
description: typebox_1.Type.String(),
|
|
91
|
+
content_hash: typebox_1.Type.String({
|
|
92
|
+
description: "First 16 hex of sha256(source, declared metadata, compiled artifact digest, retained source files and dependencies). Identical content means no write.",
|
|
93
|
+
}),
|
|
94
|
+
attach: typebox_1.Type.Array(exports.ViewAttachmentSchema),
|
|
95
|
+
params: typebox_1.Type.Record(typebox_1.Type.String(), exports.ViewParamDeclSchema),
|
|
96
|
+
actions: typebox_1.Type.Record(typebox_1.Type.String(), exports.ViewActionDeclSchema),
|
|
97
|
+
last_writer: typebox_1.Type.String({
|
|
98
|
+
description: "apply:<apply_id> | <user_id> | migration:view-templates",
|
|
99
|
+
}),
|
|
100
|
+
updated_at: typebox_1.Type.String(),
|
|
101
|
+
compiled_bytes: typebox_1.Type.Integer(),
|
|
102
|
+
source_bytes: typebox_1.Type.Integer(),
|
|
103
|
+
});
|
|
104
|
+
// ============================================
|
|
105
|
+
// Input Schema (union of per-action variants)
|
|
106
|
+
// ============================================
|
|
107
|
+
//
|
|
108
|
+
// The wire schema flattens this union into ONE MCP object and merges duplicate
|
|
109
|
+
// properties first-occurrence-wins, so a property carried by more than one
|
|
110
|
+
// variant must read true for every one of them.
|
|
111
|
+
exports.SetViewAction = typebox_1.Type.Object({
|
|
112
|
+
action: typebox_1.Type.Literal("set", {
|
|
113
|
+
description: "Store a view: compile source_code and upsert by key.",
|
|
114
|
+
}),
|
|
115
|
+
key: exports.ViewKeySchema,
|
|
116
|
+
name: typebox_1.Type.Optional(typebox_1.Type.String({
|
|
117
|
+
maxLength: 120,
|
|
118
|
+
description: "[set] Display name; defaults to key.",
|
|
119
|
+
})),
|
|
120
|
+
description: typebox_1.Type.Optional(typebox_1.Type.String({ maxLength: 500, description: "[set] What the view shows." })),
|
|
121
|
+
source_code: typebox_1.Type.String({
|
|
122
|
+
minLength: 1,
|
|
123
|
+
maxLength: 1000000,
|
|
124
|
+
description: "[set] The view module source (TSX). Compiled server-side.",
|
|
125
|
+
}),
|
|
126
|
+
compiled_code: typebox_1.Type.Optional(typebox_1.Type.String({
|
|
127
|
+
minLength: 1,
|
|
128
|
+
description: "[set] CLI-bundled browser bundle for the source (relative files and npm deps resolved where node_modules exists). When present the server stores it after the size check instead of compiling; when absent the server compiles source_code itself (the chat-agent path).",
|
|
129
|
+
})),
|
|
130
|
+
source_files: typebox_1.Type.Optional(source_files_schema_1.SourceFilesSchema),
|
|
131
|
+
dependencies: typebox_1.Type.Optional(source_files_schema_1.SourceDependenciesSchema),
|
|
132
|
+
attach: typebox_1.Type.Optional(typebox_1.Type.Array(exports.ViewAttachmentSchema, {
|
|
133
|
+
description: "[set] Where the view appears; extracted from the module by the caller.",
|
|
134
|
+
})),
|
|
135
|
+
params: typebox_1.Type.Optional(typebox_1.Type.Record(typebox_1.Type.String(), exports.ViewParamDeclSchema, {
|
|
136
|
+
description: "[set] Declared URL params.",
|
|
137
|
+
})),
|
|
138
|
+
actions: typebox_1.Type.Optional(typebox_1.Type.Record(typebox_1.Type.String(), exports.ViewActionDeclSchema, {
|
|
139
|
+
description: "[set] Declared actions and the event kind each emits.",
|
|
140
|
+
})),
|
|
141
|
+
last_writer: typebox_1.Type.Optional(typebox_1.Type.String({
|
|
142
|
+
maxLength: 200,
|
|
143
|
+
description: "[set] Provenance; defaults to the caller.",
|
|
144
|
+
})),
|
|
145
|
+
});
|
|
146
|
+
exports.GetViewAction = typebox_1.Type.Object({
|
|
147
|
+
action: typebox_1.Type.Literal("get", {
|
|
148
|
+
description: "Fetch one view's metadata + source.",
|
|
149
|
+
}),
|
|
150
|
+
key: exports.ViewKeySchema,
|
|
151
|
+
});
|
|
152
|
+
exports.ListViewsAction = typebox_1.Type.Object({
|
|
153
|
+
action: typebox_1.Type.Literal("list", {
|
|
154
|
+
description: "List every view's metadata (never bundles).",
|
|
155
|
+
}),
|
|
156
|
+
});
|
|
157
|
+
exports.RemoveViewAction = typebox_1.Type.Object({
|
|
158
|
+
action: typebox_1.Type.Literal("remove", {
|
|
159
|
+
description: "Delete a view by key.",
|
|
160
|
+
}),
|
|
161
|
+
key: exports.ViewKeySchema,
|
|
162
|
+
});
|
|
163
|
+
exports.ManageViewsSchema = typebox_1.Type.Union([
|
|
164
|
+
exports.SetViewAction,
|
|
165
|
+
exports.GetViewAction,
|
|
166
|
+
exports.ListViewsAction,
|
|
167
|
+
exports.RemoveViewAction,
|
|
168
|
+
]);
|
|
169
|
+
// ============================================
|
|
170
|
+
// Result Types
|
|
171
|
+
// ============================================
|
|
172
|
+
/**
|
|
173
|
+
* Result of `manage_views` — discriminated union keyed on `action`.
|
|
174
|
+
* TypeBox-first: `Static<>` derives the TS type from the same schema exposed as
|
|
175
|
+
* the tool's `outputSchema`.
|
|
176
|
+
*/
|
|
177
|
+
exports.ManageViewsResultSchema = typebox_1.Type.Union([
|
|
178
|
+
typebox_1.Type.Object({
|
|
179
|
+
action: typebox_1.Type.Literal("set"),
|
|
180
|
+
view: exports.ViewRowSchema,
|
|
181
|
+
written: typebox_1.Type.Boolean({
|
|
182
|
+
description: "False when the same source, retained files, dependencies, metadata and executable artifact were already stored (no write).",
|
|
183
|
+
}),
|
|
184
|
+
}),
|
|
185
|
+
typebox_1.Type.Object({
|
|
186
|
+
action: typebox_1.Type.Literal("get"),
|
|
187
|
+
view: exports.ViewRowSchema,
|
|
188
|
+
source_code: typebox_1.Type.String(),
|
|
189
|
+
source_files: typebox_1.Type.Union([source_files_schema_1.SourceFilesSchema, typebox_1.Type.Null()]),
|
|
190
|
+
dependencies: typebox_1.Type.Union([source_files_schema_1.SourceDependenciesSchema, typebox_1.Type.Null()]),
|
|
191
|
+
source_complete: typebox_1.Type.Boolean(),
|
|
192
|
+
}),
|
|
193
|
+
typebox_1.Type.Object({
|
|
194
|
+
action: typebox_1.Type.Literal("list"),
|
|
195
|
+
views: typebox_1.Type.Array(exports.ViewRowSchema),
|
|
196
|
+
}),
|
|
197
|
+
typebox_1.Type.Object({
|
|
198
|
+
action: typebox_1.Type.Literal("remove"),
|
|
199
|
+
key: typebox_1.Type.String(),
|
|
200
|
+
removed: typebox_1.Type.Boolean(),
|
|
201
|
+
}),
|
|
202
|
+
]);
|
|
203
|
+
//# sourceMappingURL=manage-views.js.map
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
/** Paths are relative to the author's project, never a build machine. */
|
|
2
|
+
export declare const SourceFilesSchema: import("@sinclair/typebox").TObject<{
|
|
3
|
+
entrypoint: import("@sinclair/typebox").TString;
|
|
4
|
+
files: import("@sinclair/typebox").TRecord<import("@sinclair/typebox").TString, import("@sinclair/typebox").TString>;
|
|
5
|
+
}>;
|
|
6
|
+
export declare const SourceDependenciesSchema: import("@sinclair/typebox").TRecord<import("@sinclair/typebox").TString, import("@sinclair/typebox").TString>;
|
|
7
|
+
//# sourceMappingURL=source-files-schema.d.ts.map
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.SourceDependenciesSchema = exports.SourceFilesSchema = void 0;
|
|
4
|
+
const typebox_1 = require("@sinclair/typebox");
|
|
5
|
+
const source_files_1 = require("./source-files");
|
|
6
|
+
/** Paths are relative to the author's project, never a build machine. */
|
|
7
|
+
exports.SourceFilesSchema = typebox_1.Type.Object({
|
|
8
|
+
entrypoint: typebox_1.Type.String({ minLength: 1, maxLength: 240 }),
|
|
9
|
+
files: typebox_1.Type.Record(typebox_1.Type.String(), typebox_1.Type.String(), {
|
|
10
|
+
maxProperties: source_files_1.SOURCE_MAX_FILES,
|
|
11
|
+
}),
|
|
12
|
+
}, {
|
|
13
|
+
description: "Author files consumed by the build, keyed by portable project-relative paths. entrypoint identifies the file matching source_code. Never include secrets, machine paths, node_modules, or resolved credentials.",
|
|
14
|
+
});
|
|
15
|
+
exports.SourceDependenciesSchema = typebox_1.Type.Record(typebox_1.Type.String(), typebox_1.Type.String(), {
|
|
16
|
+
maxProperties: source_files_1.SOURCE_MAX_FILES,
|
|
17
|
+
description: "Direct npm dependencies and their exact installed versions, captured with source_files. This is not a lockfile.",
|
|
18
|
+
});
|
|
19
|
+
//# sourceMappingURL=source-files-schema.js.map
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
import type { Static } from "@sinclair/typebox";
|
|
2
|
+
import type { SourceDependenciesSchema, SourceFilesSchema } from "./source-files-schema";
|
|
3
|
+
export declare const SOURCE_MAX_BYTES = 1000000;
|
|
4
|
+
export declare const SOURCE_MAX_FILES = 128;
|
|
5
|
+
export type SourceFiles = Static<typeof SourceFilesSchema>;
|
|
6
|
+
export type SourceDependencies = Static<typeof SourceDependenciesSchema>;
|
|
7
|
+
export interface RetainedSource {
|
|
8
|
+
sourceFiles: SourceFiles;
|
|
9
|
+
dependencies: SourceDependencies;
|
|
10
|
+
}
|
|
11
|
+
export declare function assertSourcePath(path: string): void;
|
|
12
|
+
/** Shared validation at capture and API boundaries. No caller can assert completeness. */
|
|
13
|
+
export declare function validateRetainedSource(sourceCode: string, sourceFiles: SourceFiles, dependencies: SourceDependencies): void;
|
|
14
|
+
//# sourceMappingURL=source-files.d.ts.map
|
|
@@ -0,0 +1,55 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.SOURCE_MAX_FILES = exports.SOURCE_MAX_BYTES = void 0;
|
|
4
|
+
exports.assertSourcePath = assertSourcePath;
|
|
5
|
+
exports.validateRetainedSource = validateRetainedSource;
|
|
6
|
+
exports.SOURCE_MAX_BYTES = 1000000;
|
|
7
|
+
exports.SOURCE_MAX_FILES = 128;
|
|
8
|
+
function assertSourcePath(path) {
|
|
9
|
+
const parts = path.split("/");
|
|
10
|
+
if (!path ||
|
|
11
|
+
path.length > 240 ||
|
|
12
|
+
/[\\:%]/.test(path) ||
|
|
13
|
+
path.includes("\0") ||
|
|
14
|
+
parts.some((part) => !part ||
|
|
15
|
+
part === "." ||
|
|
16
|
+
part === ".." ||
|
|
17
|
+
part === "node_modules" ||
|
|
18
|
+
part === ".git" ||
|
|
19
|
+
part === ".lobu" ||
|
|
20
|
+
part === ".npmrc" ||
|
|
21
|
+
part.startsWith(".env"))) {
|
|
22
|
+
throw new Error(`Source path must be a portable project file: ${path}`);
|
|
23
|
+
}
|
|
24
|
+
}
|
|
25
|
+
/** Shared validation at capture and API boundaries. No caller can assert completeness. */
|
|
26
|
+
function validateRetainedSource(sourceCode, sourceFiles, dependencies) {
|
|
27
|
+
assertSourcePath(sourceFiles.entrypoint);
|
|
28
|
+
const files = Object.entries(sourceFiles.files);
|
|
29
|
+
if (files.length === 0 || files.length > exports.SOURCE_MAX_FILES) {
|
|
30
|
+
throw new Error(`Source must contain between 1 and ${exports.SOURCE_MAX_FILES} files`);
|
|
31
|
+
}
|
|
32
|
+
for (const [path, contents] of files) {
|
|
33
|
+
assertSourcePath(path);
|
|
34
|
+
if (typeof contents !== "string")
|
|
35
|
+
throw new Error(`Source file must be text: ${path}`);
|
|
36
|
+
}
|
|
37
|
+
if (!Object.keys(sourceFiles.files).includes(sourceFiles.entrypoint) ||
|
|
38
|
+
sourceFiles.files[sourceFiles.entrypoint] !== sourceCode) {
|
|
39
|
+
throw new Error("Source entrypoint must match source_code exactly");
|
|
40
|
+
}
|
|
41
|
+
const packages = Object.entries(dependencies);
|
|
42
|
+
if (packages.length > exports.SOURCE_MAX_FILES)
|
|
43
|
+
throw new Error("Too many source dependencies");
|
|
44
|
+
for (const [name, version] of packages) {
|
|
45
|
+
if (!/^(?:@[a-z0-9._-]+\/)?[a-z0-9._-]+$/.test(name) ||
|
|
46
|
+
!/^\d+\.\d+\.\d+(?:-[0-9A-Za-z.-]+)?(?:\+[0-9A-Za-z.-]+)?$/.test(version)) {
|
|
47
|
+
throw new Error(`Source dependency requires a package name and exact version: ${name}`);
|
|
48
|
+
}
|
|
49
|
+
}
|
|
50
|
+
if (new TextEncoder().encode(JSON.stringify({ sourceFiles, dependencies }))
|
|
51
|
+
.length > exports.SOURCE_MAX_BYTES) {
|
|
52
|
+
throw new Error(`Source files exceed ${exports.SOURCE_MAX_BYTES} bytes`);
|
|
53
|
+
}
|
|
54
|
+
}
|
|
55
|
+
//# sourceMappingURL=source-files.js.map
|