@ai-workbench/connect 0.0.0-stage → 0.7.6

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.
Files changed (131) hide show
  1. package/NOTICE.md +18 -0
  2. package/README.md +26 -2
  3. package/client/index.cjs +124 -0
  4. package/cordis.patch.yml +3 -0
  5. package/helper/auth-status.cjs +18 -0
  6. package/helper/claude-callback.cjs +29 -0
  7. package/helper/main.cjs +19 -0
  8. package/helper/projects.cjs +57 -0
  9. package/helper/remote-command.cjs +15 -0
  10. package/helper/remote-login.cjs +25 -0
  11. package/helper/window.cjs +52 -0
  12. package/lib/api.d.ts +196 -0
  13. package/lib/api.js +1 -0
  14. package/lib/archive.d.ts +1 -0
  15. package/lib/archive.js +63 -0
  16. package/lib/auth-status.d.ts +3 -0
  17. package/lib/auth-status.js +18 -0
  18. package/lib/cache.d.ts +21 -0
  19. package/lib/cache.js +156 -0
  20. package/lib/component-download.d.ts +32 -0
  21. package/lib/component-download.js +76 -0
  22. package/lib/component-source.d.ts +52 -0
  23. package/lib/component-source.js +146 -0
  24. package/lib/components.d.ts +10 -0
  25. package/lib/components.js +154 -0
  26. package/lib/connect.d.ts +10 -0
  27. package/lib/connect.js +246 -0
  28. package/lib/cordis.d.ts +15 -0
  29. package/lib/cordis.js +1 -0
  30. package/lib/defaults.d.ts +30 -0
  31. package/lib/defaults.js +4 -0
  32. package/lib/electron.d.ts +8 -0
  33. package/lib/electron.js +83 -0
  34. package/lib/enrollment.d.ts +3 -0
  35. package/lib/enrollment.js +78 -0
  36. package/lib/index.d.ts +42 -0
  37. package/lib/index.js +55 -0
  38. package/lib/integration.d.ts +6 -0
  39. package/lib/integration.js +56 -0
  40. package/lib/login.d.ts +35 -0
  41. package/lib/login.js +81 -0
  42. package/lib/native-import-picker.d.ts +11 -0
  43. package/lib/native-import-picker.js +49 -0
  44. package/lib/needs.d.ts +9 -0
  45. package/lib/needs.js +52 -0
  46. package/lib/network.d.ts +26 -0
  47. package/lib/network.js +226 -0
  48. package/lib/physical-fs.d.ts +3 -0
  49. package/lib/physical-fs.js +7 -0
  50. package/lib/ports.d.ts +43 -0
  51. package/lib/ports.js +1 -0
  52. package/lib/private-files.d.ts +3 -0
  53. package/lib/private-files.js +41 -0
  54. package/lib/processes.d.ts +5 -0
  55. package/lib/processes.js +147 -0
  56. package/lib/profile-activation.d.ts +32 -0
  57. package/lib/profile-activation.js +118 -0
  58. package/lib/profile-enrollment.d.ts +21 -0
  59. package/lib/profile-enrollment.js +275 -0
  60. package/lib/profile-runtime.d.ts +6 -0
  61. package/lib/profile-runtime.js +47 -0
  62. package/lib/profile-settings.d.ts +2 -0
  63. package/lib/profile-settings.js +13 -0
  64. package/lib/projects.d.ts +4 -0
  65. package/lib/projects.js +41 -0
  66. package/lib/provider.d.ts +73 -0
  67. package/lib/provider.js +39 -0
  68. package/lib/remote-login.d.ts +2 -0
  69. package/lib/remote-login.js +9 -0
  70. package/lib/ssh.d.ts +10 -0
  71. package/lib/ssh.js +78 -0
  72. package/lib/startup.d.ts +18 -0
  73. package/lib/startup.js +211 -0
  74. package/lib/workspace-bindings.d.ts +32 -0
  75. package/lib/workspace-bindings.js +328 -0
  76. package/locale/en.json +6 -0
  77. package/locale/zh.json +6 -0
  78. package/node_modules/argparse/LICENSE +254 -0
  79. package/node_modules/argparse/README.md +84 -0
  80. package/node_modules/argparse/argparse.js +3707 -0
  81. package/node_modules/argparse/lib/sub.js +67 -0
  82. package/node_modules/argparse/lib/textwrap.js +440 -0
  83. package/node_modules/argparse/package.json +31 -0
  84. package/node_modules/js-yaml/LICENSE +21 -0
  85. package/node_modules/js-yaml/README.md +233 -0
  86. package/node_modules/js-yaml/bin/js-yaml.js +117 -0
  87. package/node_modules/js-yaml/dist/js-yaml.js +3022 -0
  88. package/node_modules/js-yaml/dist/js-yaml.js.map +1 -0
  89. package/node_modules/js-yaml/dist/js-yaml.min.js +2 -0
  90. package/node_modules/js-yaml/dist/js-yaml.min.js.map +1 -0
  91. package/node_modules/js-yaml/dist/js-yaml.mjs +3082 -0
  92. package/node_modules/js-yaml/dist/js-yaml.mjs.map +1 -0
  93. package/node_modules/js-yaml/index.js +44 -0
  94. package/node_modules/js-yaml/lib/common.js +50 -0
  95. package/node_modules/js-yaml/lib/dumper.js +937 -0
  96. package/node_modules/js-yaml/lib/exception.js +51 -0
  97. package/node_modules/js-yaml/lib/index_vite_proxy.tmp.mjs +37 -0
  98. package/node_modules/js-yaml/lib/loader.js +1803 -0
  99. package/node_modules/js-yaml/lib/schema/core.js +9 -0
  100. package/node_modules/js-yaml/lib/schema/default.js +20 -0
  101. package/node_modules/js-yaml/lib/schema/failsafe.js +14 -0
  102. package/node_modules/js-yaml/lib/schema/json.js +17 -0
  103. package/node_modules/js-yaml/lib/schema.js +109 -0
  104. package/node_modules/js-yaml/lib/snippet.js +96 -0
  105. package/node_modules/js-yaml/lib/type/binary.js +122 -0
  106. package/node_modules/js-yaml/lib/type/bool.js +35 -0
  107. package/node_modules/js-yaml/lib/type/float.js +99 -0
  108. package/node_modules/js-yaml/lib/type/int.js +142 -0
  109. package/node_modules/js-yaml/lib/type/map.js +8 -0
  110. package/node_modules/js-yaml/lib/type/merge.js +12 -0
  111. package/node_modules/js-yaml/lib/type/null.js +35 -0
  112. package/node_modules/js-yaml/lib/type/omap.js +45 -0
  113. package/node_modules/js-yaml/lib/type/pairs.js +50 -0
  114. package/node_modules/js-yaml/lib/type/seq.js +8 -0
  115. package/node_modules/js-yaml/lib/type/set.js +29 -0
  116. package/node_modules/js-yaml/lib/type/str.js +8 -0
  117. package/node_modules/js-yaml/lib/type/timestamp.js +88 -0
  118. package/node_modules/js-yaml/lib/type.js +66 -0
  119. package/node_modules/js-yaml/package.json +83 -0
  120. package/node_modules/pend/LICENSE +23 -0
  121. package/node_modules/pend/README.md +41 -0
  122. package/node_modules/pend/index.js +55 -0
  123. package/node_modules/pend/package.json +18 -0
  124. package/node_modules/pend/test.js +137 -0
  125. package/node_modules/yauzl/LICENSE +21 -0
  126. package/node_modules/yauzl/README.md +1015 -0
  127. package/node_modules/yauzl/crc32.js +45 -0
  128. package/node_modules/yauzl/fd-slicer.js +188 -0
  129. package/node_modules/yauzl/index.js +1096 -0
  130. package/node_modules/yauzl/package.json +40 -0
  131. package/package.json +89 -4
@@ -0,0 +1,233 @@
1
+ JS-YAML - YAML 1.2 parser / writer for JavaScript
2
+ =================================================
3
+
4
+ [![CI](https://github.com/nodeca/js-yaml/actions/workflows/ci.yml/badge.svg)](https://github.com/nodeca/js-yaml/actions/workflows/ci.yml)
5
+ [![NPM version](https://img.shields.io/npm/v/js-yaml.svg)](https://www.npmjs.org/package/js-yaml)
6
+
7
+ __[Online Demo](https://nodeca.github.io/js-yaml/)__
8
+
9
+
10
+ This is an implementation of [YAML](https://yaml.org/), a human-friendly data
11
+ serialization language. Started as [PyYAML](https://pyyaml.org/) port, it was
12
+ completely rewritten from scratch. Now it's very fast, and supports 1.2 spec.
13
+
14
+
15
+ Installation
16
+ ------------
17
+
18
+ ### YAML module for node.js
19
+
20
+ ```
21
+ npm install js-yaml
22
+ ```
23
+
24
+
25
+ ### CLI executable
26
+
27
+ If you want to inspect your YAML files from CLI, install js-yaml globally:
28
+
29
+ ```
30
+ npm install -g js-yaml
31
+ ```
32
+
33
+ #### Usage
34
+
35
+ ```
36
+ usage: js-yaml [-h] [-v] [-c] [-t] file
37
+
38
+ Positional arguments:
39
+ file File with YAML document(s)
40
+
41
+ Optional arguments:
42
+ -h, --help Show this help message and exit.
43
+ -v, --version Show program's version number and exit.
44
+ -c, --compact Display errors in compact mode
45
+ -t, --trace Show stack trace on error
46
+ ```
47
+
48
+
49
+ API
50
+ ---
51
+
52
+ Here we cover the most 'useful' methods. If you need advanced details (creating
53
+ your own tags), see [examples](https://github.com/nodeca/js-yaml/tree/master/examples)
54
+ for more info.
55
+
56
+ ``` javascript
57
+ const yaml = require('js-yaml');
58
+ const fs = require('fs');
59
+
60
+ // Get document, or throw exception on error
61
+ try {
62
+ const doc = yaml.load(fs.readFileSync('/home/ixti/example.yml', 'utf8'));
63
+ console.log(doc);
64
+ } catch (e) {
65
+ console.log(e);
66
+ }
67
+ ```
68
+
69
+
70
+ ### load (string [ , options ])
71
+
72
+ Parses `string` as single YAML document. Returns either a
73
+ plain object, a string, a number, `null` or `undefined`, or throws `YAMLException` on error. By default, does
74
+ not support regexps, functions and undefined.
75
+
76
+ options:
77
+
78
+ - `filename` _(default: null)_ - string to be used as a file path in
79
+ error/warning messages.
80
+ - `onWarning` _(default: null)_ - function to call on warning messages.
81
+ Loader will call this function with an instance of `YAMLException` for each warning.
82
+ - `schema` _(default: `DEFAULT_SCHEMA`)_ - specifies a schema to use.
83
+ - `FAILSAFE_SCHEMA` - only strings, arrays and plain objects:
84
+ https://www.yaml.org/spec/1.2/spec.html#id2802346
85
+ - `JSON_SCHEMA` - all JSON-supported types:
86
+ https://www.yaml.org/spec/1.2/spec.html#id2803231
87
+ - `CORE_SCHEMA` - same as `JSON_SCHEMA`:
88
+ https://www.yaml.org/spec/1.2/spec.html#id2804923
89
+ - `DEFAULT_SCHEMA` - all supported YAML types.
90
+ - `json` _(default: false)_ - compatibility with JSON.parse behaviour. If true, then duplicate keys in a mapping will override values rather than throwing an error.
91
+ - `maxDepth` _(default: 100)_ - limits nesting depth for collections (does not
92
+ take aliasees into account).
93
+ - `maxTotalMergeKeys` _(default: 10000)_ - limits the total number of keys
94
+ processed by merge (`<<`) across one `load()` / `loadAll()` call. Set to `-1`
95
+ to disable.
96
+
97
+ NOTE: This function **does not** understand multi-document sources, it throws
98
+ exception on those.
99
+
100
+ NOTE: JS-YAML **does not** support schema-specific tag resolution restrictions.
101
+ So, the JSON schema is not as strictly defined in the YAML specification.
102
+ It allows numbers in any notation, use `Null` and `NULL` as `null`, etc.
103
+ The core schema also has no such restrictions. It allows binary notation for integers.
104
+
105
+
106
+ ### loadAll (string [, iterator] [, options ])
107
+
108
+ Same as `load()`, but understands multi-document sources. Applies
109
+ `iterator` to each document if specified, or returns array of documents.
110
+
111
+ ``` javascript
112
+ const yaml = require('js-yaml');
113
+
114
+ yaml.loadAll(data, function (doc) {
115
+ console.log(doc);
116
+ });
117
+ ```
118
+
119
+
120
+ ### dump (object [ , options ])
121
+
122
+ Serializes `object` as a YAML document. Uses `DEFAULT_SCHEMA`, so it will
123
+ throw an exception if you try to dump regexps or functions. However, you can
124
+ disable exceptions by setting the `skipInvalid` option to `true`.
125
+
126
+ options:
127
+
128
+ - `indent` _(default: 2)_ - indentation width to use (in spaces).
129
+ - `noArrayIndent` _(default: false)_ - when true, will not add an indentation level to array elements
130
+ - `skipInvalid` _(default: false)_ - do not throw on invalid types (like function
131
+ in the safe schema) and skip pairs and single values with such types.
132
+ - `flowLevel` _(default: -1)_ - specifies level of nesting, when to switch from
133
+ block to flow style for collections. -1 means block style everwhere
134
+ - `styles` - "tag" => "style" map. Each tag may have own set of styles.
135
+ - `schema` _(default: `DEFAULT_SCHEMA`)_ specifies a schema to use.
136
+ - `sortKeys` _(default: `false`)_ - if `true`, sort keys when dumping YAML. If a
137
+ function, use the function to sort the keys.
138
+ - `lineWidth` _(default: `80`)_ - set max line width. Set `-1` for unlimited width.
139
+ - `noRefs` _(default: `false`)_ - if `true`, don't convert duplicate objects into references
140
+ - `noCompatMode` _(default: `false`)_ - if `true` don't try to be compatible with older
141
+ yaml versions. Currently: don't quote "yes", "no" and so on, as required for YAML 1.1
142
+ - `condenseFlow` _(default: `false`)_ - if `true` flow sequences will be condensed, omitting the space between `a, b`. Eg. `'[a,b]'`, and omitting the space between `key: value` and quoting the key. Eg. `'{"a":b}'` Can be useful when using yaml for pretty URL query params as spaces are %-encoded.
143
+ - `quotingType` _(`'` or `"`, default: `'`)_ - strings will be quoted using this quoting style. If you specify single quotes, double quotes will still be used for non-printable characters.
144
+ - `forceQuotes` _(default: `false`)_ - if `true`, all non-key strings will be quoted even if they normally don't need to.
145
+ - `replacer` - callback `function (key, value)` called recursively on each key/value in source object (see `replacer` docs for `JSON.stringify`).
146
+
147
+ The following table show availlable styles (e.g. "canonical",
148
+ "binary"...) available for each tag (.e.g. !!null, !!int ...). Yaml
149
+ output is shown on the right side after `=>` (default setting) or `->`:
150
+
151
+ ``` none
152
+ !!null
153
+ "canonical" -> "~"
154
+ "lowercase" => "null"
155
+ "uppercase" -> "NULL"
156
+ "camelcase" -> "Null"
157
+ "empty" -> ""
158
+
159
+ !!int
160
+ "binary" -> "0b1", "0b101010", "0b1110001111010"
161
+ "octal" -> "0o1", "0o52", "0o16172"
162
+ "decimal" => "1", "42", "7290"
163
+ "hexadecimal" -> "0x1", "0x2A", "0x1C7A"
164
+
165
+ !!bool
166
+ "lowercase" => "true", "false"
167
+ "uppercase" -> "TRUE", "FALSE"
168
+ "camelcase" -> "True", "False"
169
+
170
+ !!float
171
+ "lowercase" => ".nan", '.inf'
172
+ "uppercase" -> ".NAN", '.INF'
173
+ "camelcase" -> ".NaN", '.Inf'
174
+ ```
175
+
176
+ Example:
177
+
178
+ ``` javascript
179
+ dump(object, {
180
+ 'styles': {
181
+ '!!null': 'canonical' // dump null as ~
182
+ },
183
+ 'sortKeys': true // sort object keys
184
+ });
185
+ ```
186
+
187
+ Supported YAML types
188
+ --------------------
189
+
190
+ The list of standard YAML tags and corresponding JavaScript types. See also
191
+ [YAML tag discussion](https://pyyaml.org/wiki/YAMLTagDiscussion) and
192
+ [YAML types repository](https://yaml.org/type/).
193
+
194
+ ```
195
+ !!null '' # null
196
+ !!bool 'yes' # bool
197
+ !!int '3...' # number
198
+ !!float '3.14...' # number
199
+ !!binary '...base64...' # buffer
200
+ !!timestamp 'YYYY-...' # date
201
+ !!omap [ ... ] # array of key-value pairs
202
+ !!pairs [ ... ] # array or array pairs
203
+ !!set { ... } # array of objects with given keys and null values
204
+ !!str '...' # string
205
+ !!seq [ ... ] # array
206
+ !!map { ... } # object
207
+ ```
208
+
209
+ **JavaScript-specific tags**
210
+
211
+ See [js-yaml-js-types](https://github.com/nodeca/js-yaml-js-types) for
212
+ extra types.
213
+
214
+
215
+ Caveats
216
+ -------
217
+
218
+ Note, that you use arrays or objects as key in JS-YAML. JS does not allow objects
219
+ or arrays as keys, and stringifies (by calling `toString()` method) them at the
220
+ moment of adding them.
221
+
222
+ ``` yaml
223
+ ---
224
+ ? [ foo, bar ]
225
+ : - baz
226
+ ? { foo: bar }
227
+ : - baz
228
+ - baz
229
+ ```
230
+
231
+ ``` javascript
232
+ { "foo,bar": ["baz"], "[object Object]": ["baz", "baz"] }
233
+ ```
@@ -0,0 +1,117 @@
1
+ #!/usr/bin/env node
2
+
3
+ 'use strict'
4
+
5
+ const fs = require('fs')
6
+ const argparse = require('argparse')
7
+ const yaml = require('..')
8
+
9
+ /// /////////////////////////////////////////////////////////////////////////////
10
+
11
+ const cli = new argparse.ArgumentParser({
12
+ prog: 'js-yaml',
13
+ add_help: true
14
+ })
15
+
16
+ cli.add_argument('-v', '--version', {
17
+ action: 'version',
18
+ version: require('../package.json').version
19
+ })
20
+
21
+ cli.add_argument('-c', '--compact', {
22
+ help: 'Display errors in compact mode',
23
+ action: 'store_true'
24
+ })
25
+
26
+ // deprecated (not needed after we removed output colors)
27
+ // option suppressed, but not completely removed for compatibility
28
+ cli.add_argument('-j', '--to-json', {
29
+ help: argparse.SUPPRESS,
30
+ dest: 'json',
31
+ action: 'store_true'
32
+ })
33
+
34
+ cli.add_argument('-t', '--trace', {
35
+ help: 'Show stack trace on error',
36
+ action: 'store_true'
37
+ })
38
+
39
+ cli.add_argument('file', {
40
+ help: 'File to read, utf-8 encoded without BOM',
41
+ nargs: '?',
42
+ default: '-'
43
+ })
44
+
45
+ /// /////////////////////////////////////////////////////////////////////////////
46
+
47
+ const options = cli.parse_args()
48
+
49
+ /// /////////////////////////////////////////////////////////////////////////////
50
+
51
+ function readFile (filename, encoding, callback) {
52
+ if (options.file === '-') {
53
+ // read from stdin
54
+
55
+ const chunks = []
56
+
57
+ process.stdin.on('data', function (chunk) {
58
+ chunks.push(chunk)
59
+ })
60
+
61
+ process.stdin.on('end', function () {
62
+ return callback(null, Buffer.concat(chunks).toString(encoding))
63
+ })
64
+ } else {
65
+ fs.readFile(filename, encoding, callback)
66
+ }
67
+ }
68
+
69
+ readFile(options.file, 'utf8', function (error, input) {
70
+ let output
71
+ let isYaml
72
+
73
+ if (error) {
74
+ if (error.code === 'ENOENT') {
75
+ console.error('File not found: ' + options.file)
76
+ process.exit(2)
77
+ }
78
+
79
+ console.error(
80
+ (options.trace && error.stack) ||
81
+ error.message ||
82
+ String(error))
83
+
84
+ process.exit(1)
85
+ }
86
+
87
+ try {
88
+ output = JSON.parse(input)
89
+ isYaml = false
90
+ } catch (err) {
91
+ if (err instanceof SyntaxError) {
92
+ try {
93
+ output = []
94
+ yaml.loadAll(input, function (doc) { output.push(doc) }, {})
95
+ isYaml = true
96
+
97
+ if (output.length === 0) output = null
98
+ else if (output.length === 1) output = output[0]
99
+ } catch (e) {
100
+ if (options.trace && err.stack) console.error(e.stack)
101
+ else console.error(e.toString(options.compact))
102
+
103
+ process.exit(1)
104
+ }
105
+ } else {
106
+ console.error(
107
+ (options.trace && err.stack) ||
108
+ err.message ||
109
+ String(err))
110
+
111
+ process.exit(1)
112
+ }
113
+ }
114
+
115
+ if (isYaml) console.log(JSON.stringify(output, null, ' '))
116
+ else console.log(yaml.dump(output))
117
+ })