synra 0.0.0 → 0.0.8
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/LICENSE +21 -0
- package/dist/index.d.ts +30 -0
- package/dist/index.d.ts.map +1 -0
- package/package.json +37 -11
package/LICENSE
ADDED
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
MIT License
|
|
2
|
+
|
|
3
|
+
Copyright (c) 2026 imba97
|
|
4
|
+
|
|
5
|
+
Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
6
|
+
of this software and associated documentation files (the "Software"), to deal
|
|
7
|
+
in the Software without restriction, including without limitation the rights
|
|
8
|
+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
9
|
+
copies of the Software, and to permit persons to whom the Software is
|
|
10
|
+
furnished to do so, subject to the following conditions:
|
|
11
|
+
|
|
12
|
+
The above copyright notice and this permission notice shall be included in all
|
|
13
|
+
copies or substantial portions of the Software.
|
|
14
|
+
|
|
15
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
16
|
+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
17
|
+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
18
|
+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
19
|
+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
20
|
+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
|
21
|
+
SOFTWARE.
|
package/dist/index.d.ts
ADDED
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* `synra` —— 汇总对外类型面。
|
|
3
|
+
*
|
|
4
|
+
* # 为什么"一般不用安装"
|
|
5
|
+
*
|
|
6
|
+
* 这个包的存在只是为了让作者能写不带 scope 的短路径:
|
|
7
|
+
*
|
|
8
|
+
* ```ts
|
|
9
|
+
* import type { SynraError } from 'synra'
|
|
10
|
+
* ```
|
|
11
|
+
*
|
|
12
|
+
* 而不用在 `package.json` 里多装一个包。机制是**传递依赖**:`@synra/client` 依赖本包,所以
|
|
13
|
+
* 作者装了 `@synra/client` 之后,`node_modules/synra` 也在那里,`'synra'` 就能解析。
|
|
14
|
+
*
|
|
15
|
+
* 代价是"依赖关系不那么显式"。收益是作者少一个包、少一个要对齐的版本。为了让行为可预测,
|
|
16
|
+
* 三个包(`synra`、`@synra/client`、`@synra/protocol`)**同步发布同一个版本号** —— 它们互相
|
|
17
|
+
* re-export,版本错位会产生"类型来自不同代次"的诡异错误,而那种错误极难诊断。
|
|
18
|
+
*
|
|
19
|
+
* # 禁止的事
|
|
20
|
+
*
|
|
21
|
+
* - ❌ 放**运行时实现**:会破坏"零运行时",并与注入对象形成两份实现。
|
|
22
|
+
* - ❌ 定义**新类型**:会造成同一类型两处定义,而两处会漂移。
|
|
23
|
+
* - ❌ 让它成为**唯一**入口:`testkit` 依赖 `@synra/client`,且 `types` 需要包名稳定。
|
|
24
|
+
* - ❌ 让插件把它写进 **`dependencies`**:它零运行时,进运行时依赖只会让人以为它有用。
|
|
25
|
+
*/
|
|
26
|
+
export type * from '@synra/client';
|
|
27
|
+
export type * from '@synra/protocol';
|
|
28
|
+
export type { SynraClient, SynraError, SynraErrorCode, SynraResponse, Unsubscribe } from '@synra/client';
|
|
29
|
+
export type { DeviceId, DigestAlgorithm, Envelope, ErrorCode, IntentId, IntentInvocation, IntentOutcome, PairRefusal, Platform, PlatformKind, PluginId, RequestId, SuggestedAction, TraceId, TransferAbortReason, TransferId, TransferKind, TransferProgress, } from '@synra/protocol';
|
|
30
|
+
//# sourceMappingURL=index.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;GAwBG;AAIH,mBAAmB,eAAe,CAAA;AAClC,mBAAmB,iBAAiB,CAAA;AAIpC,YAAY,EAAE,WAAW,EAAE,UAAU,EAAE,cAAc,EAAE,aAAa,EAAE,WAAW,EAAE,MAAM,eAAe,CAAA;AAExG,YAAY,EACV,QAAQ,EACR,eAAe,EACf,QAAQ,EACR,SAAS,EACT,QAAQ,EACR,gBAAgB,EAChB,aAAa,EACb,WAAW,EACX,QAAQ,EACR,YAAY,EACZ,QAAQ,EACR,SAAS,EACT,eAAe,EACf,OAAO,EACP,mBAAmB,EACnB,UAAU,EACV,YAAY,EACZ,gBAAgB,GACjB,MAAM,iBAAiB,CAAA"}
|
package/package.json
CHANGED
|
@@ -1,11 +1,37 @@
|
|
|
1
|
-
{
|
|
2
|
-
"name": "synra",
|
|
3
|
-
"version": "0.0.
|
|
4
|
-
"
|
|
5
|
-
"
|
|
6
|
-
"
|
|
7
|
-
"
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
}
|
|
1
|
+
{
|
|
2
|
+
"name": "synra",
|
|
3
|
+
"version": "0.0.8",
|
|
4
|
+
"description": "The aggregate type surface for Synra plugin authors. Zero runtime; usually resolved transitively.",
|
|
5
|
+
"license": "MIT",
|
|
6
|
+
"homepage": "https://github.com/synra-rs/synra-js#readme",
|
|
7
|
+
"repository": {
|
|
8
|
+
"type": "git",
|
|
9
|
+
"url": "git+https://github.com/synra-rs/synra-js.git",
|
|
10
|
+
"directory": "packages/synra"
|
|
11
|
+
},
|
|
12
|
+
"bugs": {
|
|
13
|
+
"url": "https://github.com/synra-rs/synra-js/issues"
|
|
14
|
+
},
|
|
15
|
+
"type": "module",
|
|
16
|
+
"sideEffects": false,
|
|
17
|
+
"files": ["dist", "!dist/.tsbuildinfo"],
|
|
18
|
+
"exports": {
|
|
19
|
+
".": {
|
|
20
|
+
"types": "./dist/index.d.ts"
|
|
21
|
+
}
|
|
22
|
+
},
|
|
23
|
+
"types": "./dist/index.d.ts",
|
|
24
|
+
"publishConfig": {
|
|
25
|
+
"access": "public"
|
|
26
|
+
},
|
|
27
|
+
"scripts": {
|
|
28
|
+
"build": "tsc -b",
|
|
29
|
+
"test": "vitest run --passWithNoTests"
|
|
30
|
+
},
|
|
31
|
+
"devDependencies": {
|
|
32
|
+
"@synra/client": "workspace:^",
|
|
33
|
+
"@synra/protocol": "workspace:^",
|
|
34
|
+
"typescript": "^5.7.0",
|
|
35
|
+
"vitest": "^3.0.0"
|
|
36
|
+
}
|
|
37
|
+
}
|