activecollab-mcp 1.9.0__tar.gz

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 (64) hide show
  1. activecollab_mcp-1.9.0/.env.example +45 -0
  2. activecollab_mcp-1.9.0/.gitignore +31 -0
  3. activecollab_mcp-1.9.0/.opencode/node_modules/@ai-sdk/provider/LICENSE +13 -0
  4. activecollab_mcp-1.9.0/.opencode/node_modules/@ai-sdk/provider/README.md +1 -0
  5. activecollab_mcp-1.9.0/.opencode/node_modules/@msgpackr-extract/msgpackr-extract-darwin-arm64/README.md +1 -0
  6. activecollab_mcp-1.9.0/.opencode/node_modules/@standard-schema/spec/LICENSE +21 -0
  7. activecollab_mcp-1.9.0/.opencode/node_modules/@standard-schema/spec/README.md +198 -0
  8. activecollab_mcp-1.9.0/.opencode/node_modules/cross-spawn/LICENSE +21 -0
  9. activecollab_mcp-1.9.0/.opencode/node_modules/cross-spawn/README.md +89 -0
  10. activecollab_mcp-1.9.0/.opencode/node_modules/detect-libc/LICENSE +201 -0
  11. activecollab_mcp-1.9.0/.opencode/node_modules/detect-libc/README.md +163 -0
  12. activecollab_mcp-1.9.0/.opencode/node_modules/effect/LICENSE +21 -0
  13. activecollab_mcp-1.9.0/.opencode/node_modules/effect/README.md +53 -0
  14. activecollab_mcp-1.9.0/.opencode/node_modules/fast-check/LICENSE +21 -0
  15. activecollab_mcp-1.9.0/.opencode/node_modules/fast-check/README.md +262 -0
  16. activecollab_mcp-1.9.0/.opencode/node_modules/find-my-way-ts/LICENSE +21 -0
  17. activecollab_mcp-1.9.0/.opencode/node_modules/find-my-way-ts/README.md +5 -0
  18. activecollab_mcp-1.9.0/.opencode/node_modules/ini/LICENSE +15 -0
  19. activecollab_mcp-1.9.0/.opencode/node_modules/ini/README.md +180 -0
  20. activecollab_mcp-1.9.0/.opencode/node_modules/isexe/LICENSE +15 -0
  21. activecollab_mcp-1.9.0/.opencode/node_modules/isexe/README.md +51 -0
  22. activecollab_mcp-1.9.0/.opencode/node_modules/json-schema/LICENSE +195 -0
  23. activecollab_mcp-1.9.0/.opencode/node_modules/json-schema/README.md +3 -0
  24. activecollab_mcp-1.9.0/.opencode/node_modules/kubernetes-types/README.md +32 -0
  25. activecollab_mcp-1.9.0/.opencode/node_modules/msgpackr/LICENSE +21 -0
  26. activecollab_mcp-1.9.0/.opencode/node_modules/msgpackr/README.md +386 -0
  27. activecollab_mcp-1.9.0/.opencode/node_modules/msgpackr-extract/LICENSE +21 -0
  28. activecollab_mcp-1.9.0/.opencode/node_modules/msgpackr-extract/README.md +5 -0
  29. activecollab_mcp-1.9.0/.opencode/node_modules/multipasta/LICENSE +21 -0
  30. activecollab_mcp-1.9.0/.opencode/node_modules/multipasta/README.md +3 -0
  31. activecollab_mcp-1.9.0/.opencode/node_modules/node-gyp-build-optional-packages/LICENSE +21 -0
  32. activecollab_mcp-1.9.0/.opencode/node_modules/node-gyp-build-optional-packages/README.md +58 -0
  33. activecollab_mcp-1.9.0/.opencode/node_modules/pure-rand/LICENSE +21 -0
  34. activecollab_mcp-1.9.0/.opencode/node_modules/pure-rand/README.md +168 -0
  35. activecollab_mcp-1.9.0/.opencode/node_modules/toml/LICENSE +22 -0
  36. activecollab_mcp-1.9.0/.opencode/node_modules/toml/README.md +173 -0
  37. activecollab_mcp-1.9.0/.opencode/node_modules/uuid/README.md +491 -0
  38. activecollab_mcp-1.9.0/.opencode/node_modules/which/LICENSE +15 -0
  39. activecollab_mcp-1.9.0/.opencode/node_modules/which/README.md +54 -0
  40. activecollab_mcp-1.9.0/.opencode/node_modules/yaml/LICENSE +13 -0
  41. activecollab_mcp-1.9.0/.opencode/node_modules/yaml/README.md +172 -0
  42. activecollab_mcp-1.9.0/.opencode/node_modules/zod/LICENSE +21 -0
  43. activecollab_mcp-1.9.0/.opencode/node_modules/zod/README.md +208 -0
  44. activecollab_mcp-1.9.0/LICENSE +21 -0
  45. activecollab_mcp-1.9.0/PKG-INFO +443 -0
  46. activecollab_mcp-1.9.0/README.md +407 -0
  47. activecollab_mcp-1.9.0/archive/js/.env.example +31 -0
  48. activecollab_mcp-1.9.0/archive/js/README.md +111 -0
  49. activecollab_mcp-1.9.0/pyproject.toml +74 -0
  50. activecollab_mcp-1.9.0/src/activecollab_mcp/__init__.py +10 -0
  51. activecollab_mcp-1.9.0/src/activecollab_mcp/__main__.py +4 -0
  52. activecollab_mcp-1.9.0/src/activecollab_mcp/auth.py +134 -0
  53. activecollab_mcp-1.9.0/src/activecollab_mcp/cli.py +695 -0
  54. activecollab_mcp-1.9.0/src/activecollab_mcp/client.py +757 -0
  55. activecollab_mcp-1.9.0/src/activecollab_mcp/config.py +187 -0
  56. activecollab_mcp-1.9.0/src/activecollab_mcp/credentials.py +84 -0
  57. activecollab_mcp-1.9.0/src/activecollab_mcp/daemon.py +169 -0
  58. activecollab_mcp-1.9.0/src/activecollab_mcp/helpers.py +462 -0
  59. activecollab_mcp-1.9.0/src/activecollab_mcp/logging_setup.py +82 -0
  60. activecollab_mcp-1.9.0/src/activecollab_mcp/portutil.py +50 -0
  61. activecollab_mcp-1.9.0/src/activecollab_mcp/server.py +181 -0
  62. activecollab_mcp-1.9.0/src/activecollab_mcp/service.py +231 -0
  63. activecollab_mcp-1.9.0/src/activecollab_mcp/tools.py +2039 -0
  64. activecollab_mcp-1.9.0/src/activecollab_mcp/updater.py +600 -0
@@ -0,0 +1,45 @@
1
+ # ActiveCollab MCP — environment configuration
2
+ # Copy to .env and fill in the required values.
3
+
4
+ # --- Server ---
5
+ ACTIVECOLLAB_MCP_HOST=127.0.0.1
6
+ ACTIVECOLLAB_MCP_PORT=8787
7
+
8
+ # Log level: DEBUG, INFO, WARNING, ERROR
9
+ ACTIVECOLLAB_MCP_LOG_LEVEL=INFO
10
+
11
+ # Optional log file (in addition to stdout). Leave empty to disable.
12
+ # ACTIVECOLLAB_MCP_LOG_FILE=~/.activecollab-mcp/server.log
13
+
14
+ # --- ActiveCollab API ---
15
+ # Recommended: run `activecollab-mcp auth login` to exchange your
16
+ # email/password for an API token. Credentials are stored at
17
+ # ~/.activecollab-mcp/credentials.json (mode 0600).
18
+ #
19
+ # Only set the variables below if you prefer to manage credentials
20
+ # yourself (e.g. headless deployment, CI). When set, they override
21
+ # any value stored by `auth login`.
22
+ #
23
+ # Example: https://your-company.activecollab.com/api/v1
24
+ # Or root host: https://your-company.activecollab.com (with append_api_v1=true)
25
+ ACTIVECOLLAB_BASE_URL=
26
+ ACTIVECOLLAB_API_KEY=
27
+
28
+ # Defaults match standard ActiveCollab token auth.
29
+ ACTIVECOLLAB_AUTH_HEADER=X-Angie-AuthApiToken
30
+ ACTIVECOLLAB_AUTH_PREFIX=
31
+ ACTIVECOLLAB_APPEND_API_V1=true
32
+
33
+ # HTTP timeout in seconds
34
+ ACTIVECOLLAB_TIMEOUT_SECONDS=15
35
+
36
+ # Set true only when the ActiveCollab instance uses a self-signed cert.
37
+ ACTIVECOLLAB_ALLOW_SELF_SIGNED=false
38
+
39
+ # --- Tool behavior ---
40
+ # Enable write tools (create/update/delete tasks, post comments, log time).
41
+ # Set to false for a strictly read-only server.
42
+ ACTIVECOLLAB_ENABLE_WRITES=true
43
+
44
+ # Seconds to cache user/project lists used for name resolution. 0 disables.
45
+ ACTIVECOLLAB_NAME_CACHE_TTL=300
@@ -0,0 +1,31 @@
1
+ # Python
2
+ __pycache__/
3
+ *.py[cod]
4
+ *.egg-info/
5
+ *.egg
6
+ .eggs/
7
+ build/
8
+ dist/
9
+ .venv/
10
+ venv/
11
+ .python-version
12
+
13
+ # Tooling
14
+ .pytest_cache/
15
+ .ruff_cache/
16
+ .mypy_cache/
17
+
18
+ # Env
19
+ .env
20
+ .env.local
21
+
22
+ # Runtime
23
+ logs/
24
+ *.pid
25
+
26
+ # OS
27
+ .DS_Store
28
+
29
+ # Legacy JS (kept in archive/js for reference)
30
+ archive/js/node_modules/
31
+ archive/js/logs/
@@ -0,0 +1,13 @@
1
+ Copyright 2023 Vercel, Inc.
2
+
3
+ Licensed under the Apache License, Version 2.0 (the "License");
4
+ you may not use this file except in compliance with the License.
5
+ You may obtain a copy of the License at
6
+
7
+ http://www.apache.org/licenses/LICENSE-2.0
8
+
9
+ Unless required by applicable law or agreed to in writing, software
10
+ distributed under the License is distributed on an "AS IS" BASIS,
11
+ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12
+ See the License for the specific language governing permissions and
13
+ limitations under the License.
@@ -0,0 +1 @@
1
+ # AI SDK - Provider Language Model Specification
@@ -0,0 +1 @@
1
+ Platform specific binary for msgpackr-extract on darwin OS with arm64 architecture
@@ -0,0 +1,21 @@
1
+ MIT License
2
+
3
+ Copyright (c) 2024 Colin McDonnell
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.
@@ -0,0 +1,198 @@
1
+ <h1 align="center">
2
+ <img alt="Standard Schema fire logo" loading="lazy" width="50" height="50" decoding="async" data-nimg="1" style="color:transparent" src="https://standardschema.dev/favicon.svg">
3
+ </br>
4
+ Standard Schema</h1>
5
+ <p align="center">
6
+ A family of specs for interoperable TypeScript
7
+ <br/>
8
+ <a href="https://standardschema.dev">standardschema.dev</a>
9
+ </p>
10
+ <br/>
11
+
12
+ <!-- start -->
13
+
14
+ The Standard Schema project is a set of interfaces that standardize the provision and consumption of shared functionality in the TypeScript ecosystem.
15
+
16
+ Its goal is to allow tools to accept a single input that includes all the types and capabilities they need— no library-specific adapters, no extra dependencies. The result is an ecosystem that's fair for implementers, friendly for consumers, and open for end users.
17
+
18
+ ## The specifications
19
+
20
+ The specifications can be found below in their entirety. Libraries wishing to implement a spec can copy/paste the code block below into their codebase. They're also available at `@standard-schema/spec` on [npm](https://www.npmjs.com/package/@standard-schema/spec) and [JSR](https://jsr.io/@standard-schema/spec).
21
+
22
+ ```ts
23
+ // #########################
24
+ // ### Standard Typed ###
25
+ // #########################
26
+
27
+ /** The Standard Typed interface. This is a base type extended by other specs. */
28
+ export interface StandardTypedV1<Input = unknown, Output = Input> {
29
+ /** The Standard properties. */
30
+ readonly "~standard": StandardTypedV1.Props<Input, Output>;
31
+ }
32
+
33
+ export declare namespace StandardTypedV1 {
34
+ /** The Standard Typed properties interface. */
35
+ export interface Props<Input = unknown, Output = Input> {
36
+ /** The version number of the standard. */
37
+ readonly version: 1;
38
+ /** The vendor name of the schema library. */
39
+ readonly vendor: string;
40
+ /** Inferred types associated with the schema. */
41
+ readonly types?: Types<Input, Output> | undefined;
42
+ }
43
+
44
+ /** The Standard Typed types interface. */
45
+ export interface Types<Input = unknown, Output = Input> {
46
+ /** The input type of the schema. */
47
+ readonly input: Input;
48
+ /** The output type of the schema. */
49
+ readonly output: Output;
50
+ }
51
+
52
+ /** Infers the input type of a Standard Typed. */
53
+ export type InferInput<Schema extends StandardTypedV1> = NonNullable<
54
+ Schema["~standard"]["types"]
55
+ >["input"];
56
+
57
+ /** Infers the output type of a Standard Typed. */
58
+ export type InferOutput<Schema extends StandardTypedV1> = NonNullable<
59
+ Schema["~standard"]["types"]
60
+ >["output"];
61
+ }
62
+
63
+ // ##########################
64
+ // ### Standard Schema ###
65
+ // ##########################
66
+
67
+ /** The Standard Schema interface. */
68
+ export interface StandardSchemaV1<Input = unknown, Output = Input> {
69
+ /** The Standard Schema properties. */
70
+ readonly "~standard": StandardSchemaV1.Props<Input, Output>;
71
+ }
72
+
73
+ export declare namespace StandardSchemaV1 {
74
+ /** The Standard Schema properties interface. */
75
+ export interface Props<Input = unknown, Output = Input>
76
+ extends StandardTypedV1.Props<Input, Output> {
77
+ /** Validates unknown input values. */
78
+ readonly validate: (
79
+ value: unknown,
80
+ options?: StandardSchemaV1.Options | undefined
81
+ ) => Result<Output> | Promise<Result<Output>>;
82
+ }
83
+
84
+ /** The result interface of the validate function. */
85
+ export type Result<Output> = SuccessResult<Output> | FailureResult;
86
+
87
+ /** The result interface if validation succeeds. */
88
+ export interface SuccessResult<Output> {
89
+ /** The typed output value. */
90
+ readonly value: Output;
91
+ /** A falsy value for `issues` indicates success. */
92
+ readonly issues?: undefined;
93
+ }
94
+
95
+ export interface Options {
96
+ /** Explicit support for additional vendor-specific parameters, if needed. */
97
+ readonly libraryOptions?: Record<string, unknown> | undefined;
98
+ }
99
+
100
+ /** The result interface if validation fails. */
101
+ export interface FailureResult {
102
+ /** The issues of failed validation. */
103
+ readonly issues: ReadonlyArray<Issue>;
104
+ }
105
+
106
+ /** The issue interface of the failure output. */
107
+ export interface Issue {
108
+ /** The error message of the issue. */
109
+ readonly message: string;
110
+ /** The path of the issue, if any. */
111
+ readonly path?: ReadonlyArray<PropertyKey | PathSegment> | undefined;
112
+ }
113
+
114
+ /** The path segment interface of the issue. */
115
+ export interface PathSegment {
116
+ /** The key representing a path segment. */
117
+ readonly key: PropertyKey;
118
+ }
119
+
120
+ /** The Standard types interface. */
121
+ export interface Types<Input = unknown, Output = Input>
122
+ extends StandardTypedV1.Types<Input, Output> {}
123
+
124
+ /** Infers the input type of a Standard. */
125
+ export type InferInput<Schema extends StandardTypedV1> =
126
+ StandardTypedV1.InferInput<Schema>;
127
+
128
+ /** Infers the output type of a Standard. */
129
+ export type InferOutput<Schema extends StandardTypedV1> =
130
+ StandardTypedV1.InferOutput<Schema>;
131
+ }
132
+
133
+ // ###############################
134
+ // ### Standard JSON Schema ###
135
+ // ###############################
136
+
137
+ /** The Standard JSON Schema interface. */
138
+ export interface StandardJSONSchemaV1<Input = unknown, Output = Input> {
139
+ /** The Standard JSON Schema properties. */
140
+ readonly "~standard": StandardJSONSchemaV1.Props<Input, Output>;
141
+ }
142
+
143
+ export declare namespace StandardJSONSchemaV1 {
144
+ /** The Standard JSON Schema properties interface. */
145
+ export interface Props<Input = unknown, Output = Input>
146
+ extends StandardTypedV1.Props<Input, Output> {
147
+ /** Methods for generating the input/output JSON Schema. */
148
+ readonly jsonSchema: StandardJSONSchemaV1.Converter;
149
+ }
150
+
151
+ /** The Standard JSON Schema converter interface. */
152
+ export interface Converter {
153
+ /** Converts the input type to JSON Schema. May throw if conversion is not supported. */
154
+ readonly input: (
155
+ options: StandardJSONSchemaV1.Options
156
+ ) => Record<string, unknown>;
157
+ /** Converts the output type to JSON Schema. May throw if conversion is not supported. */
158
+ readonly output: (
159
+ options: StandardJSONSchemaV1.Options
160
+ ) => Record<string, unknown>;
161
+ }
162
+
163
+ /**
164
+ * The target version of the generated JSON Schema.
165
+ *
166
+ * It is *strongly recommended* that implementers support `"draft-2020-12"` and `"draft-07"`, as they are both in wide use. All other targets can be implemented on a best-effort basis. Libraries should throw if they don't support a specified target.
167
+ *
168
+ * The `"openapi-3.0"` target is intended as a standardized specifier for OpenAPI 3.0 which is a superset of JSON Schema `"draft-04"`.
169
+ */
170
+ export type Target =
171
+ | "draft-2020-12"
172
+ | "draft-07"
173
+ | "openapi-3.0"
174
+ // Accepts any string for future targets while preserving autocomplete
175
+ | ({} & string);
176
+
177
+ /** The options for the input/output methods. */
178
+ export interface Options {
179
+ /** Specifies the target version of the generated JSON Schema. Support for all versions is on a best-effort basis. If a given version is not supported, the library should throw. */
180
+ readonly target: Target;
181
+
182
+ /** Explicit support for additional vendor-specific parameters, if needed. */
183
+ readonly libraryOptions?: Record<string, unknown> | undefined;
184
+ }
185
+
186
+ /** The Standard types interface. */
187
+ export interface Types<Input = unknown, Output = Input>
188
+ extends StandardTypedV1.Types<Input, Output> {}
189
+
190
+ /** Infers the input type of a Standard. */
191
+ export type InferInput<Schema extends StandardTypedV1> =
192
+ StandardTypedV1.InferInput<Schema>;
193
+
194
+ /** Infers the output type of a Standard. */
195
+ export type InferOutput<Schema extends StandardTypedV1> =
196
+ StandardTypedV1.InferOutput<Schema>;
197
+ }
198
+ ```
@@ -0,0 +1,21 @@
1
+ The MIT License (MIT)
2
+
3
+ Copyright (c) 2018 Made With MOXY Lda <hello@moxy.studio>
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
13
+ all 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
21
+ THE SOFTWARE.
@@ -0,0 +1,89 @@
1
+ # cross-spawn
2
+
3
+ [![NPM version][npm-image]][npm-url] [![Downloads][downloads-image]][npm-url] [![Build Status][ci-image]][ci-url] [![Build status][appveyor-image]][appveyor-url]
4
+
5
+ [npm-url]:https://npmjs.org/package/cross-spawn
6
+ [downloads-image]:https://img.shields.io/npm/dm/cross-spawn.svg
7
+ [npm-image]:https://img.shields.io/npm/v/cross-spawn.svg
8
+ [ci-url]:https://github.com/moxystudio/node-cross-spawn/actions/workflows/ci.yaml
9
+ [ci-image]:https://github.com/moxystudio/node-cross-spawn/actions/workflows/ci.yaml/badge.svg
10
+ [appveyor-url]:https://ci.appveyor.com/project/satazor/node-cross-spawn
11
+ [appveyor-image]:https://img.shields.io/appveyor/ci/satazor/node-cross-spawn/master.svg
12
+
13
+ A cross platform solution to node's spawn and spawnSync.
14
+
15
+ ## Installation
16
+
17
+ Node.js version 8 and up:
18
+ `$ npm install cross-spawn`
19
+
20
+ Node.js version 7 and under:
21
+ `$ npm install cross-spawn@6`
22
+
23
+ ## Why
24
+
25
+ Node has issues when using spawn on Windows:
26
+
27
+ - It ignores [PATHEXT](https://github.com/joyent/node/issues/2318)
28
+ - It does not support [shebangs](https://en.wikipedia.org/wiki/Shebang_(Unix))
29
+ - Has problems running commands with [spaces](https://github.com/nodejs/node/issues/7367)
30
+ - Has problems running commands with posix relative paths (e.g.: `./my-folder/my-executable`)
31
+ - Has an [issue](https://github.com/moxystudio/node-cross-spawn/issues/82) with command shims (files in `node_modules/.bin/`), where arguments with quotes and parenthesis would result in [invalid syntax error](https://github.com/moxystudio/node-cross-spawn/blob/e77b8f22a416db46b6196767bcd35601d7e11d54/test/index.test.js#L149)
32
+ - No `options.shell` support on node `<v4.8`
33
+
34
+ All these issues are handled correctly by `cross-spawn`.
35
+ There are some known modules, such as [win-spawn](https://github.com/ForbesLindesay/win-spawn), that try to solve this but they are either broken or provide faulty escaping of shell arguments.
36
+
37
+
38
+ ## Usage
39
+
40
+ Exactly the same way as node's [`spawn`](https://nodejs.org/api/child_process.html#child_process_child_process_spawn_command_args_options) or [`spawnSync`](https://nodejs.org/api/child_process.html#child_process_child_process_spawnsync_command_args_options), so it's a drop in replacement.
41
+
42
+
43
+ ```js
44
+ const spawn = require('cross-spawn');
45
+
46
+ // Spawn NPM asynchronously
47
+ const child = spawn('npm', ['list', '-g', '-depth', '0'], { stdio: 'inherit' });
48
+
49
+ // Spawn NPM synchronously
50
+ const result = spawn.sync('npm', ['list', '-g', '-depth', '0'], { stdio: 'inherit' });
51
+ ```
52
+
53
+
54
+ ## Caveats
55
+
56
+ ### Using `options.shell` as an alternative to `cross-spawn`
57
+
58
+ Starting from node `v4.8`, `spawn` has a `shell` option that allows you run commands from within a shell. This new option solves
59
+ the [PATHEXT](https://github.com/joyent/node/issues/2318) issue but:
60
+
61
+ - It's not supported in node `<v4.8`
62
+ - You must manually escape the command and arguments which is very error prone, specially when passing user input
63
+ - There are a lot of other unresolved issues from the [Why](#why) section that you must take into account
64
+
65
+ If you are using the `shell` option to spawn a command in a cross platform way, consider using `cross-spawn` instead. You have been warned.
66
+
67
+ ### `options.shell` support
68
+
69
+ While `cross-spawn` adds support for `options.shell` in node `<v4.8`, all of its enhancements are disabled.
70
+
71
+ This mimics the Node.js behavior. More specifically, the command and its arguments will not be automatically escaped nor shebang support will be offered. This is by design because if you are using `options.shell` you are probably targeting a specific platform anyway and you don't want things to get into your way.
72
+
73
+ ### Shebangs support
74
+
75
+ While `cross-spawn` handles shebangs on Windows, its support is limited. More specifically, it just supports `#!/usr/bin/env <program>` where `<program>` must not contain any arguments.
76
+ If you would like to have the shebang support improved, feel free to contribute via a pull-request.
77
+
78
+ Remember to always test your code on Windows!
79
+
80
+
81
+ ## Tests
82
+
83
+ `$ npm test`
84
+ `$ npm test -- --watch` during development
85
+
86
+
87
+ ## License
88
+
89
+ Released under the [MIT License](https://www.opensource.org/licenses/mit-license.php).
@@ -0,0 +1,201 @@
1
+ Apache License
2
+ Version 2.0, January 2004
3
+ http://www.apache.org/licenses/
4
+
5
+ TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION
6
+
7
+ 1. Definitions.
8
+
9
+ "License" shall mean the terms and conditions for use, reproduction,
10
+ and distribution as defined by Sections 1 through 9 of this document.
11
+
12
+ "Licensor" shall mean the copyright owner or entity authorized by
13
+ the copyright owner that is granting the License.
14
+
15
+ "Legal Entity" shall mean the union of the acting entity and all
16
+ other entities that control, are controlled by, or are under common
17
+ control with that entity. For the purposes of this definition,
18
+ "control" means (i) the power, direct or indirect, to cause the
19
+ direction or management of such entity, whether by contract or
20
+ otherwise, or (ii) ownership of fifty percent (50%) or more of the
21
+ outstanding shares, or (iii) beneficial ownership of such entity.
22
+
23
+ "You" (or "Your") shall mean an individual or Legal Entity
24
+ exercising permissions granted by this License.
25
+
26
+ "Source" form shall mean the preferred form for making modifications,
27
+ including but not limited to software source code, documentation
28
+ source, and configuration files.
29
+
30
+ "Object" form shall mean any form resulting from mechanical
31
+ transformation or translation of a Source form, including but
32
+ not limited to compiled object code, generated documentation,
33
+ and conversions to other media types.
34
+
35
+ "Work" shall mean the work of authorship, whether in Source or
36
+ Object form, made available under the License, as indicated by a
37
+ copyright notice that is included in or attached to the work
38
+ (an example is provided in the Appendix below).
39
+
40
+ "Derivative Works" shall mean any work, whether in Source or Object
41
+ form, that is based on (or derived from) the Work and for which the
42
+ editorial revisions, annotations, elaborations, or other modifications
43
+ represent, as a whole, an original work of authorship. For the purposes
44
+ of this License, Derivative Works shall not include works that remain
45
+ separable from, or merely link (or bind by name) to the interfaces of,
46
+ the Work and Derivative Works thereof.
47
+
48
+ "Contribution" shall mean any work of authorship, including
49
+ the original version of the Work and any modifications or additions
50
+ to that Work or Derivative Works thereof, that is intentionally
51
+ submitted to Licensor for inclusion in the Work by the copyright owner
52
+ or by an individual or Legal Entity authorized to submit on behalf of
53
+ the copyright owner. For the purposes of this definition, "submitted"
54
+ means any form of electronic, verbal, or written communication sent
55
+ to the Licensor or its representatives, including but not limited to
56
+ communication on electronic mailing lists, source code control systems,
57
+ and issue tracking systems that are managed by, or on behalf of, the
58
+ Licensor for the purpose of discussing and improving the Work, but
59
+ excluding communication that is conspicuously marked or otherwise
60
+ designated in writing by the copyright owner as "Not a Contribution."
61
+
62
+ "Contributor" shall mean Licensor and any individual or Legal Entity
63
+ on behalf of whom a Contribution has been received by Licensor and
64
+ subsequently incorporated within the Work.
65
+
66
+ 2. Grant of Copyright License. Subject to the terms and conditions of
67
+ this License, each Contributor hereby grants to You a perpetual,
68
+ worldwide, non-exclusive, no-charge, royalty-free, irrevocable
69
+ copyright license to reproduce, prepare Derivative Works of,
70
+ publicly display, publicly perform, sublicense, and distribute the
71
+ Work and such Derivative Works in Source or Object form.
72
+
73
+ 3. Grant of Patent License. Subject to the terms and conditions of
74
+ this License, each Contributor hereby grants to You a perpetual,
75
+ worldwide, non-exclusive, no-charge, royalty-free, irrevocable
76
+ (except as stated in this section) patent license to make, have made,
77
+ use, offer to sell, sell, import, and otherwise transfer the Work,
78
+ where such license applies only to those patent claims licensable
79
+ by such Contributor that are necessarily infringed by their
80
+ Contribution(s) alone or by combination of their Contribution(s)
81
+ with the Work to which such Contribution(s) was submitted. If You
82
+ institute patent litigation against any entity (including a
83
+ cross-claim or counterclaim in a lawsuit) alleging that the Work
84
+ or a Contribution incorporated within the Work constitutes direct
85
+ or contributory patent infringement, then any patent licenses
86
+ granted to You under this License for that Work shall terminate
87
+ as of the date such litigation is filed.
88
+
89
+ 4. Redistribution. You may reproduce and distribute copies of the
90
+ Work or Derivative Works thereof in any medium, with or without
91
+ modifications, and in Source or Object form, provided that You
92
+ meet the following conditions:
93
+
94
+ (a) You must give any other recipients of the Work or
95
+ Derivative Works a copy of this License; and
96
+
97
+ (b) You must cause any modified files to carry prominent notices
98
+ stating that You changed the files; and
99
+
100
+ (c) You must retain, in the Source form of any Derivative Works
101
+ that You distribute, all copyright, patent, trademark, and
102
+ attribution notices from the Source form of the Work,
103
+ excluding those notices that do not pertain to any part of
104
+ the Derivative Works; and
105
+
106
+ (d) If the Work includes a "NOTICE" text file as part of its
107
+ distribution, then any Derivative Works that You distribute must
108
+ include a readable copy of the attribution notices contained
109
+ within such NOTICE file, excluding those notices that do not
110
+ pertain to any part of the Derivative Works, in at least one
111
+ of the following places: within a NOTICE text file distributed
112
+ as part of the Derivative Works; within the Source form or
113
+ documentation, if provided along with the Derivative Works; or,
114
+ within a display generated by the Derivative Works, if and
115
+ wherever such third-party notices normally appear. The contents
116
+ of the NOTICE file are for informational purposes only and
117
+ do not modify the License. You may add Your own attribution
118
+ notices within Derivative Works that You distribute, alongside
119
+ or as an addendum to the NOTICE text from the Work, provided
120
+ that such additional attribution notices cannot be construed
121
+ as modifying the License.
122
+
123
+ You may add Your own copyright statement to Your modifications and
124
+ may provide additional or different license terms and conditions
125
+ for use, reproduction, or distribution of Your modifications, or
126
+ for any such Derivative Works as a whole, provided Your use,
127
+ reproduction, and distribution of the Work otherwise complies with
128
+ the conditions stated in this License.
129
+
130
+ 5. Submission of Contributions. Unless You explicitly state otherwise,
131
+ any Contribution intentionally submitted for inclusion in the Work
132
+ by You to the Licensor shall be under the terms and conditions of
133
+ this License, without any additional terms or conditions.
134
+ Notwithstanding the above, nothing herein shall supersede or modify
135
+ the terms of any separate license agreement you may have executed
136
+ with Licensor regarding such Contributions.
137
+
138
+ 6. Trademarks. This License does not grant permission to use the trade
139
+ names, trademarks, service marks, or product names of the Licensor,
140
+ except as required for reasonable and customary use in describing the
141
+ origin of the Work and reproducing the content of the NOTICE file.
142
+
143
+ 7. Disclaimer of Warranty. Unless required by applicable law or
144
+ agreed to in writing, Licensor provides the Work (and each
145
+ Contributor provides its Contributions) on an "AS IS" BASIS,
146
+ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
147
+ implied, including, without limitation, any warranties or conditions
148
+ of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A
149
+ PARTICULAR PURPOSE. You are solely responsible for determining the
150
+ appropriateness of using or redistributing the Work and assume any
151
+ risks associated with Your exercise of permissions under this License.
152
+
153
+ 8. Limitation of Liability. In no event and under no legal theory,
154
+ whether in tort (including negligence), contract, or otherwise,
155
+ unless required by applicable law (such as deliberate and grossly
156
+ negligent acts) or agreed to in writing, shall any Contributor be
157
+ liable to You for damages, including any direct, indirect, special,
158
+ incidental, or consequential damages of any character arising as a
159
+ result of this License or out of the use or inability to use the
160
+ Work (including but not limited to damages for loss of goodwill,
161
+ work stoppage, computer failure or malfunction, or any and all
162
+ other commercial damages or losses), even if such Contributor
163
+ has been advised of the possibility of such damages.
164
+
165
+ 9. Accepting Warranty or Additional Liability. While redistributing
166
+ the Work or Derivative Works thereof, You may choose to offer,
167
+ and charge a fee for, acceptance of support, warranty, indemnity,
168
+ or other liability obligations and/or rights consistent with this
169
+ License. However, in accepting such obligations, You may act only
170
+ on Your own behalf and on Your sole responsibility, not on behalf
171
+ of any other Contributor, and only if You agree to indemnify,
172
+ defend, and hold each Contributor harmless for any liability
173
+ incurred by, or claims asserted against, such Contributor by reason
174
+ of your accepting any such warranty or additional liability.
175
+
176
+ END OF TERMS AND CONDITIONS
177
+
178
+ APPENDIX: How to apply the Apache License to your work.
179
+
180
+ To apply the Apache License to your work, attach the following
181
+ boilerplate notice, with the fields enclosed by brackets "{}"
182
+ replaced with your own identifying information. (Don't include
183
+ the brackets!) The text should be enclosed in the appropriate
184
+ comment syntax for the file format. We also recommend that a
185
+ file or class name and description of purpose be included on the
186
+ same "printed page" as the copyright notice for easier
187
+ identification within third-party archives.
188
+
189
+ Copyright {yyyy} {name of copyright owner}
190
+
191
+ Licensed under the Apache License, Version 2.0 (the "License");
192
+ you may not use this file except in compliance with the License.
193
+ You may obtain a copy of the License at
194
+
195
+ http://www.apache.org/licenses/LICENSE-2.0
196
+
197
+ Unless required by applicable law or agreed to in writing, software
198
+ distributed under the License is distributed on an "AS IS" BASIS,
199
+ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
200
+ See the License for the specific language governing permissions and
201
+ limitations under the License.