@sota-io/mcp 1.6.0 → 1.7.1
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/CLAUDE.md +19 -4
- package/README.md +15 -2
- package/dist/auth/token-bridge.d.ts +2 -2
- package/dist/auth/token-bridge.js +4 -4
- package/dist/auth/token-bridge.js.map +1 -1
- package/dist/auth/verify-jwt.d.ts.map +1 -1
- package/dist/auth/verify-jwt.js +4 -8
- package/dist/auth/verify-jwt.js.map +1 -1
- package/dist/http-app.d.ts +5 -11
- package/dist/http-app.d.ts.map +1 -1
- package/dist/http-app.js +27 -19
- package/dist/http-app.js.map +1 -1
- package/dist/index.js +9 -3
- package/dist/index.js.map +1 -1
- package/dist/lib/account.d.ts +63 -0
- package/dist/lib/account.d.ts.map +1 -0
- package/dist/lib/account.js +64 -0
- package/dist/lib/account.js.map +1 -0
- package/dist/lib/archive-builder.d.ts +15 -1
- package/dist/lib/archive-builder.d.ts.map +1 -1
- package/dist/lib/archive-builder.js +31 -8
- package/dist/lib/archive-builder.js.map +1 -1
- package/dist/lib/auth-config.d.ts +3 -3
- package/dist/lib/auth-config.d.ts.map +1 -1
- package/dist/lib/auth-config.js +3 -4
- package/dist/lib/auth-config.js.map +1 -1
- package/dist/lib/guide.d.ts +33 -0
- package/dist/lib/guide.d.ts.map +1 -0
- package/dist/lib/guide.js +82 -0
- package/dist/lib/guide.js.map +1 -0
- package/dist/lib/ignore.d.ts +16 -0
- package/dist/lib/ignore.d.ts.map +1 -0
- package/dist/lib/ignore.js +130 -0
- package/dist/lib/ignore.js.map +1 -0
- package/dist/lib/project-url.d.ts +14 -0
- package/dist/lib/project-url.d.ts.map +1 -0
- package/dist/lib/project-url.js +16 -0
- package/dist/lib/project-url.js.map +1 -0
- package/dist/lib/version.d.ts +1 -1
- package/dist/lib/version.js +1 -1
- package/dist/oauth-proxy.d.ts +1 -1
- package/dist/oauth-proxy.js +1 -1
- package/dist/tools/account.d.ts +10 -0
- package/dist/tools/account.d.ts.map +1 -0
- package/dist/tools/account.js +104 -0
- package/dist/tools/account.js.map +1 -0
- package/dist/tools/create-account.d.ts +1 -1
- package/dist/tools/deploy.d.ts +8 -0
- package/dist/tools/deploy.d.ts.map +1 -1
- package/dist/tools/deploy.js +56 -22
- package/dist/tools/deploy.js.map +1 -1
- package/dist/tools/env.js +1 -1
- package/dist/tools/env.js.map +1 -1
- package/dist/tools/logs.js +1 -1
- package/dist/tools/logs.js.map +1 -1
- package/dist/tools/projects.d.ts +8 -1
- package/dist/tools/projects.d.ts.map +1 -1
- package/dist/tools/projects.js +13 -5
- package/dist/tools/projects.js.map +1 -1
- package/dist/tools/status.d.ts.map +1 -1
- package/dist/tools/status.js +8 -3
- package/dist/tools/status.js.map +1 -1
- package/package.json +2 -1
|
@@ -21,6 +21,9 @@
|
|
|
21
21
|
* - .git, node_modules, .DS_Store and the local/secret env files (.env,
|
|
22
22
|
* .env.local, .env.*.local, .envrc; any depth, any case) are left out
|
|
23
23
|
* of every archive, whatever the mode.
|
|
24
|
+
* - directory deploys honour the root .sotaignore (or, without one, the
|
|
25
|
+
* .gitignore, keeping .env.production and .env.example); git_url
|
|
26
|
+
* deploys honour only a .sotaignore (lib/ignore.ts).
|
|
24
27
|
* - git and tar run via execFile (no shell).
|
|
25
28
|
* - Inline file paths are normalised + rejected if they contain ".." or
|
|
26
29
|
* start with "/" or contain NUL.
|
|
@@ -28,6 +31,7 @@
|
|
|
28
31
|
* - Git clone uses `--depth=1` and `--single-branch` to bound bandwidth.
|
|
29
32
|
* - Both modes write to a fresh /tmp dir which is removed after tar.gz is read.
|
|
30
33
|
*/
|
|
34
|
+
import { type IgnoreRules } from './ignore.js';
|
|
31
35
|
export declare function isExcludedName(name: string): boolean;
|
|
32
36
|
/** Upper bound on inline file count (per single `deploy` call). */
|
|
33
37
|
export declare const MAX_INLINE_FILES = 200;
|
|
@@ -64,15 +68,25 @@ export declare function archiveFromGitUrl(gitUrl: string, gitBranch?: string): B
|
|
|
64
68
|
* single code path for archive construction.
|
|
65
69
|
*/
|
|
66
70
|
export declare function archiveFromDirectory(dir: string): Buffer;
|
|
71
|
+
/** What a directory deploy packed (for the tool result). */
|
|
72
|
+
export interface DirectoryArchive {
|
|
73
|
+
archive: Buffer;
|
|
74
|
+
/** Number of regular files in the archive. */
|
|
75
|
+
files: number;
|
|
76
|
+
/** ".sotaignore", ".gitignore" or null when neither was found. */
|
|
77
|
+
ignoreFile: string | null;
|
|
78
|
+
}
|
|
79
|
+
export declare function archiveDirectoryWithReport(dir: string): DirectoryArchive;
|
|
67
80
|
/**
|
|
68
81
|
* Walk `root` and return the archive entries ("./rel/path", parents before
|
|
69
82
|
* children) plus the byte size of the regular files. Excluded names are
|
|
70
83
|
* skipped at every depth, and excluded directories are not descended into.
|
|
71
84
|
* Symlinks are archived as links and never followed.
|
|
72
85
|
*/
|
|
73
|
-
export declare function collectEntries(root: string): {
|
|
86
|
+
export declare function collectEntries(root: string, rules?: IgnoreRules): {
|
|
74
87
|
entries: string[];
|
|
75
88
|
totalBytes: number;
|
|
89
|
+
files: number;
|
|
76
90
|
};
|
|
77
91
|
/** True when tar refused to start because it does not know `--null`. */
|
|
78
92
|
export declare function isUnknownNullOption(err: unknown): boolean;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"archive-builder.d.ts","sourceRoot":"","sources":["../../src/lib/archive-builder.ts"],"names":[],"mappings":"AAAA
|
|
1
|
+
{"version":3,"file":"archive-builder.d.ts","sourceRoot":"","sources":["../../src/lib/archive-builder.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAgCG;AAcH,OAAO,EAAE,KAAK,WAAW,EAAwC,MAAM,aAAa,CAAC;AAerF,wBAAgB,cAAc,CAAC,IAAI,EAAE,MAAM,GAAG,OAAO,CAQpD;AAED,mEAAmE;AACnE,eAAO,MAAM,gBAAgB,MAAM,CAAC;AACpC,+DAA+D;AAC/D,eAAO,MAAM,sBAAsB,QAAmB,CAAC;AACvD,0KAA0K;AAC1K,eAAO,MAAM,eAAe,QAAoB,CAAC;AAIjD,qBAAa,mBAAoB,SAAQ,KAAK;IAC5C,QAAQ,CAAC,IAAI,EAAE,MAAM,CAAC;gBACV,IAAI,EAAE,MAAM,EAAE,OAAO,EAAE,MAAM;CAK1C;AAED;;;;;;;GAOG;AACH,wBAAgB,gBAAgB,CAAC,KAAK,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,GAAG,MAAM,CAsCtE;AAED;;;;;;;GAOG;AACH,wBAAgB,iBAAiB,CAAC,MAAM,EAAE,MAAM,EAAE,SAAS,CAAC,EAAE,MAAM,GAAG,MAAM,CAyD5E;AAED;;;;;GAKG;AACH,wBAAgB,oBAAoB,CAAC,GAAG,EAAE,MAAM,GAAG,MAAM,CAExD;AAED,4DAA4D;AAC5D,MAAM,WAAW,gBAAgB;IAC/B,OAAO,EAAE,MAAM,CAAC;IAChB,8CAA8C;IAC9C,KAAK,EAAE,MAAM,CAAC;IACd,kEAAkE;IAClE,UAAU,EAAE,MAAM,GAAG,IAAI,CAAC;CAC3B;AAED,wBAAgB,0BAA0B,CAAC,GAAG,EAAE,MAAM,GAAG,gBAAgB,CAcxE;AAED;;;;;GAKG;AACH,wBAAgB,cAAc,CAC5B,IAAI,EAAE,MAAM,EACZ,KAAK,GAAE,WAAsB,GAC5B;IAAE,OAAO,EAAE,MAAM,EAAE,CAAC;IAAC,UAAU,EAAE,MAAM,CAAC;IAAC,KAAK,EAAE,MAAM,CAAA;CAAE,CAwB1D;AAoDD,wEAAwE;AACxE,wBAAgB,mBAAmB,CAAC,GAAG,EAAE,OAAO,GAAG,OAAO,CAGzD"}
|
|
@@ -21,6 +21,9 @@
|
|
|
21
21
|
* - .git, node_modules, .DS_Store and the local/secret env files (.env,
|
|
22
22
|
* .env.local, .env.*.local, .envrc; any depth, any case) are left out
|
|
23
23
|
* of every archive, whatever the mode.
|
|
24
|
+
* - directory deploys honour the root .sotaignore (or, without one, the
|
|
25
|
+
* .gitignore, keeping .env.production and .env.example); git_url
|
|
26
|
+
* deploys honour only a .sotaignore (lib/ignore.ts).
|
|
24
27
|
* - git and tar run via execFile (no shell).
|
|
25
28
|
* - Inline file paths are normalised + rejected if they contain ".." or
|
|
26
29
|
* start with "/" or contain NUL.
|
|
@@ -31,6 +34,7 @@
|
|
|
31
34
|
import { execFileSync } from 'child_process';
|
|
32
35
|
import { lstatSync, mkdtempSync, mkdirSync, readdirSync, writeFileSync, readFileSync, rmSync, statSync, } from 'fs';
|
|
33
36
|
import { tmpdir } from 'os';
|
|
37
|
+
import { NO_RULES, ignoredBy, loadIgnoreRules } from './ignore.js';
|
|
34
38
|
import { dirname, join, resolve, sep } from 'path';
|
|
35
39
|
/**
|
|
36
40
|
* Names excluded from every archive, at any directory depth, in any case:
|
|
@@ -41,8 +45,15 @@ import { dirname, join, resolve, sep } from 'path';
|
|
|
41
45
|
* for build-time values like NEXT_PUBLIC_*.
|
|
42
46
|
*/
|
|
43
47
|
const LOCAL_ENV_FILE = /^\.env(?:(?:\.[^/]+)?\.local|rc)?$/i;
|
|
48
|
+
const ALWAYS_EXCLUDED = new Set(['.git', 'node_modules', '.DS_Store', '.sota.json', '__pycache__', '.venv']);
|
|
44
49
|
export function isExcludedName(name) {
|
|
45
|
-
|
|
50
|
+
// Same always-excluded names as the CLI (cli/internal/archive defaultIgnores)
|
|
51
|
+
// where that is safe; the CLI's vendor/ and .env.* are deliberately not
|
|
52
|
+
// copied: vendored dependencies are needed for the build, and committed
|
|
53
|
+
// .env.production / .env.example carry public build-time values.
|
|
54
|
+
if (ALWAYS_EXCLUDED.has(name))
|
|
55
|
+
return true;
|
|
56
|
+
if (name.toLowerCase().endsWith('.log'))
|
|
46
57
|
return true;
|
|
47
58
|
return LOCAL_ENV_FILE.test(name);
|
|
48
59
|
}
|
|
@@ -142,11 +153,14 @@ export function archiveFromGitUrl(gitUrl, gitBranch) {
|
|
|
142
153
|
throw new ArchiveBuilderError('git_clone_failed', `git clone failed (URL=${url.slice(0, 120)}${branch ? `, branch=${branch}` : ''}): ${detail.slice(0, 300)}`);
|
|
143
154
|
}
|
|
144
155
|
// Hard size cap: refuse repos that ballooned past MAX_CLONE_BYTES.
|
|
145
|
-
|
|
156
|
+
// A clone holds only tracked files: .gitignore must not drop tracked
|
|
157
|
+
// ones (e.g. committed build output), so only a .sotaignore applies.
|
|
158
|
+
const rules = loadIgnoreRules(workdir, { gitignoreFallback: false });
|
|
159
|
+
const sizeBytes = collectEntries(workdir, rules).totalBytes;
|
|
146
160
|
if (sizeBytes > MAX_CLONE_BYTES) {
|
|
147
161
|
throw new ArchiveBuilderError('clone_too_large', `cloned repo is ${(sizeBytes / 1024 / 1024).toFixed(1)} MB (max ${(MAX_CLONE_BYTES / 1024 / 1024).toFixed(0)} MB)`);
|
|
148
162
|
}
|
|
149
|
-
return tarGzWorkdir(workdir);
|
|
163
|
+
return tarGzWorkdir(workdir, rules);
|
|
150
164
|
}
|
|
151
165
|
finally {
|
|
152
166
|
rmSync(workdir, { recursive: true, force: true });
|
|
@@ -159,6 +173,9 @@ export function archiveFromGitUrl(gitUrl, gitBranch) {
|
|
|
159
173
|
* single code path for archive construction.
|
|
160
174
|
*/
|
|
161
175
|
export function archiveFromDirectory(dir) {
|
|
176
|
+
return archiveDirectoryWithReport(dir).archive;
|
|
177
|
+
}
|
|
178
|
+
export function archiveDirectoryWithReport(dir) {
|
|
162
179
|
const abs = resolve(dir);
|
|
163
180
|
let isDir = false;
|
|
164
181
|
try {
|
|
@@ -170,7 +187,9 @@ export function archiveFromDirectory(dir) {
|
|
|
170
187
|
if (!isDir) {
|
|
171
188
|
throw new ArchiveBuilderError('not_a_directory', `Not a directory: ${abs}`);
|
|
172
189
|
}
|
|
173
|
-
|
|
190
|
+
const rules = loadIgnoreRules(abs, { gitignoreFallback: true });
|
|
191
|
+
const { files } = collectEntries(abs, rules);
|
|
192
|
+
return { archive: tarGzWorkdir(abs, rules), files, ignoreFile: rules.source };
|
|
174
193
|
}
|
|
175
194
|
/**
|
|
176
195
|
* Walk `root` and return the archive entries ("./rel/path", parents before
|
|
@@ -178,9 +197,10 @@ export function archiveFromDirectory(dir) {
|
|
|
178
197
|
* skipped at every depth, and excluded directories are not descended into.
|
|
179
198
|
* Symlinks are archived as links and never followed.
|
|
180
199
|
*/
|
|
181
|
-
export function collectEntries(root) {
|
|
200
|
+
export function collectEntries(root, rules = NO_RULES) {
|
|
182
201
|
const entries = [];
|
|
183
202
|
let totalBytes = 0;
|
|
203
|
+
let files = 0;
|
|
184
204
|
const walk = (absDir, relDir) => {
|
|
185
205
|
const dirents = readdirSync(absDir, { withFileTypes: true }).sort((a, b) => a.name < b.name ? -1 : a.name > b.name ? 1 : 0);
|
|
186
206
|
for (const d of dirents) {
|
|
@@ -188,20 +208,23 @@ export function collectEntries(root) {
|
|
|
188
208
|
continue;
|
|
189
209
|
const abs = join(absDir, d.name);
|
|
190
210
|
const rel = `${relDir}/${d.name}`;
|
|
211
|
+
if (ignoredBy(rules, rel.slice(2), d.isDirectory()))
|
|
212
|
+
continue;
|
|
191
213
|
entries.push(rel);
|
|
192
214
|
if (d.isDirectory()) {
|
|
193
215
|
walk(abs, rel);
|
|
194
216
|
}
|
|
195
217
|
else if (d.isFile()) {
|
|
196
218
|
totalBytes += lstatSync(abs).size;
|
|
219
|
+
files++;
|
|
197
220
|
}
|
|
198
221
|
}
|
|
199
222
|
};
|
|
200
223
|
walk(root, '.');
|
|
201
|
-
return { entries, totalBytes };
|
|
224
|
+
return { entries, totalBytes, files };
|
|
202
225
|
}
|
|
203
|
-
function tarGzWorkdir(workdir) {
|
|
204
|
-
const { entries } = collectEntries(workdir);
|
|
226
|
+
function tarGzWorkdir(workdir, rules = NO_RULES) {
|
|
227
|
+
const { entries } = collectEntries(workdir, rules);
|
|
205
228
|
// The explicit NUL-separated file list (instead of tar --exclude patterns)
|
|
206
229
|
// makes the exclusions identical on GNU tar and bsdtar (macOS, Windows)
|
|
207
230
|
// and case-insensitive for the .env names.
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"archive-builder.js","sourceRoot":"","sources":["../../src/lib/archive-builder.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA6BG;AAEH,OAAO,EAAE,YAAY,EAAE,MAAM,eAAe,CAAC;AAC7C,OAAO,EACL,SAAS,EACT,WAAW,EACX,SAAS,EACT,WAAW,EACX,aAAa,EACb,YAAY,EACZ,MAAM,EACN,QAAQ,GACT,MAAM,IAAI,CAAC;AACZ,OAAO,EAAE,MAAM,EAAE,MAAM,IAAI,CAAC;AAC5B,OAAO,EAAE,OAAO,EAAE,IAAI,EAAE,OAAO,EAAE,GAAG,EAAE,MAAM,MAAM,CAAC;AAEnD;;;;;;;GAOG;AACH,MAAM,cAAc,GAAG,qCAAqC,CAAC;AAE7D,MAAM,UAAU,cAAc,CAAC,IAAY;IACzC,IAAI,IAAI,KAAK,MAAM,IAAI,IAAI,KAAK,cAAc,IAAI,IAAI,KAAK,WAAW;QAAE,OAAO,IAAI,CAAC;IACpF,OAAO,cAAc,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC;AACnC,CAAC;AAED,mEAAmE;AACnE,MAAM,CAAC,MAAM,gBAAgB,GAAG,GAAG,CAAC;AACpC,+DAA+D;AAC/D,MAAM,CAAC,MAAM,sBAAsB,GAAG,EAAE,GAAG,IAAI,GAAG,IAAI,CAAC,CAAC,QAAQ;AAChE,0KAA0K;AAC1K,MAAM,CAAC,MAAM,eAAe,GAAG,GAAG,GAAG,IAAI,GAAG,IAAI,CAAC,CAAC,SAAS;AAC3D,6EAA6E;AAC7E,MAAM,cAAc,GAAG,EAAE,CAAC;AAE1B,MAAM,OAAO,mBAAoB,SAAQ,KAAK;IACnC,IAAI,CAAS;IACtB,YAAY,IAAY,EAAE,OAAe;QACvC,KAAK,CAAC,OAAO,CAAC,CAAC;QACf,IAAI,CAAC,IAAI,GAAG,IAAI,CAAC;QACjB,I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,QAAQ,CAAC,GAAG,CAAC;QAAE,OAAO,IAAI,CAAC;IACzD,OAAO,KAAK,CAAC;AACf,CAAC"}
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
/**
|
|
2
|
-
* auth-config.ts — env-driven auth settings of the hosted MCP server
|
|
2
|
+
* auth-config.ts — env-driven auth settings of the hosted MCP server.
|
|
3
3
|
*
|
|
4
|
-
* Two values used to be hard-coded for prod
|
|
4
|
+
* Two values used to be hard-coded for prod:
|
|
5
5
|
* - the OAuth proxy upstream (oauth-proxy.ts)
|
|
6
6
|
* - the accepted JWT issuers (auth/verify-jwt.ts)
|
|
7
7
|
*
|
|
@@ -11,7 +11,7 @@
|
|
|
11
11
|
* Unset/blank → https://auth.sota.io/auth/v1 (prod).
|
|
12
12
|
* SUPABASE_JWT_ISSUERS comma-separated accepted iss values, exact match.
|
|
13
13
|
* Same name and rules as the Go API (config.go
|
|
14
|
-
* JWTIssuers). Unset/blank →
|
|
14
|
+
* JWTIssuers). Unset/blank → the prod issuer.
|
|
15
15
|
*
|
|
16
16
|
* The upstream is always accepted as an issuer as well: GoTrue writes its own
|
|
17
17
|
* public URL into iss, so a dev or self-hosted setup only has to set
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"auth-config.d.ts","sourceRoot":"","sources":["../../src/lib/auth-config.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;GAqBG;AAEH,eAAO,MAAM,qBAAqB,iCAAiC,CAAC;AAEpE,eAAO,MAAM,wBAAwB,EAAE,SAAS,MAAM,
|
|
1
|
+
{"version":3,"file":"auth-config.d.ts","sourceRoot":"","sources":["../../src/lib/auth-config.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;GAqBG;AAEH,eAAO,MAAM,qBAAqB,iCAAiC,CAAC;AAEpE,eAAO,MAAM,wBAAwB,EAAE,SAAS,MAAM,EAErD,CAAC;AAMF;;;GAGG;AACH,wBAAgB,mBAAmB,CAAC,GAAG,GAAE,MAAM,CAAC,UAAwB,GAAG,MAAM,CAsBhF;AAED;;;;;GAKG;AACH,wBAAgB,sBAAsB,CACpC,GAAG,GAAE,MAAM,CAAC,UAAwB,EACpC,QAAQ,GAAE,MAAiC,GAC1C,MAAM,EAAE,CA+BV"}
|
package/dist/lib/auth-config.js
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
/**
|
|
2
|
-
* auth-config.ts — env-driven auth settings of the hosted MCP server
|
|
2
|
+
* auth-config.ts — env-driven auth settings of the hosted MCP server.
|
|
3
3
|
*
|
|
4
|
-
* Two values used to be hard-coded for prod
|
|
4
|
+
* Two values used to be hard-coded for prod:
|
|
5
5
|
* - the OAuth proxy upstream (oauth-proxy.ts)
|
|
6
6
|
* - the accepted JWT issuers (auth/verify-jwt.ts)
|
|
7
7
|
*
|
|
@@ -11,7 +11,7 @@
|
|
|
11
11
|
* Unset/blank → https://auth.sota.io/auth/v1 (prod).
|
|
12
12
|
* SUPABASE_JWT_ISSUERS comma-separated accepted iss values, exact match.
|
|
13
13
|
* Same name and rules as the Go API (config.go
|
|
14
|
-
* JWTIssuers). Unset/blank →
|
|
14
|
+
* JWTIssuers). Unset/blank → the prod issuer.
|
|
15
15
|
*
|
|
16
16
|
* The upstream is always accepted as an issuer as well: GoTrue writes its own
|
|
17
17
|
* public URL into iss, so a dev or self-hosted setup only has to set
|
|
@@ -22,7 +22,6 @@
|
|
|
22
22
|
*/
|
|
23
23
|
export const DEFAULT_AUTH_UPSTREAM = 'https://auth.sota.io/auth/v1';
|
|
24
24
|
export const DEFAULT_ACCEPTED_ISSUERS = [
|
|
25
|
-
'https://wnwsdtqhywfxxlnyqafk.supabase.co/auth/v1',
|
|
26
25
|
'https://auth.sota.io/auth/v1',
|
|
27
26
|
];
|
|
28
27
|
function isLocalHost(hostname) {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"auth-config.js","sourceRoot":"","sources":["../../src/lib/auth-config.ts"],"names":[],"mappings":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
4
|
+
* descriptions, the get-account tool, the enterprise-app-checklist prompt and
|
|
5
|
+
* the docs page web/src/app/docs/enterprise/build-with-ai/page.mdx all state
|
|
6
|
+
* it with these exact lines; test/guide.test.mjs fails when the docs page and
|
|
7
|
+
* this file drift apart.
|
|
8
|
+
*
|
|
9
|
+
* Every line is Markdown and keeps anything in angle brackets inside
|
|
10
|
+
* backticks, so the same text renders in MDX.
|
|
11
|
+
*/
|
|
12
|
+
/** Rules for every sota app (Enterprise or not). */
|
|
13
|
+
export declare const BUILD_CONTRACT: readonly string[];
|
|
14
|
+
/** Extra rules for an app on a sota Enterprise account. */
|
|
15
|
+
export declare const ENTERPRISE_CONTRACT: readonly string[];
|
|
16
|
+
/** What the owner does after a deploy, before anyone can open the app. */
|
|
17
|
+
export declare const ENTERPRISE_ACCESS_STEPS: readonly string[];
|
|
18
|
+
export declare const DOCS: {
|
|
19
|
+
readonly buildWithAi: "https://sota.io/docs/enterprise/build-with-ai";
|
|
20
|
+
readonly identity: "https://sota.io/docs/enterprise/app-identity";
|
|
21
|
+
readonly limits: "https://sota.io/docs/enterprise/limits";
|
|
22
|
+
readonly mcpTools: "https://sota.io/docs/mcp/tools";
|
|
23
|
+
};
|
|
24
|
+
/**
|
|
25
|
+
* Server instructions (MCP `initialize`). Short on purpose: clients put them
|
|
26
|
+
* into the agent's context; the details come from get-account.
|
|
27
|
+
*/
|
|
28
|
+
export declare const SERVER_INSTRUCTIONS: string;
|
|
29
|
+
export declare function bullets(lines: readonly string[]): string;
|
|
30
|
+
export declare function numbered(lines: readonly string[]): string;
|
|
31
|
+
/** The Enterprise checklist (prompt + get-account), account-independent. */
|
|
32
|
+
export declare function enterpriseChecklist(): string;
|
|
33
|
+
//# sourceMappingURL=guide.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"guide.d.ts","sourceRoot":"","sources":["../../src/lib/guide.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;GAUG;AAEH,oDAAoD;AACpD,eAAO,MAAM,cAAc,EAAE,SAAS,MAAM,EAS3C,CAAC;AAEF,2DAA2D;AAC3D,eAAO,MAAM,mBAAmB,EAAE,SAAS,MAAM,EAUhD,CAAC;AAEF,0EAA0E;AAC1E,eAAO,MAAM,uBAAuB,EAAE,SAAS,MAAM,EAMpD,CAAC;AAEF,eAAO,MAAM,IAAI;;;;;CAKP,CAAC;AAEX;;;GAGG;AACH,eAAO,MAAM,mBAAmB,QAKlB,CAAC;AAEf,wBAAgB,OAAO,CAAC,KAAK,EAAE,SAAS,MAAM,EAAE,GAAG,MAAM,CAExD;AAED,wBAAgB,QAAQ,CAAC,KAAK,EAAE,SAAS,MAAM,EAAE,GAAG,MAAM,CAEzD;AAED,4EAA4E;AAC5E,wBAAgB,mBAAmB,IAAI,MAAM,CAe5C"}
|
|
@@ -0,0 +1,82 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* The build and identity contract an agent must follow on sota.io, in one
|
|
3
|
+
* place. The server instructions, the tool
|
|
4
|
+
* descriptions, the get-account tool, the enterprise-app-checklist prompt and
|
|
5
|
+
* the docs page web/src/app/docs/enterprise/build-with-ai/page.mdx all state
|
|
6
|
+
* it with these exact lines; test/guide.test.mjs fails when the docs page and
|
|
7
|
+
* this file drift apart.
|
|
8
|
+
*
|
|
9
|
+
* Every line is Markdown and keeps anything in angle brackets inside
|
|
10
|
+
* backticks, so the same text renders in MDX.
|
|
11
|
+
*/
|
|
12
|
+
/** Rules for every sota app (Enterprise or not). */
|
|
13
|
+
export const BUILD_CONTRACT = [
|
|
14
|
+
'One project runs one container with one web process. There is no second service, no worker container and no persistent disk: files written inside the container are lost on every deploy, so keep state in the database.',
|
|
15
|
+
'Build: a `Dockerfile` in the project root wins. Without one, sota accepts Node.js (a `package.json`; Next.js when there is a `next.config.*`) and Python (`requirements.txt` or `pyproject.toml`) and builds them with railpack. Any other language needs a `Dockerfile`.',
|
|
16
|
+
'Listen on `0.0.0.0` and the port in the `PORT` environment variable: 8080 for detected frameworks, the `EXPOSE` port of a Dockerfile.',
|
|
17
|
+
'Health gate: after the build, sota calls `GET /health` inside the container, and `GET /` when `/health` answers 404, without any identity headers. It must answer 2xx or 3xx within 60 seconds, or the deploy fails and the previous version keeps running.',
|
|
18
|
+
'Database: the first deploy creates a PostgreSQL 17 database and injects `DATABASE_URL` plus `PGHOST`, `PGPORT`, `PGUSER`, `PGPASSWORD` and `PGDATABASE`. `DATABASE_URL` goes through PgBouncer in transaction mode: no `LISTEN`/`NOTIFY`, no session state (`SET`, session advisory locks, temporary tables) and no named prepared statements (Prisma: add `?pgbouncer=true`). Run migrations at start, make them safe to run twice and keep them backwards compatible: during a deploy the previous version keeps serving on the same database until the new one passes the health gate.',
|
|
19
|
+
'Settings and secrets: `set-env`, then deploy again. They are only available at runtime, never at build time. Public build-time values such as `NEXT_PUBLIC_*` belong in `.env.production`; secrets never go into an uploaded file.',
|
|
20
|
+
'Uploads from a folder (local MCP server): `.git`, `node_modules`, `.DS_Store`, `.sota.json`, `__pycache__`, `.venv`, `*.log` and the local env files `.env`, `.env.local`, `.env.*.local` and `.envrc` are always left out. A `.sotaignore` in the root is used when it exists (an empty one uploads everything else); otherwise the `.gitignore` is used, but `.env.production` and `.env.example` are uploaded even when it lists them. Add a `.sotaignore` before deploying a folder that holds notes, credentials or data that must not leave the machine. A `git_url` deploy uploads the tracked files and reads only a `.sotaignore`. The hosted connector takes inline files only: at most 200 files and 10 MB.',
|
|
21
|
+
'Logs: `get-logs` shows the build and deploy log; when a deploy fails, `get-status` shows the reason. Logs of the running app are not available yet.',
|
|
22
|
+
];
|
|
23
|
+
/** Extra rules for an app on a sota Enterprise account. */
|
|
24
|
+
export const ENTERPRISE_CONTRACT = [
|
|
25
|
+
'Address: a project named `app` gets the slug `<label>-app` and the one URL `https://app.<label>.sota.io`. There is no `<slug>.sota.io` address.',
|
|
26
|
+
'Sign-in: sota Access signs people in with the company\'s Microsoft 365 on every path before a request reaches the app. Do not build a login, sign-up, password reset or session handling.',
|
|
27
|
+
'Identity: every signed-in request carries `X-Sota-Access-User-Id` (a stable UUID: use it as the user key), `X-Sota-Access-Email` (lower-case it before comparing; it can be the tenant sign-in name such as `name@company.onmicrosoft.com` instead of the mailbox) and `X-Sota-Access-Name` (display only). The headers carry no role: keep roles in the app\'s own database.',
|
|
28
|
+
'Fail closed: every route that shows or changes data answers 401 when `X-Sota-Access-User-Id` is missing. Only `GET /health` and `GET /` answer without it, and they show no data.',
|
|
29
|
+
'Health without identity: the health gate and the edge\'s check of `GET /` (every 30 seconds, redirects not followed) send no identity headers. `GET /health` must answer 200 and `GET /` 2xx or 3xx without them, for example a short "not signed in" page or a redirect. An app that answers 401 on `/` is marked down and nobody can open it.',
|
|
30
|
+
'Sign out: link to `/.sota/access/logout`. Paths under `/.sota/` belong to sota Access.',
|
|
31
|
+
'No public paths yet: webhooks, API clients and scripts without a browser cannot reach the app, and `POST`, `PUT`, `PATCH` or `DELETE` requests from other websites are refused.',
|
|
32
|
+
'Apps of the same account run on the same server. A direct call from one app to another skips the sign-in, and the caller can set any identity header: never treat such a call as a signed-in user, and authenticate app-to-app calls with your own shared secret.',
|
|
33
|
+
'Local development: the headers are missing on your machine. Use a fixed test user behind a development-only switch that is off in the deployed app.',
|
|
34
|
+
];
|
|
35
|
+
/** What the owner does after a deploy, before anyone can open the app. */
|
|
36
|
+
export const ENTERPRISE_ACCESS_STEPS = [
|
|
37
|
+
'Nobody can open a new app yet, the owner included.',
|
|
38
|
+
'The person opens the app URL once and signs in with Microsoft 365. This creates an access request.',
|
|
39
|
+
'The account owner signs in to the sota dashboard, opens Users & access, approves the person and ticks this app.',
|
|
40
|
+
'The person reloads the app. People approved earlier also need this app ticked.',
|
|
41
|
+
'API keys and MCP cannot approve people or change grants: tell the human what to do instead.',
|
|
42
|
+
];
|
|
43
|
+
export const DOCS = {
|
|
44
|
+
buildWithAi: 'https://sota.io/docs/enterprise/build-with-ai',
|
|
45
|
+
identity: 'https://sota.io/docs/enterprise/app-identity',
|
|
46
|
+
limits: 'https://sota.io/docs/enterprise/limits',
|
|
47
|
+
mcpTools: 'https://sota.io/docs/mcp/tools',
|
|
48
|
+
};
|
|
49
|
+
/**
|
|
50
|
+
* Server instructions (MCP `initialize`). Short on purpose: clients put them
|
|
51
|
+
* into the agent's context; the details come from get-account.
|
|
52
|
+
*/
|
|
53
|
+
export const SERVER_INSTRUCTIONS = [
|
|
54
|
+
'sota.io deploys web apps (EU, Germany). Before you write or deploy code for the user, call get-account once: it says whether the account is a sota Enterprise account and returns the build contract the app must follow.',
|
|
55
|
+
'Every app: one container, one web process, listen on the PORT env var, answer GET /health (or GET /) with 2xx/3xx within 60 s, no persistent disk, DATABASE_URL via PgBouncer in transaction mode.',
|
|
56
|
+
'Enterprise accounts: the company sign-in sits in front of every path, so never build a login; read the X-Sota-Access-* headers, fail closed without them except on GET /health and GET /, which must answer without identity. After a deploy nobody can open the app until the owner approves people and ticks the app under Users & access in the dashboard; MCP cannot do that, so tell the human.',
|
|
57
|
+
'deploy starts a build and returns at once: poll get-status until the deployment is running or failed.',
|
|
58
|
+
].join('\n\n');
|
|
59
|
+
export function bullets(lines) {
|
|
60
|
+
return lines.map((l) => `- ${l}`).join('\n');
|
|
61
|
+
}
|
|
62
|
+
export function numbered(lines) {
|
|
63
|
+
return lines.map((l, i) => `${i + 1}. ${l}`).join('\n');
|
|
64
|
+
}
|
|
65
|
+
/** The Enterprise checklist (prompt + get-account), account-independent. */
|
|
66
|
+
export function enterpriseChecklist() {
|
|
67
|
+
return [
|
|
68
|
+
'# Enterprise app checklist (sota.io)',
|
|
69
|
+
'',
|
|
70
|
+
'## Every sota app',
|
|
71
|
+
bullets(BUILD_CONTRACT),
|
|
72
|
+
'',
|
|
73
|
+
'## On a sota Enterprise account',
|
|
74
|
+
bullets(ENTERPRISE_CONTRACT),
|
|
75
|
+
'',
|
|
76
|
+
'## After the deploy: who can open the app',
|
|
77
|
+
numbered(ENTERPRISE_ACCESS_STEPS),
|
|
78
|
+
'',
|
|
79
|
+
`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AAC;AAC/C,CAAC;AAED,MAAM,UAAU,QAAQ,CAAC,KAAwB;IAC/C,OAAO,KAAK,CAAC,GAAG,CAAC,CAAC,CAAC,EAAE,CAAC,EAAE,EAAE,CAAC,GAAG,CAAC,GAAG,CAAC,KAAK,CAAC,EAAE,CAAC,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC;AAC1D,CAAC;AAED,4EAA4E;AAC5E,MAAM,UAAU,mBAAmB;IACjC,OAAO;QACL,sCAAsC;QACtC,EAAE;QACF,mBAAmB;QACnB,OAAO,CAAC,cAAc,CAAC;QACvB,EAAE;QACF,iCAAiC;QACjC,OAAO,CAAC,mBAAmB,CAAC;QAC5B,EAAE;QACF,2CAA2C;QAC3C,QAAQ,CAAC,uBAAuB,CAAC;QACjC,EAAE;QACF,SAAS,IAAI,CAAC,WAAW,EAAE;KAC5B,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC;AACf,CAAC"}
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
export interface IgnoreRules {
|
|
2
|
+
/** ".sotaignore", ".gitignore" or null when no file was used. */
|
|
3
|
+
source: string | null;
|
|
4
|
+
patterns: string[];
|
|
5
|
+
}
|
|
6
|
+
export declare const NO_RULES: IgnoreRules;
|
|
7
|
+
/** Kept when only the .gitignore fallback applies (base names). */
|
|
8
|
+
export declare const KEPT_FROM_GITIGNORE: ReadonlySet<string>;
|
|
9
|
+
export declare function loadIgnoreRules(root: string, opts: {
|
|
10
|
+
gitignoreFallback: boolean;
|
|
11
|
+
}): IgnoreRules;
|
|
12
|
+
/** relPath uses "/" and has no leading "./". */
|
|
13
|
+
export declare function isIgnored(relPath: string, isDir: boolean, patterns: readonly string[]): boolean;
|
|
14
|
+
/** isIgnored with the .gitignore-fallback exceptions. */
|
|
15
|
+
export declare function ignoredBy(rules: IgnoreRules, relPath: string, isDir: boolean): boolean;
|
|
16
|
+
//# sourceMappingURL=ignore.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"ignore.d.ts","sourceRoot":"","sources":["../../src/lib/ignore.ts"],"names":[],"mappings":"AA0BA,MAAM,WAAW,WAAW;IAC1B,iEAAiE;IACjE,MAAM,EAAE,MAAM,GAAG,IAAI,CAAC;IACtB,QAAQ,EAAE,MAAM,EAAE,CAAC;CACpB;AAED,eAAO,MAAM,QAAQ,EAAE,WAA4C,CAAC;AAEpE,mEAAmE;AACnE,eAAO,MAAM,mBAAmB,EAAE,WAAW,CAAC,MAAM,CAAgD,CAAC;AAcrG,wBAAgB,eAAe,CAAC,IAAI,EAAE,MAAM,EAAE,IAAI,EAAE;IAAE,iBAAiB,EAAE,OAAO,CAAA;CAAE,GAAG,WAAW,CAQ/F;AAyBD,gDAAgD;AAChD,wBAAgB,SAAS,CAAC,OAAO,EAAE,MAAM,EAAE,KAAK,EAAE,OAAO,EAAE,QAAQ,EAAE,SAAS,MAAM,EAAE,GAAG,OAAO,CAyB/F;AAED,yDAAyD;AACzD,wBAAgB,SAAS,CAAC,KAAK,EAAE,WAAW,EAAE,OAAO,EAAE,MAAM,EAAE,KAAK,EAAE,OAAO,GAAG,OAAO,CAQtF"}
|
|
@@ -0,0 +1,130 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* .sotaignore / .gitignore for directory and git deploys, with the CLI's
|
|
3
|
+
* pattern rules (cli/internal/archive/archive.go loadIgnorePatterns + shouldIgnore). Blank lines and # comments are skipped.
|
|
4
|
+
* A pattern matches a relative path when
|
|
5
|
+
* - it ends in "/" and names that directory or a path below it,
|
|
6
|
+
* - it equals the path or its base name,
|
|
7
|
+
* - it contains "*" and glob-matches the base name or the whole path
|
|
8
|
+
* ("*" and "?" do not cross "/"), or
|
|
9
|
+
* - it equals one path component.
|
|
10
|
+
* Additions to the CLI rules: a leading "/" anchors the pattern to the root
|
|
11
|
+
* (as in git); "!" lines are skipped (no re-include); a pattern that is not a
|
|
12
|
+
* valid glob is skipped (like Go's filepath.Match returning an error).
|
|
13
|
+
*
|
|
14
|
+
* Which file is read:
|
|
15
|
+
* - directory deploy: .sotaignore when it exists (an empty one means
|
|
16
|
+
* "nothing extra", it does NOT fall back to .gitignore); otherwise the
|
|
17
|
+
* .gitignore, but .env.production and .env.example are kept even when
|
|
18
|
+
* the .gitignore lists them (create-next-app's .gitignore has ".env*",
|
|
19
|
+
* and public build-time values such as NEXT_PUBLIC_* live there).
|
|
20
|
+
* - git_url deploy: only .sotaignore. A clone holds tracked files only,
|
|
21
|
+
* and tracked files that match the .gitignore (committed build output)
|
|
22
|
+
* have always been deployed.
|
|
23
|
+
*/
|
|
24
|
+
import { existsSync, readFileSync } from 'fs';
|
|
25
|
+
import { join } from 'path';
|
|
26
|
+
export const NO_RULES = { source: null, patterns: [] };
|
|
27
|
+
/** Kept when only the .gitignore fallback applies (base names). */
|
|
28
|
+
export const KEPT_FROM_GITIGNORE = new Set(['.env.production', '.env.example']);
|
|
29
|
+
function readPatterns(path) {
|
|
30
|
+
if (!existsSync(path))
|
|
31
|
+
return null;
|
|
32
|
+
try {
|
|
33
|
+
return readFileSync(path, 'utf8')
|
|
34
|
+
.split(/\r?\n/)
|
|
35
|
+
.map((l) => l.trim())
|
|
36
|
+
.filter((l) => l !== '' && !l.startsWith('#') && !l.startsWith('!'));
|
|
37
|
+
}
|
|
38
|
+
catch {
|
|
39
|
+
return null;
|
|
40
|
+
}
|
|
41
|
+
}
|
|
42
|
+
export function loadIgnoreRules(root, opts) {
|
|
43
|
+
const sota = readPatterns(join(root, '.sotaignore'));
|
|
44
|
+
if (sota !== null)
|
|
45
|
+
return { source: '.sotaignore', patterns: sota };
|
|
46
|
+
if (opts.gitignoreFallback) {
|
|
47
|
+
const git = readPatterns(join(root, '.gitignore'));
|
|
48
|
+
if (git !== null)
|
|
49
|
+
return { source: '.gitignore', patterns: git };
|
|
50
|
+
}
|
|
51
|
+
return NO_RULES;
|
|
52
|
+
}
|
|
53
|
+
/** null when the pattern is not a valid glob. */
|
|
54
|
+
function globToRegExp(glob) {
|
|
55
|
+
let re = '';
|
|
56
|
+
for (let i = 0; i < glob.length; i++) {
|
|
57
|
+
const c = glob[i];
|
|
58
|
+
if (c === '*')
|
|
59
|
+
re += '[^/]*';
|
|
60
|
+
else if (c === '?')
|
|
61
|
+
re += '[^/]';
|
|
62
|
+
else if (c === '[') {
|
|
63
|
+
const end = glob.indexOf(']', i + 1);
|
|
64
|
+
if (end === -1)
|
|
65
|
+
return null; // unterminated class: invalid, like filepath.Match
|
|
66
|
+
let cls = glob.slice(i + 1, end);
|
|
67
|
+
if (cls.startsWith('!') || cls.startsWith('^'))
|
|
68
|
+
cls = `^${cls.slice(1)}`;
|
|
69
|
+
re += `[${cls.replace(/\\/g, '\\\\')}]`;
|
|
70
|
+
i = end;
|
|
71
|
+
}
|
|
72
|
+
else
|
|
73
|
+
re += c.replace(/[.+^${}()|\\]/g, '\\$&');
|
|
74
|
+
}
|
|
75
|
+
try {
|
|
76
|
+
return new RegExp(`^${re}$`);
|
|
77
|
+
}
|
|
78
|
+
catch {
|
|
79
|
+
return null;
|
|
80
|
+
}
|
|
81
|
+
}
|
|
82
|
+
/** relPath uses "/" and has no leading "./". */
|
|
83
|
+
export function isIgnored(relPath, isDir, patterns) {
|
|
84
|
+
const base = relPath.slice(relPath.lastIndexOf('/') + 1);
|
|
85
|
+
const parts = relPath.split('/');
|
|
86
|
+
for (const raw of patterns) {
|
|
87
|
+
const anchored = raw.startsWith('/');
|
|
88
|
+
const pattern = anchored ? raw.slice(1) : raw;
|
|
89
|
+
if (pattern === '')
|
|
90
|
+
continue;
|
|
91
|
+
if (pattern.endsWith('/')) {
|
|
92
|
+
const dir = pattern.slice(0, -1);
|
|
93
|
+
if (isDir && (relPath === dir || relPath.startsWith(`${dir}/`)))
|
|
94
|
+
return true;
|
|
95
|
+
if (!isDir && relPath.startsWith(`${dir}/`))
|
|
96
|
+
return true;
|
|
97
|
+
continue;
|
|
98
|
+
}
|
|
99
|
+
if (relPath === pattern)
|
|
100
|
+
return true;
|
|
101
|
+
const wild = pattern.includes('*') || pattern.includes('?') || pattern.includes('[');
|
|
102
|
+
const re = wild ? globToRegExp(pattern) : null;
|
|
103
|
+
if (anchored) {
|
|
104
|
+
if (re && re.test(relPath))
|
|
105
|
+
return true;
|
|
106
|
+
continue;
|
|
107
|
+
}
|
|
108
|
+
if (base === pattern)
|
|
109
|
+
return true;
|
|
110
|
+
if (re && (re.test(base) || re.test(relPath)))
|
|
111
|
+
return true;
|
|
112
|
+
if (parts.includes(pattern))
|
|
113
|
+
return true;
|
|
114
|
+
}
|
|
115
|
+
return false;
|
|
116
|
+
}
|
|
117
|
+
/** isIgnored with the .gitignore-fallback exceptions. */
|
|
118
|
+
export function ignoredBy(rules, relPath, isDir) {
|
|
119
|
+
if (rules.patterns.length === 0)
|
|
120
|
+
return false;
|
|
121
|
+
if (!isIgnored(relPath, isDir, rules.patterns))
|
|
122
|
+
return false;
|
|
123
|
+
if (rules.source === '.gitignore' && !isDir) {
|
|
124
|
+
const base = relPath.slice(relPath.lastIndexOf('/') + 1);
|
|
125
|
+
if (KEPT_FROM_GITIGNORE.has(base))
|
|
126
|
+
return false;
|
|
127
|
+
}
|
|
128
|
+
return true;
|
|
129
|
+
}
|
|
130
|
+
//# sourceMappingURL=ignore.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"ignore.js","sourceRoot":"","sources":["../../src/lib/ignore.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;GAsBG;AACH,OAAO,EAAE,UAAU,EAAE,YAAY,EAAE,MAAM,IAAI,CAAC;AAC9C,OAAO,EAAE,IAAI,EAAE,MAAM,MAAM,CAAC;AAQ5B,MAAM,CAAC,MAAM,QAAQ,GAAgB,EAAE,MAAM,EAAE,IAAI,EAAE,QAAQ,EAAE,EAAE,EAAE,CAAC;AAEpE,mEAAmE;AACnE,MAAM,CAAC,MAAM,mBAAmB,GAAwB,IAAI,GAAG,CAAC,CAAC,iBAAiB,EAAE,cAAc,CAAC,CAAC,CAAC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AC,IAAI,CAAC,IAAI,CAAC,IAAI,EAAE,CAAC,IAAI,CAAC,OAAO,CAAC,CAAC;YAAE,OAAO,IAAI,CAAC;QAC3D,IAAI,KAAK,CAAC,QAAQ,CAAC,OAAO,CAAC;YAAE,OAAO,IAAI,CAAC;IAC3C,CAAC;IACD,OAAO,KAAK,CAAC;AACf,CAAC;AAED,yDAAyD;AACzD,MAAM,UAAU,SAAS,CAAC,KAAkB,EAAE,OAAe,EAAE,KAAc;IAC3E,IAAI,KAAK,CAAC,QAAQ,CAAC,MAAM,KAAK,CAAC;QAAE,OAAO,KAAK,CAAC;IAC9C,IAAI,CAAC,SAAS,CAAC,OAAO,EAAE,KAAK,EAAE,KAAK,CAAC,QAAQ,CAAC;QAAE,OAAO,KAAK,CAAC;IAC7D,IAAI,KAAK,CAAC,MAAM,KAAK,YAAY,IAAI,CAAC,KAAK,EAAE,CAAC;QAC5C,MAAM,IAAI,GAAG,OAAO,CAAC,KAAK,CAAC,OAAO,CAAC,WAAW,CAAC,GAAG,CAAC,GAAG,CAAC,CAAC,CAAC;QACzD,IAAI,mBAAmB,CAAC,GAAG,CAAC,IAAI,CAAC;YAAE,OAAO,KAAK,CAAC;IAClD,CAAC;IACD,OAAO,IAAI,CAAC;AACd,CAAC"}
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* The public URL of a project, as the API returns it in `project.url`
|
|
3
|
+
* An Enterprise app lives at `https://<app>.<customer>.sota.io`
|
|
4
|
+
* and has no `<slug>.sota.io` host, so tools show this value instead of
|
|
5
|
+
* composing one from the slug.
|
|
6
|
+
*
|
|
7
|
+
* The slug-based fallback is only for an API from before the `url` field;
|
|
8
|
+
* such an API has no Enterprise projects, so the composed URL is right there.
|
|
9
|
+
*/
|
|
10
|
+
export declare function projectUrl(project: {
|
|
11
|
+
slug: string;
|
|
12
|
+
url?: string | null;
|
|
13
|
+
}): string;
|
|
14
|
+
//# sourceMappingURL=project-url.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"project-url.d.ts","sourceRoot":"","sources":["../../src/lib/project-url.ts"],"names":[],"mappings":"AAAA;;;;;;;;GAQG;AACH,wBAAgB,UAAU,CAAC,OAAO,EAAE;IAAE,IAAI,EAAE,MAAM,CAAC;IAAC,GAAG,CAAC,EAAE,MAAM,GAAG,IAAI,CAAA;CAAE,GAAG,MAAM,CAKjF"}
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* The public URL of a project, as the API returns it in `project.url`
|
|
3
|
+
* An Enterprise app lives at `https://<app>.<customer>.sota.io`
|
|
4
|
+
* and has no `<slug>.sota.io` host, so tools show this value instead of
|
|
5
|
+
* composing one from the slug.
|
|
6
|
+
*
|
|
7
|
+
* The slug-based fallback is only for an API from before the `url` field;
|
|
8
|
+
* such an API has no Enterprise projects, so the composed URL is right there.
|
|
9
|
+
*/
|
|
10
|
+
export function projectUrl(project) {
|
|
11
|
+
if (typeof project.url === 'string' && project.url !== '') {
|
|
12
|
+
return project.url;
|
|
13
|
+
}
|
|
14
|
+
return `https://${project.slug}.sota.io`;
|
|
15
|
+
}
|
|
16
|
+
//# sourceMappingURL=project-url.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"project-url.js","sourceRoot":"","sources":["../../src/lib/project-url.ts"],"names":[],"mappings":"AAAA;;;;;;;;GAQG;AACH,MAAM,UAAU,UAAU,CAAC,OAA8C;IACvE,IAAI,OAAO,OAAO,CAAC,GAAG,KAAK,QAAQ,IAAI,OAAO,CAAC,GAAG,KAAK,EAAE,EAAE,CAAC;QAC1D,OAAO,OAAO,CAAC,GAAG,CAAC;IACrB,CAAC;IACD,OAAO,WAAW,OAAO,CAAC,IAAI,UAAU,CAAC;AAC3C,CAAC"}
|
package/dist/lib/version.d.ts
CHANGED
|
@@ -10,7 +10,7 @@
|
|
|
10
10
|
export declare function readPackageVersion(): string;
|
|
11
11
|
export declare const PACKAGE_VERSION: string;
|
|
12
12
|
/**
|
|
13
|
-
* Commit and build time of the hosted image
|
|
13
|
+
* Commit and build time of the hosted image. The Dockerfile turns
|
|
14
14
|
* the GIT_SHA and BUILD_TIME build args into environment variables of the
|
|
15
15
|
* runtime stage. Anything built without them (npm package, local checkout,
|
|
16
16
|
* a plain `docker compose build`) reports "unknown".
|