@nexus-aethra/dshell-std 0.1.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.
@@ -0,0 +1 @@
1
+ {"version":3,"file":"contracts.d.ts","sourceRoot":"","sources":["../../src/contracts.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;GAeG;AASH,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,iBAAiB,CAAA;AAEpD;;;;;;;;;;;;GAYG;AAEH,yDAAyD;AACzD,eAAO,MAAM,iBAAiB,sBAAsB,CAAA;AAEpD,iEAAiE;AACjE,MAAM,MAAM,cAAc,GAAG,MAAM,GAAG,WAAW,GAAG,OAAO,CAAA;AAE3D;;;;;;;;;;;GAWG;AACH,MAAM,MAAM,oBAAoB,GAAG,cAAc,GAAG,SAAS,GAAG,MAAM,GAAG,MAAM,CAAA;AAE/E;;;;;;GAMG;AACH,MAAM,MAAM,oBAAoB,GAAG,SAAS,GAAG,aAAa,GAAG,cAAc,GAAG,WAAW,CAAA;AAE3F,4DAA4D;AAC5D,MAAM,WAAW,eAAe;IAC9B,QAAQ,CAAC,IAAI,EAAE,MAAM,CAAA;IACrB,QAAQ,CAAC,IAAI,EAAE,cAAc,CAAA;IAC7B,kEAAkE;IAClE,QAAQ,CAAC,IAAI,CAAC,EAAE,MAAM,GAAG,SAAS,CAAA;CACnC;AAED,wDAAwD;AACxD,MAAM,WAAW,kBAAkB;IACjC,+EAA+E;IAC/E,QAAQ,CAAC,IAAI,EAAE,MAAM,CAAA;IACrB,QAAQ,CAAC,OAAO,EAAE,SAAS,eAAe,EAAE,CAAA;IAC5C,qEAAqE;IACrE,QAAQ,CAAC,SAAS,EAAE,OAAO,CAAA;IAC3B;;;;;;;OAOG;IACH,QAAQ,CAAC,KAAK,EAAE,OAAO,CAAA;CACxB;AAED,gCAAgC;AAChC,MAAM,WAAW,kBAAkB;IACjC;;;;;;;;;;;OAWG;IACH,QAAQ,CAAC,MAAM,EAA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iB;IAChC,QAAQ,CAAC,QAAQ,CAAC,EAAE,SAAS,gBAAgB,EAAE,GAAG,SAAS,CAAA;IAC3D,QAAQ,CAAC,KAAK,CAAC,EAAE,MAAM,GAAG,SAAS,CAAA;CACpC;AAID;;;;;;;;;;;GAWG;AACH,eAAO,MAAM,kBAAkB,uBAAuB,CAAA;AAEtD;;;;GAIG;AACH,eAAO,MAAM,uBAAuB,4BAA4B,CAAA"}
@@ -0,0 +1,60 @@
1
+ /**
2
+ * The host copy direction: the contract for text a HOST writes that the user
3
+ * reads.
4
+ *
5
+ * Browser faces learn their language from dsh's `ctx.locale`, which the host
6
+ * cannot see. Host-composed text — route refusals, device errors, the delegated
7
+ * request a peer's model reads, a command's result line — therefore needs its
8
+ * own statement of "which language", and it needs it from the browser that is
9
+ * actually on screen. Two signals stand in for it, in order: what the browser
10
+ * last reported to {@link DSHELL_LOCALE_PATH} (exact, and it covers a language
11
+ * the browser picked for itself when the user never chose one), then the durable
12
+ * `locale.preference` dsh's own Language row writes. With neither, the host
13
+ * writes the project's source-of-truth language, `zh`.
14
+ *
15
+ * The rules here follow this package's layering: declaration only — the shapes
16
+ * and the path — with no imports, no dsh packages and no runtime state. The
17
+ * service that RESOLVES the language is provided by `dshell-mode`
18
+ * (`ctx.dshellHostCopy`), so every package binds its own host dictionaries to it
19
+ * instead of re-implementing the lookup.
20
+ */
21
+ /** Where the browser reports the locale it actually resolved. */
22
+ export declare const DSHELL_LOCALE_PATH = "/api/dshell/locale";
23
+ /** The languages a host message can be written in, in report order. */
24
+ export declare const HOST_LOCALE_IDS: readonly ["zh", "en"];
25
+ /** One language a host message can be written in. */
26
+ export type HostLocaleId = typeof HOST_LOCALE_IDS[number];
27
+ /** Interpolation values for `{name}` placeholders in a host dictionary entry. */
28
+ export interface HostCopyParams {
29
+ readonly [name: string]: string | number;
30
+ }
31
+ /**
32
+ * One package's host-face dictionaries. `zh` is the key-set source of truth —
33
+ * the convention the browser faces already follow — and `en` must carry exactly
34
+ * the same keys, which `satisfies Record<Key, string>` enforces at compile time.
35
+ */
36
+ export interface HostCopyDictionaries<K extends string = string> {
37
+ readonly zh: Record<K, string>;
38
+ readonly en: Record<K, string>;
39
+ }
40
+ /** Body of a locale report: the id the browser resolved, as its own tag. */
41
+ export interface HostCopyReport {
42
+ readonly locale?: string | undefined;
43
+ }
44
+ /**
45
+ * What `ctx.dshellHostCopy` offers a package whose host half writes text the
46
+ * user reads. Both members resolve the language at CALL time, so a language
47
+ * switch reaches host-composed text as soon as the report lands — no restart,
48
+ * no cached dictionaries.
49
+ */
50
+ export interface HostCopy {
51
+ /** The language host-composed text should currently be written in. */
52
+ locale(): HostLocaleId;
53
+ /**
54
+ * Bind a package's host dictionaries to a translator.
55
+ * @param dicts - the package's `zh`/`en` pair.
56
+ * @returns a translator interpolating `{name}` placeholders from `params`.
57
+ */
58
+ bind<K extends string>(dicts: HostCopyDictionaries<K>): (key: K, params?: HostCopyParams) => string;
59
+ }
60
+ //# sourceMappingURL=host-copy.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"host-copy.d.ts","sourceRoot":"","sources":["../../src/host-copy.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;GAmBG;AAEH,iEAAiE;AACjE,eAAO,MAAM,kBAAkB,uBAAuB,CAAA;AAEtD,uEAAuE;AACvE,eAAO,MAAM,eAAe,uBAAwB,CAAA;AAEpD,qDAAqD;AACrD,MAAM,MAAM,YAAY,GAAG,OAAO,eAAe,CAAC,MAAM,CAAC,CAAA;AAEzD,iFAAiF;AACjF,MAAM,WAAW,cAAc;IAC7B,QAAQ,EAAE,IAAI,EAAE,MAAM,GAAG,MAAM,GAAG,MAAM,CAAA;CACzC;AAED;;;;GAIG;AACH,MAAM,WAAW,oBAAoB,CAAC,CAAC,SAAS,MAAM,GAAG,MAAM;IAC7D,QAAQ,CAAC,EAAE,EAAE,MAAM,CAAC,CAAC,EAAE,MAAM,CAAC,CAAA;IAC9B,QAAQ,CAAC,EAAE,EAAE,MAAM,CAAC,CAAC,EAAE,MAAM,CAAC,CAAA;CAC/B;AAED,4EAA4E;AAC5E,MAAM,WAAW,cAAc;IAC7B,QAAQ,CAAC,MAAM,CAAC,EAAE,MAAM,GAAG,SAAS,CAAA;CACrC;AAED;;;;;GAKG;AACH,MAAM,WAAW,QAAQ;IACvB,sEAAsE;IACtE,MAAM,IAAI,YAAY,CAAA;IACtB;;;;OAIG;IACH,IAAI,CAAC,CAAC,SAAS,MAAM,EAAE,KAAK,EAAE,oBAAoB,CAAC,CAAC,CAAC,GAAG,CAAC,GAAG,EAAE,CAAC,EAAE,MAAM,CAAC,EAAE,cAAc,KAAK,MAAM,CAAA;CACpG"}
@@ -0,0 +1,21 @@
1
+ /**
2
+ * dshell's standard layer.
3
+ *
4
+ * Everything here is shared machinery that must not belong to any one feature:
5
+ * the wire contracts ({@link ./contracts.ts}), the host copy direction
6
+ * ({@link ./host-copy.ts}) that a host half binds its own dictionaries to, the
7
+ * storage contract ({@link ./storage.ts}) that a feature calls without knowing
8
+ * its medium, and as the refactor continues, the dsh seam adapters (route
9
+ * definition, session/world addressing, capability probing) that today live
10
+ * duplicated inside feature packages.
11
+ *
12
+ * The rule that makes this layer worth having: it is the ONLY dshell package
13
+ * allowed to care about how dsh spells things. A feature package imports from
14
+ * here and keeps to its own product logic, so a dsh interface change is
15
+ * absorbed in one place instead of re-implemented per plugin.
16
+ */
17
+ export * from './contracts.js';
18
+ export * from './host-copy.js';
19
+ export * from './shell-line.js';
20
+ export * from './storage.js';
21
+ //# sourceMappingURL=index.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/index.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;GAeG;AAEH,cAAc,gBAAgB,CAAA;AAC9B,cAAc,gBAAgB,CAAA;AAC9B,cAAc,iBAAiB,CAAA;AAC/B,cAAc,cAAc,CAAA"}
@@ -0,0 +1,130 @@
1
+ /**
2
+ * The shell line, tokenized and classified — the rule table behind Tab.
3
+ *
4
+ * The composer's completion has to know WHICH position the caret is in before it
5
+ * can know what to offer, because a position is a property of the LINE, not of
6
+ * the word: `dock` is a command in `dock`, an argument in `cd dock`, and a file
7
+ * in `tee > dock`. bash's own grammar is what defines it (the start of a *simple
8
+ * command*), and that start is introduced by an operator, a keyword, or a prefix
9
+ * word — never by "it happens to be first".
10
+ *
11
+ * This module is that rule table, kept pure: no services, no filesystem, no
12
+ * process. Both halves of the feature depend on it — the host decides which
13
+ * source answers, the browser decides when an empty answer is worth showing —
14
+ * and `packages/dshell/std/tests/shell-line.spec.ts` drives it with real lines.
15
+ *
16
+ * Deliberately NOT a shell parser. bash's grammar is unbounded (`eval`, nested
17
+ * substitutions, heredocs, functions), so this walk answers the shapes it can
18
+ * PROVE and admits what it cannot: a blank line or an operator under the caret
19
+ * reports "nothing to complete" rather than guessing, and the caller decides
20
+ * what no-answer means. There is no "maybe" position — a caller cannot act on
21
+ * one, and a wrong KIND of candidate (`-launcher.sh` offered for `-la<Tab>`) is
22
+ * worse than silence.
23
+ */
24
+ /** What one token of the line is. */
25
+ export type ShellTokenKind =
26
+ /** A plain word, quotes and all (they are kept: the caller resolves them). */
27
+ 'word'
28
+ /** `VAR=value` — a shape, not a decision: it only assigns in a command position. */
29
+ | 'assign'
30
+ /** `;` `&` `&&` `||` `|` `|&` — the next word starts a new command. */
31
+ | 'separator'
32
+ /** `(` `{` `$(` `` ` `` — a nested command list begins. */
33
+ | 'open'
34
+ /** `)` `}` — a nested command list ends. */
35
+ | 'close'
36
+ /** `>` `>>` `<` `<<` `2>` … — may or may not want a target (see {@link ShellToken.target}). */
37
+ | 'redirection'
38
+ /** `if` `then` `do` `fi` … — keywords that open or close a command list. */
39
+ | 'reserved';
40
+ /** One token, with the offsets a completion has to report. */
41
+ export interface ShellToken {
42
+ readonly kind: ShellTokenKind;
43
+ /** The token exactly as written, quotes included. */
44
+ readonly text: string;
45
+ /** Offset of the first character in the line. */
46
+ readonly start: number;
47
+ /** Offset one past the last character. */
48
+ readonly end: number;
49
+ /** Whether any part of the token was quoted. */
50
+ readonly quoted: boolean;
51
+ /**
52
+ * For a redirection: whether it names a target (`> file` does, `2>&1` does
53
+ * not — that one names a file descriptor). Getting this wrong is what makes a
54
+ * completion offer a file where bash expects a digit.
55
+ */
56
+ readonly target: boolean;
57
+ }
58
+ /** Where the caret sits, in the line's grammar. */
59
+ export type ShellPosition =
60
+ /** The word names the command itself. */
61
+ 'command'
62
+ /** A word of a command already named (a path, usually). */
63
+ | 'argument'
64
+ /** A `-`/`--` word of a command already named. */
65
+ | 'flag'
66
+ /** The word is what a redirection writes to or reads from: a file. */
67
+ | 'redir';
68
+ /** The caret's token, its span, and what the line is doing there. */
69
+ export interface ShellCaret {
70
+ readonly position: ShellPosition;
71
+ /**
72
+ * The command the position belongs to: the last command word before the
73
+ * caret, skipping the prefix words (`sudo docker r` → `docker`). Undefined
74
+ * until the line has named one.
75
+ */
76
+ readonly command: string | undefined;
77
+ /** Offset the completion replaces from (the start of the name, after any slash). */
78
+ readonly start: number;
79
+ /** Offset the completion replaces to: the caret. */
80
+ readonly end: number;
81
+ /** The token's directory part, `''` when it has no slash. */
82
+ readonly dirPart: string;
83
+ /** The name being completed — what follows the last slash. */
84
+ readonly prefix: string;
85
+ /** Whether the caret sits after whitespace, where a new word begins. */
86
+ readonly empty: boolean;
87
+ }
88
+ /**
89
+ * Split one line into tokens, stopping at nothing: a completion also runs on a
90
+ * half-written line, so quotes may be open and the last word may be cut off.
91
+ *
92
+ * Quote handling is what a completion needs, not what a shell needs: whitespace
93
+ * inside quotes does not split, an unterminated quote keeps its token whole (the
94
+ * reader is still typing it), and the operators that are not separated by spaces
95
+ * (`a>b`, `x;y`) still split — which the word scanner does by asking
96
+ * {@link operatorAt} before consuming a character.
97
+ *
98
+ * @param line - the line as written.
99
+ * @returns the tokens in order, with their offsets.
100
+ */
101
+ export declare function tokenizeShellLine(line: string): ShellToken[];
102
+ /**
103
+ * Walk the tokens before the caret and report what the line expects there.
104
+ *
105
+ * `command` is the command the caret's word belongs to, so it is undefined
106
+ * wherever the line has not named one YET — which is why every operator, and
107
+ * every keyword sitting where a command would go, clears it again.
108
+ *
109
+ * @param tokens - the line's tokens, in order.
110
+ * @param index - the token under the caret, or the token count for a word that
111
+ * has not been typed yet (an empty token after whitespace).
112
+ * @returns the position, and the command it belongs to when there is one.
113
+ */
114
+ export declare function classifyShellPosition(tokens: readonly ShellToken[], index: number): {
115
+ readonly position: ShellPosition;
116
+ readonly command: string | undefined;
117
+ };
118
+ /**
119
+ * Everything the completion needs to know about one caret: where the word is,
120
+ * which part of it is the name, and what the line expects there.
121
+ *
122
+ * @param line - the line as written (the draft).
123
+ * @param cursor - the caret offset within it.
124
+ * @returns the caret reading, or undefined when there is nothing to complete —
125
+ * a blank line, or an operator under the caret, which names no word (a
126
+ * redirection WITH a target is the exception: `ls >` is a file slot with an
127
+ * empty word in it, and the reader reports it as such).
128
+ */
129
+ export declare function readShellCaret(line: string, cursor: number): ShellCaret | undefined;
130
+ //# sourceMappingURL=shell-line.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"shell-line.d.ts","sourceRoot":"","sources":["../../src/shell-line.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;GAsBG;AAEH,qCAAqC;AACrC,MAAM,MAAM,cAAc;AACxB,8EAA8E;AAC5E,MAAM;AACR,oFAAoF;GAClF,QAAQ;AACV,uEAAuE;GACrE,WAAW;AACb,2DAA2D;GACzD,MAAM;AACR,4CAA4C;GAC1C,OAAO;AACT,+FAA+F;GAC7F,aAAa;AACf,4EAA4E;GAC1E,UAAU,CAAA;AAEd,8DAA8D;AAC9D,MAAM,WAAW,UAAU;IACzB,QAAQ,CAAC,IAAI,EAAE,cAAc,CAAA;IAC7B,qDAAqD;IACrD,QAAQ,CAAC,IAAI,EAAE,MAAM,CAAA;IACrB,iDAAiD;IACjD,QAAQ,CAAC,KAAK,EAAE,MAAM,CAA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0,0 +1,147 @@
1
+ /**
2
+ * The storage contract: what a dshell store *is*, with no medium attached.
3
+ *
4
+ * dshell has one durable store for shell history today and a reason to expect
5
+ * more (agent-facing records that want indexes). The split that keeps that from
6
+ * becoming each feature's private file format:
7
+ *
8
+ * - **the contract** lives here — the record shape, the store surface, the
9
+ * on-disk naming and layout version, and the failure vocabulary;
10
+ * - **the medium** lives in `@nexus-aethra/dshell-storage` (`node:sqlite`);
11
+ * - **a feature** only calls the store, and never names a file, a pragma or a
12
+ * schema.
13
+ *
14
+ * Nothing here may import a Node builtin: `std` is inlined into client bundles,
15
+ * so this file has to stay an isomorphic declaration. The engine is host-only
16
+ * for exactly that reason — `node:sqlite` cannot cross into a browser bundle.
17
+ */
18
+ /** File name of the shared database inside a log directory. */
19
+ export declare const HISTORY_STORE_FILENAME = "history.sqlite";
20
+ /**
21
+ * Physical layout version of the history database, stamped in
22
+ * `PRAGMA user_version`.
23
+ *
24
+ * The engine migrates the layouts it knows: 1 dropped `commands_at(at)`, an
25
+ * index for a cross-session time query that was never built and that nothing
26
+ * read; 2 added `command_output`, the per-command output the agent-facing read
27
+ * tool addresses by offset. A database stamped with anything else is rejected:
28
+ * this code is the only producer, and history is a convenience the user may
29
+ * lose without losing a session.
30
+ */
31
+ export declare const HISTORY_STORE_SCHEMA_VERSION = 3;
32
+ /** Why a store could not be used; the caller decides whether to fall back. */
33
+ export type HistoryStoreErrorCode = 'open-failed' | 'version-mismatch';
34
+ /** A store that cannot be opened, or was written by another layout. */
35
+ export declare class HistoryStoreError extends Error {
36
+ readonly code: HistoryStoreErrorCode;
37
+ constructor(code: HistoryStoreErrorCode, message: string);
38
+ }
39
+ /**
40
+ * One completed command, as stored.
41
+ *
42
+ * The shape every producer already had; it is a contract now because both the
43
+ * writer (the terminal bridge) and the readers (the history route, and later an
44
+ * agent-facing query) have to agree on it without importing each other.
45
+ */
46
+ export interface HistoryRecord {
47
+ /** Monotonic within the shell generation that produced it. */
48
+ readonly seq: number;
49
+ /** The line as the user ran it; this is what a caller shows and re-applies. */
50
+ readonly command: string;
51
+ /** The shell's exit status, or null when it never reported one. */
52
+ readonly exitCode: number | null;
53
+ /** Epoch ms the command finished. */
54
+ readonly at: number;
55
+ }
56
+ /**
57
+ * One command's output, as stored.
58
+ *
59
+ * Output is kept as a single contiguous tail: a command that produced more than
60
+ * the medium retains keeps its *end* (where an error explains itself) and says
61
+ * how much is missing from the front. Offsets are therefore relative to
62
+ * {@link text}, and {@link dropped} is what a reader must be told before it
63
+ * trusts offset 0 to be the beginning of anything.
64
+ */
65
+ export interface HistoryOutput {
66
+ /** Retained output, truncated from the front — no marker text of its own. */
67
+ readonly text: string;
68
+ /** Total bytes the command produced, before any truncation. */
69
+ readonly bytes: number;
70
+ /** Bytes missing from the front of {@link text}. */
71
+ readonly dropped: number;
72
+ }
73
+ /** One command's output plus the seq it belongs to, as written. */
74
+ export interface HistoryOutputRecord extends HistoryOutput {
75
+ readonly seq: number;
76
+ }
77
+ /** A window onto one stored command output. */
78
+ export interface HistoryOutputSlice extends HistoryOutput {
79
+ /** Where {@link text} starts inside the retained output. */
80
+ readonly offset: number;
81
+ /** Bytes of retained output in total, so a caller can page to the end. */
82
+ readonly total: number;
83
+ /** The window ends before the retained output does. */
84
+ readonly truncated: boolean;
85
+ }
86
+ /**
87
+ * The durable history of every session under one store.
88
+ *
89
+ * Deliberately small and query-shaped rather than a generic KV: the two things
90
+ * the feature needs — the newest N of one session, and the commands sharing a
91
+ * prefix with what the user has typed — are exactly the two operations a medium
92
+ * can index for. A `loadAll`-style surface would put the whole history in memory
93
+ * on every read, which is the problem this store exists to remove.
94
+ *
95
+ * `sessionId` is the caller's own session identity; a store keys rows by it.
96
+ */
97
+ export interface HistoryStore {
98
+ /** Absolute path of the backing medium, for diagnostics. */
99
+ readonly path: string;
100
+ /**
101
+ * Insert a batch; an already-stored `(session, seq)` is left as it is.
102
+ *
103
+ * `outputs` are the matching outputs for the same batch, when the caller has
104
+ * them: a command's line and its output are written together so a reader can
105
+ * never see one landed and the other lost. The medium may retain fewer
106
+ * outputs than commands (see {@link readOutput}); an omitted output is simply
107
+ * one no reader can fetch.
108
+ */
109
+ append(sessionId: string, commands: readonly HistoryRecord[], outputs?: readonly HistoryOutputRecord[] | undefined): void;
110
+ /** The newest `limit` commands of one session, oldest first. */
111
+ recent(sessionId: string, limit: number): HistoryRecord[];
112
+ /**
113
+ * Commands that *start with* `draft`, case-insensitively — the newest `limit`
114
+ * of them, in timeline order.
115
+ *
116
+ * Timeline order (oldest first) is the same convention as {@link recent}, so a
117
+ * caller filters a history without reordering it: the shell's own gesture
118
+ * shows the newest command at the bottom and walks upward into the past.
119
+ *
120
+ * Strict prefix on purpose: every match shares the whole draft, so there is
121
+ * no "longer prefix" left to rank by — recency is the only meaningful order,
122
+ * and one range query answers it. An empty draft has no prefix at all, so it
123
+ * answers as {@link recent}.
124
+ *
125
+ * Fuzzy ranking (a draft of `g` listing `git …` above `grep …`) is a different
126
+ * query: the caller ranks a bounded candidate set by shared-prefix length.
127
+ */
128
+ matchPrefix(sessionId: string, draft: string, limit: number): HistoryRecord[];
129
+ /**
130
+ * One command's output, `limit` bytes from `offset` into the retained text.
131
+ *
132
+ * Answers `undefined` when the medium has no output for that `(session, seq)`
133
+ * — never written, already evicted, or written before the layout that added
134
+ * outputs. Callers report that as "not retained" rather than as empty output.
135
+ *
136
+ * `limit <= 0` answers nothing and a negative `offset` reads as 0, so a caller
137
+ * cannot page backwards out of the retained window.
138
+ */
139
+ readOutput(sessionId: string, seq: number, offset: number, limit: number): HistoryOutputSlice | undefined;
140
+ /** Drop one session's history — the session itself is gone. */
141
+ clearSession(sessionId: string): void;
142
+ /** How many commands one session has stored. */
143
+ count(sessionId: string): number;
144
+ /** Release the medium. Idempotent. */
145
+ close(): void;
146
+ }
147
+ //# sourceMappingURL=storage.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"storage.d.ts","sourceRoot":"","sources":["../../src/storage.ts"],"names":[],"mappings":"AAAA;;;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;;;;;;;;GAUG;AACH,MAAM,WAAW,YAAY;IAC3B,4DAA4D;IAC5D,QAAQ,CAAC,IAAI,EAAE,MAAM,CAAA;IACrB;;;;;;;;OAQG;IACH,MAAM,CACJ,SAAS,EAAE,MAAM,EACjB,QAAQ,EAAE,SAAS,aAAa,EAAE,EAClC,OAAO,CAAC,EAAE,SAAS,mBAAmB,EAAE,GAAG,SAAS,GACnD,IAAI,CAAA;IACP,gEAAgE;IAChE,MAAM,CAAC,SAAS,EAAE,MAAM,EAAE,KAAK,EAAE,MAAM,GAAG,aAAa,EAAE,CAAA;IACzD;;;;;;;;;;;;;;;OAeG;IACH,WAAW,CAAC,SAAS,EAAE,MAAM,EAAE,KAAK,EAAE,MAAM,EAAE,KAAK,EAAE,MAAM,GAAG,aAAa,EAAE,CAAA;IAC7E;;;;;;;;;OASG;IACH,UAAU,CAAC,SAAS,EAAE,MAAM,EAAE,GAAG,EAAE,MAAM,EAAE,MAAM,EAAE,MAAM,EAAE,KAAK,EAAE,MAAM,GAAG,kBAAkB,GAAG,SAAS,CAAA;IACzG,+DAA+D;IAC/D,YAAY,CAAC,SAAS,EAAE,MAAM,GAAG,IAAI,CAAA;IACrC,gDAAgD;IAChD,KAAK,CAAC,SAAS,EAAE,MAAM,GAAG,MAAM,CAAA;IAChC,sCAAsC;IACtC,KAAK,IAAI,IAAI,CAAA;CACd"}
package/package.json ADDED
@@ -0,0 +1,35 @@
1
+ {
2
+ "name": "@nexus-aethra/dshell-std",
3
+ "version": "0.1.0",
4
+ "description": "dshell standard layer: the wire contracts every plugin shares (paths + shapes), with no dependency on dsh and no feature code — the single place a dsh interface change is absorbed.",
5
+ "license": "MIT",
6
+ "repository": {
7
+ "type": "git",
8
+ "url": "git+https://github.com/Nexus-Aethra/Nexus-Terminal.git",
9
+ "directory": "packages/dshell/std"
10
+ },
11
+ "type": "module",
12
+ "main": "lib/index.js",
13
+ "types": "lib/types/index.d.ts",
14
+ "exports": {
15
+ ".": {
16
+ "types": "./lib/types/index.d.ts",
17
+ "default": "./lib/index.js"
18
+ }
19
+ },
20
+ "files": [
21
+ "lib"
22
+ ],
23
+ "publishConfig": {
24
+ "access": "public"
25
+ },
26
+ "dependencies": {},
27
+ "peerDependencies": {},
28
+ "devDependencies": {
29
+ "typescript": "^6.0.3"
30
+ },
31
+ "scripts": {
32
+ "build": "tsc -p tsconfig.json --emitDeclarationOnly false",
33
+ "build:host": "tsc -p tsconfig.json --emitDeclarationOnly false"
34
+ }
35
+ }