@somewhere-cloud/cli 0.38.161 → 0.38.163
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/CHANGELOG.md +10 -0
- package/bin/deploy-check.cjs +35 -0
- package/dist/lib/bundle.js +39285 -39134
- package/dist/lib/bundle.js.map +3 -3
- package/dist/lib/declared-data.js +1 -10
- package/dist/types/lib/client.d.ts +2 -0
- package/dist/types/lib/test-session.d.ts +8 -6
- package/dist/types/lib/testing-app.d.ts +1 -0
- package/npm-shrinkwrap.json +2 -2
- package/package.json +2 -2
- package/runtime/DECLARED-DATA-VENDOR.json +10 -10
- package/runtime/PLATFORM-SOURCE.json +1 -1
- package/runtime/SOURCE-LINT-VENDOR.json +2 -2
- package/runtime/declared-data.cjs +41 -9
- package/runtime/source-lint.cjs +1 -1
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,15 @@
|
|
|
1
1
|
# Changelog
|
|
2
2
|
|
|
3
|
+
## 0.38.163
|
|
4
|
+
|
|
5
|
+
- `somewhere auth set` accepts temporary deployment keys from `SOMEWHERE_TOKEN` or stdin. The CLI keeps the workspace expiry and claim link for deploy. Once the workspace expires, the CLI stops sending its key and shows how to start a new workspace or sign in.
|
|
6
|
+
- Deploy, init, typecheck, and lint suggest upgrading when the platform has newer rules. See contract versions in `somewhere mcp doctor` or with `NODE_DEBUG=somewhere-contract`.
|
|
7
|
+
|
|
8
|
+
## 0.38.162
|
|
9
|
+
|
|
10
|
+
- `somewhere typecheck` runs the same project TypeScript check as deploy, then checks deployable files and service calls in `sw.endpoint` handlers.
|
|
11
|
+
- New projects use SDK 0.14.5 or later within the same minor version, depending on the template.
|
|
12
|
+
|
|
3
13
|
## 0.38.161
|
|
4
14
|
|
|
5
15
|
- Syncs local runtime declarations with platform consumer contract 43. The declarations document the stop reasons for model refusals in `sw.ai.chat` and `sw.agent.run`.
|
|
@@ -0,0 +1,35 @@
|
|
|
1
|
+
'use strict';
|
|
2
|
+
|
|
3
|
+
const { existsSync } = require('node:fs');
|
|
4
|
+
const { delimiter, join, resolve } = require('node:path');
|
|
5
|
+
const { checkerContract } = require('../runtime/declared-data.cjs');
|
|
6
|
+
|
|
7
|
+
const configPath = process.argv[2];
|
|
8
|
+
const projectRoot = process.cwd();
|
|
9
|
+
const own = join(projectRoot, 'node_modules', 'typescript');
|
|
10
|
+
const compiler = [own, ...(process.env.PATH ?? '').split(delimiter).map(bin => resolve(bin, '..', 'typescript'))]
|
|
11
|
+
.find(dir => existsSync(join(dir, 'package.json')) && require(join(dir, 'package.json')).version === checkerContract.TYPESCRIPT_VERSION);
|
|
12
|
+
if (!compiler) throw new Error(`TypeScript ${checkerContract.TYPESCRIPT_VERSION} was not found.`);
|
|
13
|
+
const ts = require(compiler);
|
|
14
|
+
const config = ts.readConfigFile(configPath, ts.sys.readFile);
|
|
15
|
+
const parsed = config.error ? null : ts.parseJsonConfigFileContent(config.config, ts.sys, projectRoot);
|
|
16
|
+
const errors = config.error ? [config.error] : parsed.errors;
|
|
17
|
+
if (parsed && !errors.length) {
|
|
18
|
+
const { options, fileNames } = parsed;
|
|
19
|
+
const functionFiles = new Set(config.config.somewhereFunctionFiles.map(file => resolve(projectRoot, file)));
|
|
20
|
+
const host = ts.createCompilerHost(options);
|
|
21
|
+
const read = host.getSourceFile.bind(host);
|
|
22
|
+
host.getSourceFile = (file, ...args) => {
|
|
23
|
+
const source = read(file, ...args);
|
|
24
|
+
return functionFiles.has(resolve(file)) ? checkerContract.withEndpointBinding(ts, source, options) : source;
|
|
25
|
+
};
|
|
26
|
+
errors.push(...ts.getPreEmitDiagnostics(ts.createProgram(fileNames, options, host)));
|
|
27
|
+
}
|
|
28
|
+
if (errors.length) {
|
|
29
|
+
process.stdout.write(ts.formatDiagnostics(errors, {
|
|
30
|
+
getCanonicalFileName: (file) => file,
|
|
31
|
+
getCurrentDirectory: () => projectRoot,
|
|
32
|
+
getNewLine: () => '\n',
|
|
33
|
+
}));
|
|
34
|
+
process.exitCode = 1;
|
|
35
|
+
}
|