tapline-host 1.6.2 → 1.7.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/accounts.d.ts +129 -12
- package/dist/accounts.js +844 -75
- package/dist/accounts.js.map +1 -1
- package/dist/actionlog.d.ts +11 -4
- package/dist/actionlog.js +22 -1
- package/dist/actionlog.js.map +1 -1
- package/dist/animations.d.ts +4 -2
- package/dist/animations.js +7 -7
- package/dist/animations.js.map +1 -1
- package/dist/api.d.ts +7 -1
- package/dist/api.js +12 -1
- package/dist/api.js.map +1 -1
- package/dist/audit.d.ts +1 -0
- package/dist/auditlog.d.ts +40 -0
- package/dist/auditlog.js +150 -0
- package/dist/auditlog.js.map +1 -0
- package/dist/cli.d.ts +8 -0
- package/dist/cli.js +143 -7
- package/dist/cli.js.map +1 -1
- package/dist/control.d.ts +51 -0
- package/dist/control.js +110 -0
- package/dist/control.js.map +1 -1
- package/dist/doctor.d.ts +6 -0
- package/dist/doctor.js +61 -4
- package/dist/doctor.js.map +1 -1
- package/dist/drive.d.ts +5 -2
- package/dist/drive.js +50 -13
- package/dist/drive.js.map +1 -1
- package/dist/elicit.d.ts +47 -0
- package/dist/elicit.js +87 -0
- package/dist/elicit.js.map +1 -1
- package/dist/format.d.ts +6 -0
- package/dist/format.js +25 -4
- package/dist/format.js.map +1 -1
- package/dist/grants.d.ts +297 -0
- package/dist/grants.js +938 -0
- package/dist/grants.js.map +1 -0
- package/dist/grantscmd.d.ts +34 -0
- package/dist/grantscmd.js +100 -0
- package/dist/grantscmd.js.map +1 -0
- package/dist/hostfacts.d.ts +23 -0
- package/dist/hostfacts.js +65 -0
- package/dist/hostfacts.js.map +1 -0
- package/dist/inspect.d.ts +3 -2
- package/dist/inspect.js +20 -8
- package/dist/inspect.js.map +1 -1
- package/dist/mapcmd.d.ts +2 -2
- package/dist/mcp.js +1 -1
- package/dist/nochange.d.ts +1 -0
- package/dist/otpclient.d.ts +79 -0
- package/dist/otpclient.js +362 -0
- package/dist/otpclient.js.map +1 -0
- package/dist/pidlock.d.ts +99 -0
- package/dist/pidlock.js +382 -0
- package/dist/pidlock.js.map +1 -0
- package/dist/places.d.ts +11 -0
- package/dist/places.js +28 -2
- package/dist/places.js.map +1 -1
- package/dist/policy.d.ts +2 -1
- package/dist/policy.js +5 -2
- package/dist/policy.js.map +1 -1
- package/dist/protocol.d.ts +4 -0
- package/dist/protocol.js +2 -0
- package/dist/protocol.js.map +1 -1
- package/dist/report.d.ts +8 -0
- package/dist/report.js +34 -1
- package/dist/report.js.map +1 -1
- package/dist/routes.d.ts +1 -1
- package/dist/routes.js +27 -11
- package/dist/routes.js.map +1 -1
- package/dist/runschedule.d.ts +119 -0
- package/dist/runschedule.js +281 -0
- package/dist/runschedule.js.map +1 -0
- package/dist/runtime.d.ts +48 -1
- package/dist/runtime.js +214 -18
- package/dist/runtime.js.map +1 -1
- package/dist/schedule.d.ts +145 -0
- package/dist/schedule.js +401 -0
- package/dist/schedule.js.map +1 -0
- package/dist/schedulehost.d.ts +73 -0
- package/dist/schedulehost.js +391 -0
- package/dist/schedulehost.js.map +1 -0
- package/dist/script.d.ts +2 -0
- package/dist/script.js +2 -0
- package/dist/script.js.map +1 -1
- package/dist/server.d.ts +6 -0
- package/dist/server.js +3 -1
- package/dist/server.js.map +1 -1
- package/dist/thincall.d.ts +13 -0
- package/dist/thincall.js +139 -59
- package/dist/thincall.js.map +1 -1
- package/dist/tool-text-data.d.ts +1 -1
- package/dist/tool-text-data.js +1 -1
- package/dist/tool-text-data.js.map +1 -1
- package/dist/tool-text.d.ts +1 -1
- package/dist/tools.d.ts +116 -6
- package/dist/tools.js +758 -134
- package/dist/tools.js.map +1 -1
- package/dist/unlockcmd.d.ts +44 -0
- package/dist/unlockcmd.js +80 -0
- package/dist/unlockcmd.js.map +1 -0
- package/dist/uxcheck.d.ts +1 -0
- package/dist/vault.d.ts +75 -0
- package/dist/vault.js +395 -0
- package/dist/vault.js.map +1 -0
- package/package.json +1 -1
- package/skills/tapline/SKILL.md +34 -6
- package/skills/tapline/references/setup.md +11 -1
package/dist/grants.d.ts
ADDED
|
@@ -0,0 +1,297 @@
|
|
|
1
|
+
import type { AuditSink } from "./auditlog.js";
|
|
2
|
+
import { type PidLockDeps } from "./pidlock.js";
|
|
3
|
+
/**
|
|
4
|
+
* AGENT-TOOLS 1.14 §19: grants. A person's standing OK for a kind of touch, with limits, given ahead of time. A grant lives
|
|
5
|
+
* in the policy file (version 2), is counted as slot files under `<policy file>.uses/` (no lock, no state file), and every use is a
|
|
6
|
+
* line of the audit log (§23). Only a person makes a grant; nothing here creates, edits or lifts one.
|
|
7
|
+
*/
|
|
8
|
+
/** The most days away a grant's `until` may be, counted from the day the file is loaded (§19.1). */
|
|
9
|
+
export declare const GRANT_MAX_DAYS = 30;
|
|
10
|
+
export interface Grant {
|
|
11
|
+
name: string;
|
|
12
|
+
/** The app's id (or, when it has none, its name). */
|
|
13
|
+
app: string;
|
|
14
|
+
words: string[];
|
|
15
|
+
route?: string;
|
|
16
|
+
perDay: number;
|
|
17
|
+
perHour?: number;
|
|
18
|
+
/** A local date, `YYYY-MM-DD`: the grant covers touches up to the end of that day. */
|
|
19
|
+
until: string;
|
|
20
|
+
quiet?: {
|
|
21
|
+
from: string;
|
|
22
|
+
to: string;
|
|
23
|
+
};
|
|
24
|
+
/** The effective value (§19.1): absent in the file, it is true for a word that reaches other people. */
|
|
25
|
+
draftsOnly: boolean;
|
|
26
|
+
/** A local date: the day a person or `--revoke-all` revoked it. */
|
|
27
|
+
revoked?: string;
|
|
28
|
+
}
|
|
29
|
+
export interface GrantRefusal {
|
|
30
|
+
/** The grant's name, or `#3` (its place in the list) when it has none. */
|
|
31
|
+
name: string;
|
|
32
|
+
/** The reason, a sentence ending in a full stop. */
|
|
33
|
+
reason: string;
|
|
34
|
+
}
|
|
35
|
+
/** The note a refused grant gets (§19.1). */
|
|
36
|
+
export declare const refusalLine: (refusal: GrantRefusal) => string;
|
|
37
|
+
/** Words the tool treats as a payment or a purchase. */
|
|
38
|
+
export declare const PAYMENT_WORDS: string[];
|
|
39
|
+
/** Words that delete an account. (Privacy and security settings and Wallet are recognised by screen: Tapwright's to enforce.) */
|
|
40
|
+
export declare const ACCOUNT_WORDS: string[];
|
|
41
|
+
/** Words that reach other people: a grant that names one is draftsOnly unless a person lifted it (§19.1, §21.3). */
|
|
42
|
+
export declare const REACH_WORDS: string[];
|
|
43
|
+
/** Why a word can never be granted, or null. `block` is the policy's block list for the grant's app. */
|
|
44
|
+
export declare function neverReason(word: string, block: string[]): string | null;
|
|
45
|
+
/** The local calendar day, `YYYY-MM-DD`. */
|
|
46
|
+
export declare function localDate(d: Date): string;
|
|
47
|
+
/** ISO 8601 in local time with its offset, as a slot file keeps it (§19.4). */
|
|
48
|
+
export declare function localIso(d: Date): string;
|
|
49
|
+
/**
|
|
50
|
+
* Reads a policy file's `grants`. A grant that is invalid, longer than 30 days or never grantable is refused alone: the
|
|
51
|
+
* others load, and the reason is kept (§19.1). `today` is the local day the file is loaded; `block` is the policy's block list for an app.
|
|
52
|
+
*/
|
|
53
|
+
export declare function parseGrants(raw: unknown, today: string, block: (app: string) => string[]): {
|
|
54
|
+
grants: Grant[];
|
|
55
|
+
refused: GrantRefusal[];
|
|
56
|
+
};
|
|
57
|
+
/** What two grant names are compared by: equal ignoring ASCII case (names are limited to `[A-Za-z0-9._-]`). Names that agree here are one name. */
|
|
58
|
+
export declare function grantKey(name: string): string;
|
|
59
|
+
/**
|
|
60
|
+
* The folder a grant's uses live in: its name lower-cased (a safe name is ASCII only, so this is exactly its case-folded form). A
|
|
61
|
+
* name's case therefore never picks another folder, and `g` and `G` are one folder on every file system.
|
|
62
|
+
*/
|
|
63
|
+
export declare function usesFolder(name: string): string;
|
|
64
|
+
/** The policy file's edit lock (§19.5). */
|
|
65
|
+
export declare function policyEditLockPath(policyPath: string): string;
|
|
66
|
+
/** Whether a grant's name is safe as a folder name: letters, digits, `_`, `.` and `-`; never `.`, `..` or one that ends in a dot (Windows drops it). */
|
|
67
|
+
export declare function safeGrantName(name: string): boolean;
|
|
68
|
+
/** What a touch is, for a grant to match: the app, the element's own label and text, and the saved routes running now. */
|
|
69
|
+
export interface GrantTouch {
|
|
70
|
+
app: {
|
|
71
|
+
id?: string;
|
|
72
|
+
name: string;
|
|
73
|
+
};
|
|
74
|
+
element: {
|
|
75
|
+
label?: string | null;
|
|
76
|
+
text?: string | null;
|
|
77
|
+
};
|
|
78
|
+
routes: string[];
|
|
79
|
+
}
|
|
80
|
+
/** What `release` and `stillCovers` need to know of a use: who made it and which slot files (relative to the uses folder, `/`-separated) hold it. */
|
|
81
|
+
export interface GrantUseRef {
|
|
82
|
+
name: string;
|
|
83
|
+
owner: string;
|
|
84
|
+
slots: string[];
|
|
85
|
+
}
|
|
86
|
+
export type GrantDecision =
|
|
87
|
+
/** `owner` and `slots` name the recorded use, so `release` can take it back when the touch wasn't made (`peek` has none). */
|
|
88
|
+
{
|
|
89
|
+
kind: "covered";
|
|
90
|
+
name: string;
|
|
91
|
+
line: string; /** `2 of 3`, for a dry run's words. */
|
|
92
|
+
counts: string;
|
|
93
|
+
counted: boolean;
|
|
94
|
+
owner: string;
|
|
95
|
+
slots: string[];
|
|
96
|
+
}
|
|
97
|
+
/**
|
|
98
|
+
* A draftsOnly grant covers the touch (§19.3): the touch stops before it is made and shows a draft to a person (§21.3). Nothing is
|
|
99
|
+
* counted: a draft a person sends isn't a use of the grant, the person's OK let it through.
|
|
100
|
+
*/
|
|
101
|
+
| {
|
|
102
|
+
kind: "draft";
|
|
103
|
+
name: string;
|
|
104
|
+
}
|
|
105
|
+
/** The touch asks a person; `notes` say why a grant that matched didn't cover it (§19.3). */
|
|
106
|
+
| {
|
|
107
|
+
kind: "ask";
|
|
108
|
+
notes: string[]; /** Why each matching grant didn't cover it, in the report's words: `limit reached`, `quiet hours`, `ended`, `revoked`. */
|
|
109
|
+
asked: string[];
|
|
110
|
+
};
|
|
111
|
+
/** What a look at the policy file and the uses folder found, for `doctor` and the first answer (§19.1, §19.4). */
|
|
112
|
+
export interface GrantReport {
|
|
113
|
+
/** False when the policy file can't be read or parsed any more: no grant covers anything. */
|
|
114
|
+
fileOk: boolean;
|
|
115
|
+
grants: Grant[];
|
|
116
|
+
refused: GrantRefusal[];
|
|
117
|
+
/** The uses folder (or a grant's folder in it) can't be read: that grant counts as used up. */
|
|
118
|
+
usesBroken: boolean;
|
|
119
|
+
}
|
|
120
|
+
export interface GrantBookOptions {
|
|
121
|
+
policyPath: string;
|
|
122
|
+
/** The audit log. Without one no grant covers a touch: a grant needs its line (§23). */
|
|
123
|
+
audit: AuditSink | null;
|
|
124
|
+
/** The clock. A claim reads it again when it claims, so the day and the hour it counts against are the ones it claims in. */
|
|
125
|
+
now?: () => Date;
|
|
126
|
+
/** For tests: runs before each exclusive create of a slot file (a writer that pauses at any point). */
|
|
127
|
+
beforeCreate?: (path: string) => Promise<void>;
|
|
128
|
+
/** For tests: runs after a use's slot files exist and before the policy is read again and the audit line written. */
|
|
129
|
+
afterClaim?: () => Promise<void>;
|
|
130
|
+
/** For tests: runs in `stillCovers` after the use's slot files were read and before the clock is read for the final check. */
|
|
131
|
+
afterSlotReads?: () => Promise<void>;
|
|
132
|
+
/** For tests: runs inside the edit lock, after the policy was read and checked and before the new file is written. */
|
|
133
|
+
beforePolicyWrite?: () => Promise<void>;
|
|
134
|
+
/** The process facts the policy file's edit lock uses (pid, liveness, start time). Default: this process. */
|
|
135
|
+
editLock?: PidLockDeps;
|
|
136
|
+
/** How long a change waits for the edit lock before it gives up and changes nothing. Default 5000 ms. */
|
|
137
|
+
editLockWaitMs?: number;
|
|
138
|
+
/** How often a change that waits for the edit lock tries again. Default 25 ms. */
|
|
139
|
+
editLockPollMs?: number;
|
|
140
|
+
}
|
|
141
|
+
export declare class GrantBook {
|
|
142
|
+
private readonly options;
|
|
143
|
+
private readonly now;
|
|
144
|
+
private readonly usesRoot;
|
|
145
|
+
constructor(options: GrantBookOptions);
|
|
146
|
+
get policyPath(): string;
|
|
147
|
+
/** The policy file read again, on every call: a revocation by hand or by the other tool is seen at the next touch (§19.5). */
|
|
148
|
+
private readPolicy;
|
|
149
|
+
/** The uses of a grant in the day and the hour of `at`, by listing the folders; null when one can't be read (fails closed). */
|
|
150
|
+
private countsAt;
|
|
151
|
+
/** Every grant, what was refused, and whether a uses folder can't be read: for `doctor` and the session's first answer. */
|
|
152
|
+
inspect(): Promise<GrantReport>;
|
|
153
|
+
/** The date, `YYYY-MM-DD`, that is `days` from today (at most 30), for the dialog's question and a new grant's `until`. */
|
|
154
|
+
untilFor(days: number): string;
|
|
155
|
+
/** Every grant with today's and this hour's counts (null when its uses can't be read), for `tapline grants` (§19.7). */
|
|
156
|
+
listing(): Promise<{
|
|
157
|
+
report: GrantReport;
|
|
158
|
+
usage: Map<string, {
|
|
159
|
+
today: number;
|
|
160
|
+
hour: number;
|
|
161
|
+
} | null>;
|
|
162
|
+
}>;
|
|
163
|
+
/**
|
|
164
|
+
* Prune (at start, §19.4): the uses of a grant that has ended (today is after its `until`) or was revoked are deleted. Nothing else
|
|
165
|
+
* is ever counted from an earlier day or hour, so nothing else is needed. Returns the names it cleared.
|
|
166
|
+
*/
|
|
167
|
+
prune(): Promise<string[]>;
|
|
168
|
+
/** Deletes a grant's whole uses folder; false for a name that isn't safe as a folder name or when it can't be deleted. */
|
|
169
|
+
private removeUses;
|
|
170
|
+
/**
|
|
171
|
+
* `grants --revoke-all` (§19.5): marks every grant in the policy file `"revoked": "<today>"` and writes one `revoke` audit
|
|
172
|
+
* line each, and deletes the revoked grants' uses. A grant that is already revoked keeps its date. The file is changed with a
|
|
173
|
+
* temporary file and a rename, and every running tool sees it at its very next touch, because each touch reads the file again.
|
|
174
|
+
*/
|
|
175
|
+
revokeAll(detail?: string): Promise<{
|
|
176
|
+
revoked: string[];
|
|
177
|
+
already: string[];
|
|
178
|
+
} | {
|
|
179
|
+
error: string;
|
|
180
|
+
}>;
|
|
181
|
+
/**
|
|
182
|
+
* Writes a grant a person made through the dialog (§19.6) into the policy file: a temporary file and a rename, a name not used
|
|
183
|
+
* yet, `until` at most 30 days away, a version 1 file becoming version 2. The creation is logged (§23, `approval`). Only the
|
|
184
|
+
* host's dialog calls this, with what the person answered; nothing a model sends reaches it.
|
|
185
|
+
*/
|
|
186
|
+
create(spec: GrantSpec): Promise<{
|
|
187
|
+
grant: Grant;
|
|
188
|
+
} | {
|
|
189
|
+
error: string;
|
|
190
|
+
}>;
|
|
191
|
+
/**
|
|
192
|
+
* Every change to the policy file (create, renew, lifting draftsOnly, revoke-all) runs under `<policy file>.edit.lock`: the shared
|
|
193
|
+
* pid-liveness lock (pidlock.ts), which no one can displace while its holder lives. Under it the file is read again and the change is
|
|
194
|
+
* applied to that fresh content, never to an earlier copy; the result is written with a temporary file and a rename. A change that
|
|
195
|
+
* can't get the lock within `editLockWaitMs` fails closed: nothing is written. A string is why it couldn't.
|
|
196
|
+
*/
|
|
197
|
+
private editPolicy;
|
|
198
|
+
/** The change itself, run under the edit lock: reads the file as it is now, lets `change` edit it, writes it back when it says it did. */
|
|
199
|
+
private editPolicyLocked;
|
|
200
|
+
/** The `Note:` lines of an inspection: each refused grant, and a uses folder that can't be read. */
|
|
201
|
+
static noticeLines(report: GrantReport): string[];
|
|
202
|
+
/**
|
|
203
|
+
* Whether a grant covers this touch (§19.3). Called where the host has decided the touch needs a person: a covered touch goes
|
|
204
|
+
* through, and anything else asks as before, with the notes. `use` claims the use's slot files and writes the audit line;
|
|
205
|
+
* `peek` claims and writes nothing (a dry run, and the check before a dialog). `detail` is what the audit line says.
|
|
206
|
+
*/
|
|
207
|
+
decide(touch: GrantTouch, mode: "use" | "peek", detail: string): Promise<GrantDecision>;
|
|
208
|
+
/**
|
|
209
|
+
* Whether the grant a use was taken under still covers this touch, right now (§19.3): the policy file is read again, and the clock
|
|
210
|
+
* too, so a revocation, a `draftsOnly`, quiet hours, `until`, the word and the route condition are current. Takes no use and writes
|
|
211
|
+
* nothing; the use's slot files must all still be there and still be this use's. Any doubt (an unreadable file) answers false: the
|
|
212
|
+
* touch then asks a person.
|
|
213
|
+
*/
|
|
214
|
+
stillCovers(touch: GrantTouch, use: GrantUseRef): Promise<boolean>;
|
|
215
|
+
/**
|
|
216
|
+
* Whether a claim still fits the grant as the policy file has it now: its day slot number is within perDay, and, when the grant has a
|
|
217
|
+
* perHour, it holds an hour slot whose number is within perHour. A policy that was changed between the claim and the touch (a quota
|
|
218
|
+
* cut, a perHour added) makes an old claim fall outside the new limits; it is then given back and claimed again, or the touch asks.
|
|
219
|
+
*/
|
|
220
|
+
private fits;
|
|
221
|
+
/**
|
|
222
|
+
* Under the grant as it is now, the whole bucket (every entry of the day folder, and of the hour folder with a perHour; garbage counts
|
|
223
|
+
* as section 19.4 says) must hold at most the limit, this use's own slot included. "" means within the limits; otherwise the limit
|
|
224
|
+
* that is exceeded in words; null, a bucket that can't be read (any doubt asks a person).
|
|
225
|
+
*/
|
|
226
|
+
private overLimit;
|
|
227
|
+
/** Whether every slot of a use is in the day (or hour) folder of `at`: a use from an earlier day or hour is not counted against the current one. */
|
|
228
|
+
private inCurrentBuckets;
|
|
229
|
+
/** Whether this grant, as the policy file has it now, covers the touch at this time: app, word, route, revocation, end, quiet hours, drafts. */
|
|
230
|
+
private holds;
|
|
231
|
+
/** The absolute path of a slot a use names, or null when it isn't a slot of that grant (never a path outside the uses folder). */
|
|
232
|
+
private slotPath;
|
|
233
|
+
/** A use taken back: the touch wasn't made after all (§19.4: a use is counted when the touch is made). Deletes only this use's own slot files. */
|
|
234
|
+
release(use: GrantUseRef): Promise<void>;
|
|
235
|
+
/** Deletes the slot files of a use, each only after its content says this owner made it. A file that can't be read or deleted stays: the use stays counted. */
|
|
236
|
+
private dropSlots;
|
|
237
|
+
/** The limit that stops a use as words for the note, or null when there is room. */
|
|
238
|
+
private limit;
|
|
239
|
+
/** A string: the limit that stopped it. null: it can't be counted (an unreadable uses folder), nothing to say. */
|
|
240
|
+
private peek;
|
|
241
|
+
/**
|
|
242
|
+
* Claims a slot file in `dir` (k = 1..limit, exclusive create, the folder made as needed): the first k nobody has taken. A full
|
|
243
|
+
* folder answers how many entries it holds; a folder that can't be read or written answers null. Every entry counts, so a garbage
|
|
244
|
+
* file takes a place: a folder holding more entries than `limit` after the claim gives the claim back.
|
|
245
|
+
*/
|
|
246
|
+
private claimSlot;
|
|
247
|
+
/**
|
|
248
|
+
* Claims the slot files of one use in the buckets of a fresh clock: the hour slot first (when there is a perHour), then the day slot;
|
|
249
|
+
* a day claim that fails gives the hour slot back. The clock is read again after the claim: when the day (or the hour, with a perHour)
|
|
250
|
+
* moved on meanwhile, the slots just made are in an earlier bucket, so they are deleted and the claim is made again in the current
|
|
251
|
+
* one (a claimer that paused across midnight never counts against yesterday). A string is the limit that stopped it; null, that it
|
|
252
|
+
* can't be counted.
|
|
253
|
+
*/
|
|
254
|
+
private claimBuckets;
|
|
255
|
+
/**
|
|
256
|
+
* Claims a use (see claimBuckets), then the policy and the clock are read again (a revocation, an end or quiet hours that came
|
|
257
|
+
* meanwhile win) and the audit line is written; a grant needs its line, so a use whose line can't be written is given back (§23).
|
|
258
|
+
* A string is the limit that stopped it; null, that it can't be counted.
|
|
259
|
+
*/
|
|
260
|
+
private use;
|
|
261
|
+
/** A temporary file and a rename, with retries on Windows. */
|
|
262
|
+
private writeAtomic;
|
|
263
|
+
}
|
|
264
|
+
/** What the person said yes to in the dialog (§19.6). `days` counts from today, at most 30. */
|
|
265
|
+
export interface GrantSpec {
|
|
266
|
+
/** A name to start from; a number is added when it is taken. */
|
|
267
|
+
nameBase: string;
|
|
268
|
+
app: string;
|
|
269
|
+
words: string[];
|
|
270
|
+
route?: string;
|
|
271
|
+
perDay: number;
|
|
272
|
+
perHour?: number;
|
|
273
|
+
days: number;
|
|
274
|
+
quiet?: {
|
|
275
|
+
from: string;
|
|
276
|
+
to: string;
|
|
277
|
+
};
|
|
278
|
+
/** Only `false` is written (the person said Yes to sending without drafts); otherwise the file says nothing (§19.1). */
|
|
279
|
+
draftsOnly?: false;
|
|
280
|
+
}
|
|
281
|
+
/** Whether the element touched is a payment or an account deletion: no grant covers it, whatever its word (§19.2). */
|
|
282
|
+
export declare const elementNeverGrantable: (element: {
|
|
283
|
+
label?: string | null;
|
|
284
|
+
text?: string | null;
|
|
285
|
+
}) => boolean;
|
|
286
|
+
/** Whether a word reaches other people, so a grant for it shows drafts first unless a person lifts that (§19.1). */
|
|
287
|
+
export declare const reachesPeople: (word: string) => boolean;
|
|
288
|
+
/**
|
|
289
|
+
* The dialog's question, saying everything the grant allows (§19.6):
|
|
290
|
+
* `Allow tapping "Post" in Instagram up to 3 times a day, only in route post_update, until 21 Nov (drafts shown to you first)?`
|
|
291
|
+
* `app` is the app's name as the dialog may show it (already cut and cleaned); words are cleaned here.
|
|
292
|
+
*/
|
|
293
|
+
export declare function grantCaption(grant: Pick<Grant, "words" | "perDay" | "perHour" | "until" | "route" | "quiet" | "draftsOnly">, app: string): string;
|
|
294
|
+
/** A grant's name from the app's name and the word, as `instagram_post`: ASCII letters, digits and `_`. */
|
|
295
|
+
export declare function grantNameBase(app: string, word: string): string;
|
|
296
|
+
/** Whether a whole-word match for a word is a payment or an account deletion: never grantable, so never offered (§19.2). */
|
|
297
|
+
export declare const neverGrantable: (word: string, block: string[]) => boolean;
|