@ever-works/contracts 1.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/README.md +62 -0
- package/dist/api/index.cjs +395 -0
- package/dist/api/index.d.cts +2171 -0
- package/dist/api/index.d.ts +2171 -0
- package/dist/api/index.js +335 -0
- package/dist/domain/index.cjs +335 -0
- package/dist/domain/index.d.cts +316 -0
- package/dist/domain/index.d.ts +316 -0
- package/dist/domain/index.js +317 -0
- package/dist/feed.types-BWk3CHqj.d.cts +355 -0
- package/dist/feed.types-BWk3CHqj.d.ts +355 -0
- package/dist/form/index.cjs +2 -0
- package/dist/form/index.d.cts +104 -0
- package/dist/form/index.d.ts +104 -0
- package/dist/form/index.js +1 -0
- package/dist/index.cjs +6968 -0
- package/dist/index.d.cts +11815 -0
- package/dist/index.d.ts +11815 -0
- package/dist/index.js +6019 -0
- package/dist/item/index.cjs +2 -0
- package/dist/item/index.d.cts +195 -0
- package/dist/item/index.d.ts +195 -0
- package/dist/item/index.js +1 -0
- package/dist/telemetry/index.cjs +15 -0
- package/dist/telemetry/index.d.cts +120 -0
- package/dist/telemetry/index.d.ts +120 -0
- package/dist/telemetry/index.js +13 -0
- package/package.json +81 -0
|
@@ -0,0 +1,355 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Merge policy — the configurable enforcement matrix for agent-driven merges
|
|
3
|
+
* (Wave 3, founder decision D4).
|
|
4
|
+
*
|
|
5
|
+
* The platform does NOT hardcode whether an agent may merge its own pull
|
|
6
|
+
* request. Whether it may is a POLICY, resolvable at four scopes
|
|
7
|
+
* (tenant → organization → Work → Agent) and layered over a conservative
|
|
8
|
+
* platform DEFAULT. Operators keep the safe posture by doing nothing and can
|
|
9
|
+
* opt into "agents merge when green" — or anything in between — per scope.
|
|
10
|
+
*
|
|
11
|
+
* This package holds the zero-dependency storage/wire shapes only. The
|
|
12
|
+
* resolution algorithm, the deep merge and the single decision point
|
|
13
|
+
* (`canAgentMerge`) live in `@ever-works/agent` (`policy/`), and enforcement
|
|
14
|
+
* lives at the git facade + the Task finalize path.
|
|
15
|
+
*/
|
|
16
|
+
/** Merge strategy a provider can be asked to use when landing a pull request. */
|
|
17
|
+
type MergeMethod = 'merge' | 'squash' | 'rebase';
|
|
18
|
+
/**
|
|
19
|
+
* Canonical list of merge methods. Kept as a const so validators (DTO
|
|
20
|
+
* `@IsIn`, import sanitizers) share one source of truth with the type.
|
|
21
|
+
*/
|
|
22
|
+
declare const MERGE_METHODS: readonly MergeMethod[];
|
|
23
|
+
/**
|
|
24
|
+
* The fully-resolved policy. Every field is REQUIRED here — a resolved policy
|
|
25
|
+
* is always complete, because unset fields fall through to the next scope and
|
|
26
|
+
* ultimately to {@link PLATFORM_DEFAULT_MERGE_POLICY}.
|
|
27
|
+
*/
|
|
28
|
+
interface MergePolicy {
|
|
29
|
+
/**
|
|
30
|
+
* May an agent land a pull request at all? `false` does not stop the agent
|
|
31
|
+
* from OPENING one (that is `AgentPermissions.canOpenPullRequests`) — it
|
|
32
|
+
* stops the merge itself.
|
|
33
|
+
*/
|
|
34
|
+
allowAgentMerge: boolean;
|
|
35
|
+
/** Require the run's quality gate to be green before an agent may merge. */
|
|
36
|
+
requireGreenGate: boolean;
|
|
37
|
+
/** Require a recorded human approval before an agent may merge. */
|
|
38
|
+
requireHumanApproval: boolean;
|
|
39
|
+
/** Merge strategies an agent may use. An empty list refuses every merge. */
|
|
40
|
+
allowedMergeMethods: MergeMethod[];
|
|
41
|
+
/**
|
|
42
|
+
* Branch names an agent may never merge INTO, matched case-insensitively
|
|
43
|
+
* against the pull request's base branch (a leading `refs/heads/` is
|
|
44
|
+
* stripped before comparison).
|
|
45
|
+
*/
|
|
46
|
+
protectedBranches: string[];
|
|
47
|
+
}
|
|
48
|
+
/**
|
|
49
|
+
* The scopes a policy can be stored at, from least to most specific. The
|
|
50
|
+
* most specific scope that declares a field wins for THAT field
|
|
51
|
+
* (see {@link MERGE_POLICY_SCOPE_PRECEDENCE}).
|
|
52
|
+
*/
|
|
53
|
+
type MergePolicyScope = 'tenant' | 'organization' | 'work' | 'agent';
|
|
54
|
+
/**
|
|
55
|
+
* Documented precedence, least specific first:
|
|
56
|
+
*
|
|
57
|
+
* platform default < tenant < organization < Work < Agent
|
|
58
|
+
*
|
|
59
|
+
* Resolution is FIELD-BY-FIELD (a deep merge, not a whole-object override):
|
|
60
|
+
* a Work that sets only `allowAgentMerge` inherits the other four fields from
|
|
61
|
+
* its organization / tenant / the platform default. `null` or an omitted key
|
|
62
|
+
* at any scope means "inherit", never "false".
|
|
63
|
+
*/
|
|
64
|
+
declare const MERGE_POLICY_SCOPE_PRECEDENCE: readonly MergePolicyScope[];
|
|
65
|
+
/**
|
|
66
|
+
* What a scope actually stores: a PARTIAL policy. Absent/`null` fields
|
|
67
|
+
* inherit from the next-least-specific scope. This is the shape of the
|
|
68
|
+
* additive `mergePolicy` `simple-json` column on `tenants`, `organizations`,
|
|
69
|
+
* `works` and `agents`.
|
|
70
|
+
*/
|
|
71
|
+
type MergePolicyOverride = Partial<MergePolicy>;
|
|
72
|
+
/**
|
|
73
|
+
* Which scope a resolved policy (or one of its fields) came from. `'default'`
|
|
74
|
+
* means no scope in the chain declared it and the platform default applies.
|
|
75
|
+
*/
|
|
76
|
+
type MergePolicySource = MergePolicyScope | 'default';
|
|
77
|
+
/**
|
|
78
|
+
* The platform DEFAULT — deliberately conservative, and deliberately NOT a
|
|
79
|
+
* hardcode: every field is overridable at any of the four scopes. An operator
|
|
80
|
+
* who wants agents to land their own green work sets
|
|
81
|
+
* `{ allowAgentMerge: true, requireHumanApproval: false }` at the scope of
|
|
82
|
+
* their choosing.
|
|
83
|
+
*/
|
|
84
|
+
declare const PLATFORM_DEFAULT_MERGE_POLICY: MergePolicy;
|
|
85
|
+
/** Every field name of {@link MergePolicy}; the deep-merge iterates this. */
|
|
86
|
+
declare const MERGE_POLICY_FIELDS: readonly (keyof MergePolicy)[];
|
|
87
|
+
/** One link of the resolution chain, reported so a preview can explain itself. */
|
|
88
|
+
interface MergePolicyChainEntry {
|
|
89
|
+
/** The scope this link represents (`'default'` is always the first link). */
|
|
90
|
+
scope: MergePolicySource;
|
|
91
|
+
/** Row id of the scope entity; `null` for the platform default. */
|
|
92
|
+
id: string | null;
|
|
93
|
+
/**
|
|
94
|
+
* Fields this link CONTRIBUTED to the final policy — i.e. it declared them
|
|
95
|
+
* and no more specific link overrode them. An empty array means the link
|
|
96
|
+
* exists in the ancestry but was fully shadowed (or declared nothing).
|
|
97
|
+
*/
|
|
98
|
+
fields: (keyof MergePolicy)[];
|
|
99
|
+
}
|
|
100
|
+
/** Result of one policy resolution. */
|
|
101
|
+
interface ResolvedMergePolicy {
|
|
102
|
+
/** The complete, effective policy. */
|
|
103
|
+
policy: MergePolicy;
|
|
104
|
+
/**
|
|
105
|
+
* The MOST SPECIFIC scope that contributed at least one field, or
|
|
106
|
+
* `'default'` when nothing in the chain declared anything.
|
|
107
|
+
*/
|
|
108
|
+
source: MergePolicySource;
|
|
109
|
+
/** Least → most specific, starting at the platform default. */
|
|
110
|
+
chain: MergePolicyChainEntry[];
|
|
111
|
+
}
|
|
112
|
+
/**
|
|
113
|
+
* Stable refusal codes from the single decision point. Kept machine-readable
|
|
114
|
+
* so callers (facade, worker, UI) can branch without string-matching prose.
|
|
115
|
+
*/
|
|
116
|
+
type MergeRefusalCode = 'agent-merge-disabled' | 'protected-branch' | 'target-branch-unknown' | 'merge-method-not-allowed' | 'gate-not-green' | 'human-approval-required'
|
|
117
|
+
/** No recorded approval names this pull request at all. */
|
|
118
|
+
| 'approval-missing'
|
|
119
|
+
/** An approval exists for this pull request, but for an EARLIER head commit. */
|
|
120
|
+
| 'approval-stale'
|
|
121
|
+
/** A matching approval exists but is older than `MERGE_APPROVAL_MAX_AGE_MS`. */
|
|
122
|
+
| 'approval-expired'
|
|
123
|
+
/** The recorded decision was not made by a human (guardrail / no decider). */
|
|
124
|
+
| 'approval-not-human'
|
|
125
|
+
/** The approver is not entitled to approve for this Task's scope. */
|
|
126
|
+
| 'approver-not-entitled'
|
|
127
|
+
/** The pull request is draft/closed/merged at merge time. */
|
|
128
|
+
| 'pull-request-not-open'
|
|
129
|
+
/** Provider CI is not green at merge time (it may have been at approval time). */
|
|
130
|
+
| 'pull-request-not-green'
|
|
131
|
+
/** The live head commit could not be read, so nothing can be pinned to it. */
|
|
132
|
+
| 'head-sha-unknown';
|
|
133
|
+
/** Outcome of the single decision point (`canAgentMerge`). */
|
|
134
|
+
interface MergeDecision {
|
|
135
|
+
allowed: boolean;
|
|
136
|
+
/** Human-readable explanation; present only when `allowed === false`. */
|
|
137
|
+
reason?: string;
|
|
138
|
+
/** Machine-readable counterpart of `reason`. */
|
|
139
|
+
code?: MergeRefusalCode;
|
|
140
|
+
/** The policy the decision was made against, and where it came from. */
|
|
141
|
+
source?: MergePolicySource;
|
|
142
|
+
}
|
|
143
|
+
|
|
144
|
+
/**
|
|
145
|
+
* Connection credential transport (AW-15) — the organization setting and the
|
|
146
|
+
* pure verdict every create, update and connection attempt shares.
|
|
147
|
+
*
|
|
148
|
+
* ## What already worked, and what is new
|
|
149
|
+
*
|
|
150
|
+
* An MCP connection whose auth headers hold LITERAL values has always been
|
|
151
|
+
* able to use a plain `http://` endpoint. That keeps working: such a
|
|
152
|
+
* connection is allowed and flagged `insecure_transport` (a warning) so the
|
|
153
|
+
* owner sees the credential travels unencrypted.
|
|
154
|
+
*
|
|
155
|
+
* Resolving `{{cred.key}}` references inside headers is new, so nothing relies
|
|
156
|
+
* on sending a resolved secret over plain http. A reference aimed at a
|
|
157
|
+
* plain-http endpoint is refused (`https_required`) and the secret is never
|
|
158
|
+
* looked up.
|
|
159
|
+
*
|
|
160
|
+
* An organization can opt into refusing literal credentials over plain http
|
|
161
|
+
* too, with the setting below. It is OFF unless the organization turns it on.
|
|
162
|
+
*/
|
|
163
|
+
/** Stored on `organizations.connection_policy`. `null` / `{}` = every default. */
|
|
164
|
+
interface OrganizationConnectionPolicy {
|
|
165
|
+
/**
|
|
166
|
+
* "Require https for connection credentials". When `true`, a connection
|
|
167
|
+
* whose auth headers carry ANY value (literal or reference) must use an
|
|
168
|
+
* `https:` endpoint. Default `false`: literal credentials over plain http
|
|
169
|
+
* keep working, with a warning.
|
|
170
|
+
*/
|
|
171
|
+
requireHttpsForCredentials?: boolean;
|
|
172
|
+
}
|
|
173
|
+
/** The setting's key inside `OrganizationConnectionPolicy`. */
|
|
174
|
+
declare const REQUIRE_HTTPS_FOR_CREDENTIALS_SETTING: "requireHttpsForCredentials";
|
|
175
|
+
/** The setting's human name, used verbatim in every refusal it causes. */
|
|
176
|
+
declare const REQUIRE_HTTPS_FOR_CREDENTIALS_SETTING_LABEL = "Require https for connection credentials";
|
|
177
|
+
/**
|
|
178
|
+
* Shape guard for the stored / submitted policy. Unknown keys are dropped and
|
|
179
|
+
* only a real boolean is kept, so a junk value can never switch enforcement on
|
|
180
|
+
* or off by accident. An object with nothing left is `null` ("all defaults").
|
|
181
|
+
*/
|
|
182
|
+
declare function sanitizeOrganizationConnectionPolicy(raw: unknown): OrganizationConnectionPolicy | null;
|
|
183
|
+
/** Does this stored policy refuse literal credentials over plain http? Default: no. */
|
|
184
|
+
declare function organizationRequiresHttpsForCredentials(policy: unknown): boolean;
|
|
185
|
+
/**
|
|
186
|
+
* The verdict for one endpoint + header map.
|
|
187
|
+
*
|
|
188
|
+
* secure no credential leaves in cleartext (https, stdio, or no headers)
|
|
189
|
+
* insecure literal credentials over plain http — allowed, with a warning
|
|
190
|
+
* refused nothing may be sent; `reason` says why
|
|
191
|
+
*/
|
|
192
|
+
type CredentialTransportVerdict = {
|
|
193
|
+
verdict: 'secure';
|
|
194
|
+
} | {
|
|
195
|
+
verdict: 'insecure';
|
|
196
|
+
} | {
|
|
197
|
+
verdict: 'refused';
|
|
198
|
+
reason: CredentialTransportRefusalReason;
|
|
199
|
+
};
|
|
200
|
+
/**
|
|
201
|
+
* credential_references a `{{cred.key}}` reference aimed at plain http
|
|
202
|
+
* organization_policy literal credentials over plain http while the
|
|
203
|
+
* organization requires https
|
|
204
|
+
*/
|
|
205
|
+
type CredentialTransportRefusalReason = 'credential_references' | 'organization_policy';
|
|
206
|
+
interface CredentialTransportInput {
|
|
207
|
+
url: string | null | undefined;
|
|
208
|
+
transport?: string | null;
|
|
209
|
+
headers: Readonly<Record<string, string>> | null | undefined;
|
|
210
|
+
/** The organization setting. Omitted / `false` = literal credentials over http stay allowed. */
|
|
211
|
+
requireHttpsForCredentials?: boolean;
|
|
212
|
+
}
|
|
213
|
+
/**
|
|
214
|
+
* Decide how one connection may send its headers.
|
|
215
|
+
*
|
|
216
|
+
* `stdio` rows are exempt — they never dial a network address. A header map
|
|
217
|
+
* with no non-empty value carries no credential, so plain http without
|
|
218
|
+
* headers is `secure` in every case (it sends nothing to protect).
|
|
219
|
+
*/
|
|
220
|
+
declare function assessCredentialTransport(input: CredentialTransportInput): CredentialTransportVerdict;
|
|
221
|
+
|
|
222
|
+
/**
|
|
223
|
+
* Live Feed — wire types for the narrated view of the activity log.
|
|
224
|
+
*
|
|
225
|
+
* The Live Feed is a reading surface over the `activity_log` rows Ever Works
|
|
226
|
+
* already writes. It owns no store of its own: every entry below is one
|
|
227
|
+
* existing activity record, projected into a line a person can read without
|
|
228
|
+
* decoding an action token.
|
|
229
|
+
*
|
|
230
|
+
* The API returns STRUCTURE, never English. A narration is a message key plus
|
|
231
|
+
* sanitized parameters, and a destination is a typed pointer, so the web
|
|
232
|
+
* renders both through its own translations and route constants and any
|
|
233
|
+
* other client (CLI, MCP) can do the same.
|
|
234
|
+
*/
|
|
235
|
+
/** The five buckets every entry classifies into. Derived, never stored. */
|
|
236
|
+
type FeedKind = 'work' | 'decision' | 'delivery' | 'problem' | 'system';
|
|
237
|
+
/** Display order of the kind chips (keyboard `1`-`5` follows this order). */
|
|
238
|
+
declare const FEED_KINDS: readonly FeedKind[];
|
|
239
|
+
/**
|
|
240
|
+
* Who did the thing: an agent, the signed-in user, an external source
|
|
241
|
+
* (a connector, a repository, a deployed site), or the platform itself.
|
|
242
|
+
*/
|
|
243
|
+
type FeedActorKind = 'agent' | 'user' | 'external' | 'system';
|
|
244
|
+
declare const FEED_ACTOR_KINDS: readonly FeedActorKind[];
|
|
245
|
+
/** Default page size. */
|
|
246
|
+
declare const FEED_PAGE_SIZE_DEFAULT = 30;
|
|
247
|
+
/** A page never holds more than this many entries. */
|
|
248
|
+
declare const FEED_PAGE_SIZE_MAX = 50;
|
|
249
|
+
/** At most this many agents can be watched at once. */
|
|
250
|
+
declare const FEED_MAX_AGENT_FILTER = 20;
|
|
251
|
+
/** How far back the feed reads. Older records stay on the Activity log. */
|
|
252
|
+
declare const FEED_HISTORY_DAYS = 90;
|
|
253
|
+
/** Automatic paging stops after this many pages in one visit. */
|
|
254
|
+
declare const FEED_MAX_AUTO_PAGES = 20;
|
|
255
|
+
/** Every interpolated narration value is truncated to this many characters. */
|
|
256
|
+
declare const FEED_NARRATION_PARAM_MAX_CHARS = 120;
|
|
257
|
+
/** Default and maximum look-back window of the actor roster, in hours. */
|
|
258
|
+
declare const FEED_ACTORS_WINDOW_HOURS_DEFAULT = 168;
|
|
259
|
+
declare const FEED_ACTORS_WINDOW_HOURS_MAX = 720;
|
|
260
|
+
interface FeedActorDto {
|
|
261
|
+
kind: FeedActorKind;
|
|
262
|
+
/** Set when `kind === 'agent'`. */
|
|
263
|
+
agentId?: string | null;
|
|
264
|
+
/**
|
|
265
|
+
* Display name. For an agent, the name captured when the record was
|
|
266
|
+
* written, else the agent's current name. `null` when no name is known,
|
|
267
|
+
* in which case the renderer uses its own label for the kind.
|
|
268
|
+
*/
|
|
269
|
+
label: string | null;
|
|
270
|
+
/** An agent's avatar mode, when it still exists. */
|
|
271
|
+
avatarMode?: string | null;
|
|
272
|
+
}
|
|
273
|
+
interface FeedNarrationDto {
|
|
274
|
+
/** A leaf key under the renderer's narration namespace, or `fallback`. */
|
|
275
|
+
key: string;
|
|
276
|
+
/** Sanitized values. Only fields allowed for the action type ever appear. */
|
|
277
|
+
params: Record<string, string | number>;
|
|
278
|
+
}
|
|
279
|
+
/** What an entry can point at. */
|
|
280
|
+
type FeedTargetType = 'run' | 'task' | 'mission' | 'idea' | 'agent' | 'work' | 'inbox' | 'skill';
|
|
281
|
+
declare const FEED_TARGET_TYPES: readonly FeedTargetType[];
|
|
282
|
+
/**
|
|
283
|
+
* The most specific thing an entry is about. `null` on the entry when there
|
|
284
|
+
* is nothing to open (for example the agent was deleted), in which case the
|
|
285
|
+
* entry renders as plain text rather than a dead link.
|
|
286
|
+
*/
|
|
287
|
+
interface FeedTargetDto {
|
|
288
|
+
type: FeedTargetType;
|
|
289
|
+
id: string;
|
|
290
|
+
}
|
|
291
|
+
interface FeedEntryDto {
|
|
292
|
+
/** The activity record id. */
|
|
293
|
+
id: string;
|
|
294
|
+
/** ISO timestamp of when it happened. */
|
|
295
|
+
createdAt: string;
|
|
296
|
+
kind: FeedKind;
|
|
297
|
+
/** The record's own status (`pending`, `in_progress`, `completed`, `failed`, `cancelled`). */
|
|
298
|
+
status: string;
|
|
299
|
+
/** The record's action type, for clients that want to group or count. */
|
|
300
|
+
actionType: string;
|
|
301
|
+
actor: FeedActorDto;
|
|
302
|
+
narration: FeedNarrationDto;
|
|
303
|
+
target: FeedTargetDto | null;
|
|
304
|
+
workId?: string | null;
|
|
305
|
+
}
|
|
306
|
+
interface FeedPageDto {
|
|
307
|
+
/** Newest first. */
|
|
308
|
+
items: FeedEntryDto[];
|
|
309
|
+
/** Opaque cursor for the next older page, or `null` at the end. */
|
|
310
|
+
nextCursor: string | null;
|
|
311
|
+
hasMore: boolean;
|
|
312
|
+
/** Oldest point the feed reads back to (ISO). Paging stops here. */
|
|
313
|
+
historyFloor: string;
|
|
314
|
+
/** Populated once per-user seen state is available. */
|
|
315
|
+
unseenCount?: number;
|
|
316
|
+
lastSeenAt?: string | null;
|
|
317
|
+
}
|
|
318
|
+
interface FeedActorSummaryDto {
|
|
319
|
+
agentId: string;
|
|
320
|
+
label: string;
|
|
321
|
+
/** The agent's current status (`active`, `running`, `paused`, ...). */
|
|
322
|
+
status: string;
|
|
323
|
+
avatarMode?: string | null;
|
|
324
|
+
/** Entries attributed to the agent inside the requested window. */
|
|
325
|
+
count: number;
|
|
326
|
+
/** ISO timestamp of the agent's newest entry in the window, if any. */
|
|
327
|
+
lastActivityAt: string | null;
|
|
328
|
+
}
|
|
329
|
+
interface FeedActorsDto {
|
|
330
|
+
actors: FeedActorSummaryDto[];
|
|
331
|
+
windowHours: number;
|
|
332
|
+
}
|
|
333
|
+
/** Computed while-you-were-away payload. Never stored. */
|
|
334
|
+
interface FeedAwaySummaryDto {
|
|
335
|
+
awayForMs: number;
|
|
336
|
+
windowStart: string;
|
|
337
|
+
windowEnd: string;
|
|
338
|
+
truncatedToWindow: boolean;
|
|
339
|
+
truncatedToScanCap: boolean;
|
|
340
|
+
total: number;
|
|
341
|
+
byKind: Record<FeedKind, number>;
|
|
342
|
+
topActors: FeedActorSummaryDto[];
|
|
343
|
+
otherActorCount: number;
|
|
344
|
+
decisionsWaiting: number;
|
|
345
|
+
failures: number;
|
|
346
|
+
narrative?: {
|
|
347
|
+
text: string;
|
|
348
|
+
model: string;
|
|
349
|
+
tokens: number;
|
|
350
|
+
} | null;
|
|
351
|
+
}
|
|
352
|
+
/** Stable error codes the feed endpoints answer with. */
|
|
353
|
+
type FeedErrorCode = 'invalid-cursor' | 'too-many-agents';
|
|
354
|
+
|
|
355
|
+
export { MERGE_POLICY_SCOPE_PRECEDENCE as A, type MergeDecision as B, type CredentialTransportInput as C, type MergeMethod as D, type MergePolicy as E, type FeedNarrationDto as F, type MergePolicyChainEntry as G, type MergePolicyScope as H, type MergePolicySource as I, type MergeRefusalCode as J, REQUIRE_HTTPS_FOR_CREDENTIALS_SETTING_LABEL as K, type ResolvedMergePolicy as L, type MergePolicyOverride as M, assessCredentialTransport as N, type OrganizationConnectionPolicy as O, PLATFORM_DEFAULT_MERGE_POLICY as P, organizationRequiresHttpsForCredentials as Q, REQUIRE_HTTPS_FOR_CREDENTIALS_SETTING as R, sanitizeOrganizationConnectionPolicy as S, type FeedEntryDto as a, type CredentialTransportRefusalReason as b, type CredentialTransportVerdict as c, FEED_ACTORS_WINDOW_HOURS_DEFAULT as d, FEED_ACTORS_WINDOW_HOURS_MAX as e, FEED_ACTOR_KINDS as f, FEED_HISTORY_DAYS as g, FEED_KINDS as h, FEED_MAX_AGENT_FILTER as i, FEED_MAX_AUTO_PAGES as j, FEED_NARRATION_PARAM_MAX_CHARS as k, FEED_PAGE_SIZE_DEFAULT as l, FEED_PAGE_SIZE_MAX as m, FEED_TARGET_TYPES as n, type FeedActorDto as o, type FeedActorKind as p, type FeedActorSummaryDto as q, type FeedActorsDto as r, type FeedAwaySummaryDto as s, type FeedErrorCode as t, type FeedKind as u, type FeedPageDto as v, type FeedTargetDto as w, type FeedTargetType as x, MERGE_METHODS as y, MERGE_POLICY_FIELDS as z };
|
|
@@ -0,0 +1,104 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Form field types supported by the plugin system
|
|
3
|
+
*/
|
|
4
|
+
type FormFieldType = 'text' | 'textarea' | 'number' | 'boolean' | 'select' | 'multiselect' | 'date' | 'datetime' | 'url' | 'email' | 'password' | 'file' | 'image' | 'color' | 'json' | 'markdown' | 'code' | 'rich-text' | 'tags' | 'rating' | 'range' | 'hidden';
|
|
5
|
+
/**
|
|
6
|
+
* Option for select/multiselect fields
|
|
7
|
+
*/
|
|
8
|
+
interface FormFieldOption {
|
|
9
|
+
readonly label: string;
|
|
10
|
+
readonly value: string | number | boolean;
|
|
11
|
+
readonly description?: string;
|
|
12
|
+
readonly disabled?: boolean;
|
|
13
|
+
}
|
|
14
|
+
/**
|
|
15
|
+
* Validation rule for a form field
|
|
16
|
+
*/
|
|
17
|
+
interface FormFieldValidation {
|
|
18
|
+
/** Required field */
|
|
19
|
+
readonly required?: boolean;
|
|
20
|
+
/** Minimum value (number) or length (string) */
|
|
21
|
+
readonly min?: number;
|
|
22
|
+
/** Maximum value (number) or length (string) */
|
|
23
|
+
readonly max?: number;
|
|
24
|
+
/** Regular expression pattern for validation */
|
|
25
|
+
readonly pattern?: string;
|
|
26
|
+
/** Custom error message */
|
|
27
|
+
readonly message?: string;
|
|
28
|
+
}
|
|
29
|
+
/**
|
|
30
|
+
* Conditional visibility/requirement based on other field values
|
|
31
|
+
*/
|
|
32
|
+
interface FormFieldCondition {
|
|
33
|
+
/** Field name to check */
|
|
34
|
+
readonly field: string;
|
|
35
|
+
/** Operator for comparison */
|
|
36
|
+
readonly operator: 'eq' | 'neq' | 'gt' | 'gte' | 'lt' | 'lte' | 'contains' | 'not_contains';
|
|
37
|
+
/** Value to compare against */
|
|
38
|
+
readonly value: unknown;
|
|
39
|
+
}
|
|
40
|
+
/**
|
|
41
|
+
* Definition for a form field
|
|
42
|
+
*/
|
|
43
|
+
interface FormFieldDefinition {
|
|
44
|
+
/** Unique identifier for the field */
|
|
45
|
+
readonly name: string;
|
|
46
|
+
/** Field type */
|
|
47
|
+
readonly type: FormFieldType;
|
|
48
|
+
/** Display label */
|
|
49
|
+
readonly label: string;
|
|
50
|
+
/** Help text or description */
|
|
51
|
+
readonly description?: string;
|
|
52
|
+
/** Placeholder text */
|
|
53
|
+
readonly placeholder?: string;
|
|
54
|
+
/** Default value */
|
|
55
|
+
readonly defaultValue?: unknown;
|
|
56
|
+
/** Options for select/multiselect fields */
|
|
57
|
+
readonly options?: readonly FormFieldOption[];
|
|
58
|
+
/** Validation rules */
|
|
59
|
+
readonly validation?: FormFieldValidation;
|
|
60
|
+
/** Conditional visibility */
|
|
61
|
+
readonly showIf?: FormFieldCondition | readonly FormFieldCondition[];
|
|
62
|
+
/** Conditional requirement */
|
|
63
|
+
readonly requiredIf?: FormFieldCondition | readonly FormFieldCondition[];
|
|
64
|
+
/** Whether the field is disabled */
|
|
65
|
+
readonly disabled?: boolean;
|
|
66
|
+
/** Whether the field is read-only */
|
|
67
|
+
readonly readOnly?: boolean;
|
|
68
|
+
/** Group/section for organizing fields */
|
|
69
|
+
readonly group?: string;
|
|
70
|
+
/** Display order within group */
|
|
71
|
+
readonly order?: number;
|
|
72
|
+
/** Additional field-specific configuration */
|
|
73
|
+
readonly config?: Record<string, unknown>;
|
|
74
|
+
}
|
|
75
|
+
/**
|
|
76
|
+
* Group of related form fields
|
|
77
|
+
*/
|
|
78
|
+
interface FormFieldGroup {
|
|
79
|
+
/** Unique identifier for the group */
|
|
80
|
+
readonly name: string;
|
|
81
|
+
/** Display title */
|
|
82
|
+
readonly title: string;
|
|
83
|
+
/** Group description */
|
|
84
|
+
readonly description?: string;
|
|
85
|
+
/** Display order */
|
|
86
|
+
readonly order?: number;
|
|
87
|
+
/** Whether the group is collapsible */
|
|
88
|
+
readonly collapsible?: boolean;
|
|
89
|
+
/** Whether the group starts collapsed */
|
|
90
|
+
readonly collapsed?: boolean;
|
|
91
|
+
}
|
|
92
|
+
/**
|
|
93
|
+
* Complete form schema with fields and groups
|
|
94
|
+
*/
|
|
95
|
+
interface FormSchema {
|
|
96
|
+
/** Form fields */
|
|
97
|
+
readonly fields: readonly FormFieldDefinition[];
|
|
98
|
+
/** Field groups */
|
|
99
|
+
readonly groups?: readonly FormFieldGroup[];
|
|
100
|
+
/** Form-level validation */
|
|
101
|
+
readonly validation?: Record<string, unknown>;
|
|
102
|
+
}
|
|
103
|
+
|
|
104
|
+
export type { FormFieldCondition, FormFieldDefinition, FormFieldGroup, FormFieldOption, FormFieldType, FormFieldValidation, FormSchema };
|
|
@@ -0,0 +1,104 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Form field types supported by the plugin system
|
|
3
|
+
*/
|
|
4
|
+
type FormFieldType = 'text' | 'textarea' | 'number' | 'boolean' | 'select' | 'multiselect' | 'date' | 'datetime' | 'url' | 'email' | 'password' | 'file' | 'image' | 'color' | 'json' | 'markdown' | 'code' | 'rich-text' | 'tags' | 'rating' | 'range' | 'hidden';
|
|
5
|
+
/**
|
|
6
|
+
* Option for select/multiselect fields
|
|
7
|
+
*/
|
|
8
|
+
interface FormFieldOption {
|
|
9
|
+
readonly label: string;
|
|
10
|
+
readonly value: string | number | boolean;
|
|
11
|
+
readonly description?: string;
|
|
12
|
+
readonly disabled?: boolean;
|
|
13
|
+
}
|
|
14
|
+
/**
|
|
15
|
+
* Validation rule for a form field
|
|
16
|
+
*/
|
|
17
|
+
interface FormFieldValidation {
|
|
18
|
+
/** Required field */
|
|
19
|
+
readonly required?: boolean;
|
|
20
|
+
/** Minimum value (number) or length (string) */
|
|
21
|
+
readonly min?: number;
|
|
22
|
+
/** Maximum value (number) or length (string) */
|
|
23
|
+
readonly max?: number;
|
|
24
|
+
/** Regular expression pattern for validation */
|
|
25
|
+
readonly pattern?: string;
|
|
26
|
+
/** Custom error message */
|
|
27
|
+
readonly message?: string;
|
|
28
|
+
}
|
|
29
|
+
/**
|
|
30
|
+
* Conditional visibility/requirement based on other field values
|
|
31
|
+
*/
|
|
32
|
+
interface FormFieldCondition {
|
|
33
|
+
/** Field name to check */
|
|
34
|
+
readonly field: string;
|
|
35
|
+
/** Operator for comparison */
|
|
36
|
+
readonly operator: 'eq' | 'neq' | 'gt' | 'gte' | 'lt' | 'lte' | 'contains' | 'not_contains';
|
|
37
|
+
/** Value to compare against */
|
|
38
|
+
readonly value: unknown;
|
|
39
|
+
}
|
|
40
|
+
/**
|
|
41
|
+
* Definition for a form field
|
|
42
|
+
*/
|
|
43
|
+
interface FormFieldDefinition {
|
|
44
|
+
/** Unique identifier for the field */
|
|
45
|
+
readonly name: string;
|
|
46
|
+
/** Field type */
|
|
47
|
+
readonly type: FormFieldType;
|
|
48
|
+
/** Display label */
|
|
49
|
+
readonly label: string;
|
|
50
|
+
/** Help text or description */
|
|
51
|
+
readonly description?: string;
|
|
52
|
+
/** Placeholder text */
|
|
53
|
+
readonly placeholder?: string;
|
|
54
|
+
/** Default value */
|
|
55
|
+
readonly defaultValue?: unknown;
|
|
56
|
+
/** Options for select/multiselect fields */
|
|
57
|
+
readonly options?: readonly FormFieldOption[];
|
|
58
|
+
/** Validation rules */
|
|
59
|
+
readonly validation?: FormFieldValidation;
|
|
60
|
+
/** Conditional visibility */
|
|
61
|
+
readonly showIf?: FormFieldCondition | readonly FormFieldCondition[];
|
|
62
|
+
/** Conditional requirement */
|
|
63
|
+
readonly requiredIf?: FormFieldCondition | readonly FormFieldCondition[];
|
|
64
|
+
/** Whether the field is disabled */
|
|
65
|
+
readonly disabled?: boolean;
|
|
66
|
+
/** Whether the field is read-only */
|
|
67
|
+
readonly readOnly?: boolean;
|
|
68
|
+
/** Group/section for organizing fields */
|
|
69
|
+
readonly group?: string;
|
|
70
|
+
/** Display order within group */
|
|
71
|
+
readonly order?: number;
|
|
72
|
+
/** Additional field-specific configuration */
|
|
73
|
+
readonly config?: Record<string, unknown>;
|
|
74
|
+
}
|
|
75
|
+
/**
|
|
76
|
+
* Group of related form fields
|
|
77
|
+
*/
|
|
78
|
+
interface FormFieldGroup {
|
|
79
|
+
/** Unique identifier for the group */
|
|
80
|
+
readonly name: string;
|
|
81
|
+
/** Display title */
|
|
82
|
+
readonly title: string;
|
|
83
|
+
/** Group description */
|
|
84
|
+
readonly description?: string;
|
|
85
|
+
/** Display order */
|
|
86
|
+
readonly order?: number;
|
|
87
|
+
/** Whether the group is collapsible */
|
|
88
|
+
readonly collapsible?: boolean;
|
|
89
|
+
/** Whether the group starts collapsed */
|
|
90
|
+
readonly collapsed?: boolean;
|
|
91
|
+
}
|
|
92
|
+
/**
|
|
93
|
+
* Complete form schema with fields and groups
|
|
94
|
+
*/
|
|
95
|
+
interface FormSchema {
|
|
96
|
+
/** Form fields */
|
|
97
|
+
readonly fields: readonly FormFieldDefinition[];
|
|
98
|
+
/** Field groups */
|
|
99
|
+
readonly groups?: readonly FormFieldGroup[];
|
|
100
|
+
/** Form-level validation */
|
|
101
|
+
readonly validation?: Record<string, unknown>;
|
|
102
|
+
}
|
|
103
|
+
|
|
104
|
+
export type { FormFieldCondition, FormFieldDefinition, FormFieldGroup, FormFieldOption, FormFieldType, FormFieldValidation, FormSchema };
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
|