iit-mcp-autotask 0.66.1 → 0.66.2
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/.env.example +1 -1
- package/README.md +24 -3
- package/dist/config/schema.js +1 -1
- package/dist/tools/context/client.d.ts +11 -0
- package/dist/tools/context/client.js +14 -1
- package/dist/tools/meta.js +19 -1
- package/dist/tools/write/outcome.d.ts +3 -6
- package/dist/tools/write/outcome.js +30 -17
- package/dist/write/store/types.d.ts +2 -2
- package/dist/write/store.js +6 -1
- package/package.json +2 -2
- package/server.json +2 -2
package/.env.example
CHANGED
|
@@ -97,7 +97,7 @@ AUTOTASK_CACHE=on
|
|
|
97
97
|
# 3 active requests and shares a conservative origin-wide 10,000-attempt hourly ceiling
|
|
98
98
|
# in this JavaScript runtime. Other processes and integrations need separate coordination.
|
|
99
99
|
# AUTOTASK_RATE_LIMIT_PER_HOUR=8000
|
|
100
|
-
# AUTOTASK_MAX_CONCURRENT=
|
|
100
|
+
# AUTOTASK_MAX_CONCURRENT=2
|
|
101
101
|
# AUTOTASK_TIMEOUT_MS=20000
|
|
102
102
|
# AUTOTASK_MAX_RETRIES=1
|
|
103
103
|
|
package/README.md
CHANGED
|
@@ -575,7 +575,7 @@ non-zero on an invalid config (fail-fast) instead of failing at the first tool c
|
|
|
575
575
|
| `AUTOTASK_OUTPUT_DIR` | no | unset | the ONE directory the `output_path` option may write into (the bounded query tools and the invoice export; stdio transport only). Unset = defaults to `output/` under `AUTOTASK_STATE_DIR` (the feature refuses when neither is set); must be absolute, must already EXIST (the server never creates the root) and must not be the filesystem root. A caller path is relative to this root, and the root and target are canonically resolved (`realpath`) so a traversal or symlink escape is refused — with nothing created outside the root. See [Query results](#query-results-tsv-output_path-and-the-saved-file-shape) |
|
|
576
576
|
| `AUTOTASK_QUERY_MAX_BYTES` | no | 262144 (256 KiB) | the `autotask_query` rows-mode response budget in bytes (16384 to 4194304): a larger answer is cut to the longest whole-row prefix that fits, with `hasMore` and `bytesCapped` (see [Query results](#query-results-tsv-output_path-and-the-saved-file-shape)); totals, `output_path` and `autotask_read` are not capped |
|
|
577
577
|
| `AUTOTASK_RATE_LIMIT_PER_HOUR` | no | 8000 (agent profile) | override the SDK's local hourly allowance (at most 10,000; `null`/off is rejected at boot); the shared SDK origin ceiling remains enforced |
|
|
578
|
-
| `AUTOTASK_MAX_CONCURRENT` | no |
|
|
578
|
+
| `AUTOTASK_MAX_CONCURRENT` | no | 2 | local aggregate concurrency across objects (1–10). The default is one below the vendor's three simultaneous requests per object endpoint and API user, leaving one thread of headroom; 3 is an explicit opt-in. The SDK still caps each object/tracking identifier at three active requests. See [Several users and sessions](#several-users-and-sessions) |
|
|
579
579
|
| `AUTOTASK_TIMEOUT_MS` | no | 20000 (agent profile) | whole-call budget |
|
|
580
580
|
| `AUTOTASK_MAX_RETRIES` | no | 1 (agent profile) | bounded retries with backoff (idempotent methods, 429/5xx only) |
|
|
581
581
|
| `MCP_HOST` | no | `127.0.0.1` | http bind address (`--host` overrides it). Off loopback, `AUTOTASK_HTTP_ALLOWED_HOSTS` and `AUTOTASK_HTTP_AUTH` are required |
|
|
@@ -756,6 +756,27 @@ impersonation-scope `403` evicts the exact pooled client. On organizational-reso
|
|
|
756
756
|
daily-availability, or registered metadata reads, a `401` or an impersonated `403` also
|
|
757
757
|
clears that identity's SDK read and metadata caches. A `403` classified by the SDK as maintenance uses the maintenance path.
|
|
758
758
|
|
|
759
|
+
## Several users and sessions
|
|
760
|
+
|
|
761
|
+
The vendor allows three simultaneous requests per object endpoint for each API user, counted across every process
|
|
762
|
+
and integration on that API user. The SDK's limiter covers one server process only, so each stdio process you start
|
|
763
|
+
has its own limiter and N processes can together hold 3 x N threads on one object (the Autotask "thread threshold
|
|
764
|
+
exceeded" alert, #408). Within one process the local cap applies per client identity (credentials, base URL and
|
|
765
|
+
impersonation id), and the SDK shares one gate of three per object across those identities, so several people on one
|
|
766
|
+
integration code through separate impersonation ids can still reach three together.
|
|
767
|
+
|
|
768
|
+
- **Preferred: one Autotask API user per person and per long-running automation.** Sharing one API user across
|
|
769
|
+
people, sessions or agents makes breaches likely whatever the client-side throttling.
|
|
770
|
+
- Separate API users do not change attribution: each can still impersonate the same resource
|
|
771
|
+
(`AUTOTASK_IMPERSONATION_RESOURCE_ID`) where the vendor's permissions allow, so a user per API account
|
|
772
|
+
limits nothing about who a write is recorded against.
|
|
773
|
+
- If one API user must be shared (several MCP processes on one machine), keep `AUTOTASK_MAX_CONCURRENT` below 3
|
|
774
|
+
(the server default is 2; use 1 while several sessions are active) and limit the number of concurrent clients.
|
|
775
|
+
Close idle or orphaned stdio processes.
|
|
776
|
+
- `autotask_tenant_status` (part `server`) reports `concurrency`: this process's effective cap, the per-object
|
|
777
|
+
vendor limit and, on the operator profile, how many server processes are registered in the shared state dir (a killed peer stays counted until the next boot sweeps it), with a
|
|
778
|
+
warning when there is more than one. The server also logs a warning at boot when it finds live peers.
|
|
779
|
+
|
|
759
780
|
## Per-tenant pool & cache
|
|
760
781
|
|
|
761
782
|
The stateless default is amended by one **user-approved deviation** (user-approved 2026-10-06;
|
|
@@ -923,8 +944,8 @@ bodies at 1 MiB. With `AUTOTASK_HTTP_AUTH=tokens` this process authenticates cal
|
|
|
923
944
|
rate-limits per principal itself. The vendor allows three simultaneous requests per object endpoint
|
|
924
945
|
and tracking identifier, and 10,000 requests per trailing hour across the database's integrations.
|
|
925
946
|
The SDK enforces shared object admission and a conservative origin-wide hourly ceiling across its
|
|
926
|
-
clients in this JavaScript runtime; its agent profile adds a lower per-client allowance (8,000/hr
|
|
927
|
-
|
|
947
|
+
clients in this JavaScript runtime; its agent profile adds a lower per-client allowance (8,000/hr);
|
|
948
|
+
this server lowers the concurrent-across-objects default to two per client identity (credentials, base URL and impersonation id) for headroom. Tenants on the same zone origin share that hourly ceiling, so
|
|
928
949
|
one tenant's traffic can reduce another tenant's available allowance; tenants sharing an integration
|
|
929
950
|
code also share object slots. `autotask_tenant_status` exposes vendor thresholds and the local
|
|
930
951
|
client budget; that local snapshot is not the shared hourly counter. Other processes, workers and
|
package/dist/config/schema.js
CHANGED
|
@@ -210,7 +210,7 @@ export const CONFIG_FIELDS = z
|
|
|
210
210
|
* allowance. The SDK separately enforces its shared origin ceiling.
|
|
211
211
|
*/
|
|
212
212
|
AUTOTASK_RATE_LIMIT_PER_HOUR: z.coerce.number().int().min(1).max(VENDOR_HOURLY_CAP).optional(),
|
|
213
|
-
/** Local aggregate concurrency across objects (
|
|
213
|
+
/** Local aggregate concurrency across objects (server default 2, one below the vendor's 3 per object; 3 is an explicit opt-in); SDK object/tracking admission stays capped at 3. */
|
|
214
214
|
AUTOTASK_MAX_CONCURRENT: z.coerce.number().int().min(1).max(10).optional(),
|
|
215
215
|
/** The whole-call deadline in ms. The `agent` profile default is 20,000. */
|
|
216
216
|
AUTOTASK_TIMEOUT_MS: z.coerce.number().int().positive().optional(),
|
|
@@ -7,6 +7,17 @@ export declare const PLACEHOLDER_ORIGIN = "https://no-autotask-origin.invalid";
|
|
|
7
7
|
export declare const PLACEHOLDER_BASE_URL = "https://no-autotask-origin.invalid/atservicesrest";
|
|
8
8
|
/** Sentinel credential values a placeholder client is constructed with (never real, never dialled). */
|
|
9
9
|
export declare const SENTINEL_CREDENTIAL = "unresolved-request-scope";
|
|
10
|
+
/**
|
|
11
|
+
* The default local aggregate concurrency (#408). The vendor allows three simultaneous requests per object endpoint
|
|
12
|
+
* and API user, and the SDK's shared object gate admits exactly three: a cap equal to the vendor limit leaves no
|
|
13
|
+
* margin for another process on the same API user or for the vendor releasing a thread late. Two keeps one thread
|
|
14
|
+
* of headroom per object; `AUTOTASK_MAX_CONCURRENT` overrides it (3 is an explicit opt-in).
|
|
15
|
+
*/
|
|
16
|
+
export declare const DEFAULT_MAX_CONCURRENT = 2;
|
|
17
|
+
/** The vendor's simultaneous-request limit per object endpoint and API user (the SDK's shared object gate cap). */
|
|
18
|
+
export declare const VENDOR_OBJECT_THREAD_LIMIT = 3;
|
|
19
|
+
/** The effective local aggregate concurrency: the env override, else {@link DEFAULT_MAX_CONCURRENT}. */
|
|
20
|
+
export declare function effectiveMaxConcurrent(config: Config): number;
|
|
10
21
|
/**
|
|
11
22
|
* The deployment-wide SDK options every client this factory builds gets (the agent profile +
|
|
12
23
|
* the env overrides + the cache off switch + the zero maintenance wait + the literal-IP host
|
|
@@ -31,6 +31,19 @@ function auditErrorCode(code, operation, status) {
|
|
|
31
31
|
}
|
|
32
32
|
return code === 'MAINTENANCE' ? code : statusBasedVendorCode(operation, status) ?? code;
|
|
33
33
|
}
|
|
34
|
+
/**
|
|
35
|
+
* The default local aggregate concurrency (#408). The vendor allows three simultaneous requests per object endpoint
|
|
36
|
+
* and API user, and the SDK's shared object gate admits exactly three: a cap equal to the vendor limit leaves no
|
|
37
|
+
* margin for another process on the same API user or for the vendor releasing a thread late. Two keeps one thread
|
|
38
|
+
* of headroom per object; `AUTOTASK_MAX_CONCURRENT` overrides it (3 is an explicit opt-in).
|
|
39
|
+
*/
|
|
40
|
+
export const DEFAULT_MAX_CONCURRENT = 2;
|
|
41
|
+
/** The vendor's simultaneous-request limit per object endpoint and API user (the SDK's shared object gate cap). */
|
|
42
|
+
export const VENDOR_OBJECT_THREAD_LIMIT = 3;
|
|
43
|
+
/** The effective local aggregate concurrency: the env override, else {@link DEFAULT_MAX_CONCURRENT}. */
|
|
44
|
+
export function effectiveMaxConcurrent(config) {
|
|
45
|
+
return config.AUTOTASK_MAX_CONCURRENT ?? DEFAULT_MAX_CONCURRENT;
|
|
46
|
+
}
|
|
34
47
|
/**
|
|
35
48
|
* The deployment-wide SDK options every client this factory builds gets (the agent profile +
|
|
36
49
|
* the env overrides + the cache off switch + the zero maintenance wait + the literal-IP host
|
|
@@ -55,7 +68,7 @@ export function buildSdkBaseOptions(config, log) {
|
|
|
55
68
|
// the server.
|
|
56
69
|
maintenanceMaxWaitMs: 0,
|
|
57
70
|
...(config.AUTOTASK_RATE_LIMIT_PER_HOUR !== undefined ? { rateLimit: { perHour: config.AUTOTASK_RATE_LIMIT_PER_HOUR } } : {}),
|
|
58
|
-
|
|
71
|
+
maxConcurrent: effectiveMaxConcurrent(config),
|
|
59
72
|
...(config.AUTOTASK_TIMEOUT_MS !== undefined ? { timeoutMs: config.AUTOTASK_TIMEOUT_MS } : {}),
|
|
60
73
|
...(config.AUTOTASK_MAX_RETRIES !== undefined ? { maxRetries: config.AUTOTASK_MAX_RETRIES } : {}),
|
|
61
74
|
// The literal-IP SSRF floor: a LITERAL private/loopback origin is refused at construction
|
package/dist/tools/meta.js
CHANGED
|
@@ -26,6 +26,7 @@ import { isDirectIdentity, releaseClientOnError } from './context/derive.js';
|
|
|
26
26
|
import {} from './context/types.js';
|
|
27
27
|
import { abortedAnswer, FIELD_CATALOG_MAX_BYTES, InputInvalidError, readOneItem, requestSecrets } from './dispatch.js';
|
|
28
28
|
import { zoneClock } from './clock.js';
|
|
29
|
+
import { effectiveMaxConcurrent, VENDOR_OBJECT_THREAD_LIMIT } from './context/client.js';
|
|
29
30
|
import { isShapeOnlyVendorOperation, typedErrorPayload } from './results/errors.js';
|
|
30
31
|
import { markResult, sanitiseVendorOutput, UNTRUSTED_TEXT_CAP } from './results/untrusted.js';
|
|
31
32
|
import { errorEnvelope, ok, TRUNCATION_MARKER } from './results/envelope.js';
|
|
@@ -857,6 +858,23 @@ const STATUS_OPS = {
|
|
|
857
858
|
version: 'version.get',
|
|
858
859
|
thresholds: 'threshold_information.get',
|
|
859
860
|
};
|
|
861
|
+
/**
|
|
862
|
+
* The thread-headroom facts (#408), zero wire: this process's effective local cap, the vendor's per-object limit, and,
|
|
863
|
+
* on the operator profile, how many server processes are registered in the shared state dir (a killed peer stays counted until the next boot sweeps it) (the vendor counts every
|
|
864
|
+
* process on one API user together, and no process can see the others' requests).
|
|
865
|
+
*/
|
|
866
|
+
function concurrencyFacts(ctx) {
|
|
867
|
+
const maxConcurrent = effectiveMaxConcurrent(ctx.config);
|
|
868
|
+
const processes = ctx.write?.runtime.store.lockInfo().holders;
|
|
869
|
+
return {
|
|
870
|
+
maxConcurrent,
|
|
871
|
+
objectThreadLimit: VENDOR_OBJECT_THREAD_LIMIT,
|
|
872
|
+
...(processes === undefined ? {} : { processesOnStateDir: processes }),
|
|
873
|
+
...(processes !== undefined && processes > 1
|
|
874
|
+
? { warning: `${processes} server processes are registered on this state dir: each keeps its own limiter, so together they can exceed the vendor's ${VENDOR_OBJECT_THREAD_LIMIT} threads per object on one API user. Use one API user per person or automation, or lower AUTOTASK_MAX_CONCURRENT. A killed process stays counted until the next boot sweeps it.` }
|
|
875
|
+
: {}),
|
|
876
|
+
};
|
|
877
|
+
}
|
|
860
878
|
/** `autotask_tenant_status`: identity / version / thresholds / server / time; each part degrades to typed absent. */
|
|
861
879
|
export function buildTenantStatus(ctx) {
|
|
862
880
|
return {
|
|
@@ -874,7 +892,7 @@ export function buildTenantStatus(ctx) {
|
|
|
874
892
|
// late failure cannot outlive this request, and assemble only in requested order.
|
|
875
893
|
const settled = await Promise.allSettled(parts.map(async (part) => {
|
|
876
894
|
if (part === 'server') {
|
|
877
|
-
return { value: { name: SERVER_NAME, version: SERVER_VERSION, sdkVersion: SDK_VERSION, profile: ctx.config.AUTOTASK_PROFILE, redactPersonalData: ctx.config.AUTOTASK_REDACT_PERSONAL_DATA, ticketNoteVerificationProjection: TICKET_NOTE_VERIFICATION_PROJECTION, readRuntime: readRuntimeProof(ctx.client) } };
|
|
895
|
+
return { value: { name: SERVER_NAME, version: SERVER_VERSION, sdkVersion: SDK_VERSION, profile: ctx.config.AUTOTASK_PROFILE, redactPersonalData: ctx.config.AUTOTASK_REDACT_PERSONAL_DATA, ticketNoteVerificationProjection: TICKET_NOTE_VERIFICATION_PROJECTION, readRuntime: readRuntimeProof(ctx.client), concurrency: concurrencyFacts(ctx) } };
|
|
878
896
|
}
|
|
879
897
|
if (part === 'time')
|
|
880
898
|
return { value: zoneClock(ctx.config.AUTOTASK_USER_TIMEZONE) };
|
|
@@ -12,13 +12,10 @@ import { type LedgerEntry, type PlanRecord } from '../../write/store.js';
|
|
|
12
12
|
* advice never depends on how the payload was built.
|
|
13
13
|
*/
|
|
14
14
|
export declare function honestError(payload: Record<string, unknown>, entry: LedgerEntry, secrets: readonly string[]): Record<string, unknown>;
|
|
15
|
-
|
|
16
|
-
export declare const VENDOR_MESSAGE_CAP = 300;
|
|
15
|
+
export declare const REFUSAL_ERROR_CAP = 200;
|
|
17
16
|
/**
|
|
18
|
-
* The vendor's
|
|
19
|
-
*
|
|
20
|
-
* request secrets scrubbed (#464: a value split by an invisible character is caught whole), whitespace
|
|
21
|
-
* collapsed to one line, capped at {@link VENDOR_MESSAGE_CAP}.
|
|
17
|
+
* The vendor's refusal text, as a failed ledger line keeps it so a later investigation or replay can say
|
|
18
|
+
* why the write was refused (untrusted vendor text, see {@link refusalText}).
|
|
22
19
|
*/
|
|
23
20
|
export declare function vendorRefusal(err: unknown, secrets: readonly string[]): string | undefined;
|
|
24
21
|
/** The envelope of an update whose HTTP write succeeded but whose stored record lacks some sent fields (issue #103). */
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { COOLDOWN_MINUTES } from '../../write/store.js';
|
|
2
2
|
import { answer, applyToolFor, reason } from './common.js';
|
|
3
|
-
import { isShapeOnlyVendorOperation,
|
|
4
|
-
import { cleanUntrustedText } from '../results/untrusted.js';
|
|
3
|
+
import { isShapeOnlyVendorOperation, scrubSecrets } from '../results/errors.js';
|
|
4
|
+
import { cleanUntrustedText, stripUnsafeChars } from '../results/untrusted.js';
|
|
5
5
|
// ---------------------------------------------------------------------------
|
|
6
6
|
// autotask_apply: the execution
|
|
7
7
|
// ---------------------------------------------------------------------------
|
|
@@ -20,30 +20,43 @@ export function honestError(payload, entry, secrets) {
|
|
|
20
20
|
return { ...payload, nextAction: 'retry' };
|
|
21
21
|
if (entry.state === 'unknown')
|
|
22
22
|
return { ...payload, retryable: false, nextAction: 'stop', suggestedAction: 'The write may have landed: read the record to verify; do not re-send.' };
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
23
|
+
// The text the ledger line recorded, so the fresh answer and the replay are the same string by construction (#468). The
|
|
24
|
+
// typed payload has already cut a long vendor message to a `[TRUNCATED n]` stub, so it only serves a refusal nothing was recorded for.
|
|
25
|
+
const said = entry.outcome?.vendorMessage ?? refusalText(payload.vendorError?.errors, secrets);
|
|
26
|
+
return { ...payload, retryable: false, nextAction: 'stop', suggestedAction: refusedAction(said) };
|
|
26
27
|
}
|
|
27
28
|
/** The nested error's advice for a definite refusal, naming the vendor's text when there is any. */
|
|
28
29
|
function refusedAction(said) {
|
|
29
30
|
const text = said.trim();
|
|
30
31
|
return text !== '' ? `The vendor refused: ${text}${/[.!?]$/.test(text) ? '' : '.'} Fix the input; do not retry.` : 'Fix the input; do not retry.';
|
|
31
32
|
}
|
|
32
|
-
/** The
|
|
33
|
-
|
|
33
|
+
/** The refusal text keeps this many vendor errors, each cut at {@link REFUSAL_ERROR_CAP} characters (#468). */
|
|
34
|
+
const REFUSAL_ERRORS = 3;
|
|
35
|
+
export const REFUSAL_ERROR_CAP = 200;
|
|
34
36
|
/**
|
|
35
|
-
* The
|
|
36
|
-
*
|
|
37
|
-
*
|
|
38
|
-
*
|
|
37
|
+
* The one bounded, scrubbed refusal text: the first {@link REFUSAL_ERRORS} non-blank vendor errors[] strings,
|
|
38
|
+
* each stripped of unsafe characters, collapsed to one line, scrubbed of the request secrets (the secrets
|
|
39
|
+
* collapsed the same way, so an echo with altered whitespace is still caught, #468) and capped (with the
|
|
40
|
+
* truncation marker, never inside a surrogate pair), joined with
|
|
41
|
+
* `; `. Both the fresh answer (`honestError`) and the ledger line a replay reads (`vendorRefusal`) use it,
|
|
42
|
+
* so the two give the same advice. Empty when the vendor said nothing usable.
|
|
43
|
+
*/
|
|
44
|
+
function refusalText(errors, secrets) {
|
|
45
|
+
if (!Array.isArray(errors))
|
|
46
|
+
return '';
|
|
47
|
+
const flat = (v) => stripUnsafeChars(v).replace(/\s+/g, ' ').trim();
|
|
48
|
+
const known = [...secrets, ...secrets.map(flat)];
|
|
49
|
+
return errors.filter((e) => typeof e === 'string')
|
|
50
|
+
.map((e) => cleanUntrustedText(scrubSecrets(flat(e), known), true, REFUSAL_ERROR_CAP))
|
|
51
|
+
.filter((e) => e !== '').slice(0, REFUSAL_ERRORS).join('; ');
|
|
52
|
+
}
|
|
53
|
+
/**
|
|
54
|
+
* The vendor's refusal text, as a failed ledger line keeps it so a later investigation or replay can say
|
|
55
|
+
* why the write was refused (untrusted vendor text, see {@link refusalText}).
|
|
39
56
|
*/
|
|
40
57
|
export function vendorRefusal(err, secrets) {
|
|
41
|
-
const
|
|
42
|
-
|
|
43
|
-
if (first === undefined)
|
|
44
|
-
return undefined;
|
|
45
|
-
const text = stripThenScrub(first, secrets).replace(/\s+/g, ' ').trim();
|
|
46
|
-
return text === '' ? undefined : cleanUntrustedText(text, true, VENDOR_MESSAGE_CAP);
|
|
58
|
+
const text = refusalText(err?.vendorError?.errors, secrets);
|
|
59
|
+
return text === '' ? undefined : text;
|
|
47
60
|
}
|
|
48
61
|
/** The envelope of an update whose HTTP write succeeded but whose stored record lacks some sent fields (issue #103). */
|
|
49
62
|
export function notPersistedAnswer(plan, entry, fields, extra) {
|
|
@@ -47,8 +47,8 @@ export interface LedgerOutcome {
|
|
|
47
47
|
/** FIELD_NOT_PERSISTED (issue #103): the field names the vendor did not apply (names only, never values). */
|
|
48
48
|
fields?: string[];
|
|
49
49
|
/**
|
|
50
|
-
* A definite (failed, not retryable) refusal only: the vendor's first errors[]
|
|
51
|
-
* text with secrets scrubbed
|
|
50
|
+
* A definite (failed, not retryable) refusal only: the vendor's first three errors[] messages joined, untrusted
|
|
51
|
+
* text (each capped) with secrets scrubbed and unsafe characters stripped (`vendorRefusal`). Absent on
|
|
52
52
|
* success, unknown and retryable outcomes, and on ledger lines written before it existed.
|
|
53
53
|
*/
|
|
54
54
|
vendorMessage?: string;
|
package/dist/write/store.js
CHANGED
|
@@ -72,7 +72,7 @@ import { join } from 'node:path';
|
|
|
72
72
|
import { canonicalJson } from './canonical.js';
|
|
73
73
|
import { OP_LOCK_WAIT_MS } from './store/constants.js';
|
|
74
74
|
import { LOOSE_MODE, refuse, stateKey, handle } from './store/files.js';
|
|
75
|
-
import { registerHolder, releaseHolder, sweepHolders, takeLock } from './store/lock.js';
|
|
75
|
+
import { holderCount, registerHolder, releaseHolder, sweepHolders, takeLock } from './store/lock.js';
|
|
76
76
|
import { createOpLock } from './store/op-lock.js';
|
|
77
77
|
import { createAuditLog } from './store/audit-log.js';
|
|
78
78
|
import { bootRewrite, createLedger } from './store/ledger.js';
|
|
@@ -103,6 +103,11 @@ export function openStateStore(dir, opts) {
|
|
|
103
103
|
let killWatch = undefined;
|
|
104
104
|
try {
|
|
105
105
|
sweepHolders(holdersDir, log, now);
|
|
106
|
+
// #408: every live peer on this state dir has its own limiter, and the vendor counts them together
|
|
107
|
+
// (3 threads per object and API user), so a second process makes a thread-threshold breach likely.
|
|
108
|
+
const peers = holderCount(holdersDir) - 1;
|
|
109
|
+
if (peers > 0)
|
|
110
|
+
log.warn('other server processes share this state dir: each keeps its own request limiter, so together they can exceed the vendor thread limit per object; use one API user per person or automation, or lower AUTOTASK_MAX_CONCURRENT', { peers });
|
|
106
111
|
// ---- the primary lock: taken over when its holder is dead, kept (and this process boots as a
|
|
107
112
|
// secondary under it) when its holder is live (issue #68) ----
|
|
108
113
|
const lockPath = join(dir, 'lock');
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "iit-mcp-autotask",
|
|
3
|
-
"version": "0.66.
|
|
3
|
+
"version": "0.66.2",
|
|
4
4
|
"description": "MCP server for the Autotask (Datto) PSA domain, built on the node-autotask SDK",
|
|
5
5
|
"license": "MIT",
|
|
6
6
|
"author": "Max Soukhomlinov",
|
|
@@ -54,7 +54,7 @@
|
|
|
54
54
|
},
|
|
55
55
|
"dependencies": {
|
|
56
56
|
"@modelcontextprotocol/server": "^2.2.0",
|
|
57
|
-
"node-autotask": "0.116.
|
|
57
|
+
"node-autotask": "0.116.2",
|
|
58
58
|
"zod": "^4.6.7"
|
|
59
59
|
},
|
|
60
60
|
"devDependencies": {
|
package/server.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "iit-mcp-autotask",
|
|
3
|
-
"version": "0.66.
|
|
3
|
+
"version": "0.66.2",
|
|
4
4
|
"description": "MCP server for the Autotask (Datto) PSA API, powered by the node-autotask SDK",
|
|
5
5
|
"mcpProtocolBaseline": "2026-07-28",
|
|
6
6
|
"legacyProtocolFallback": "2025-11-25",
|
|
@@ -62,7 +62,7 @@
|
|
|
62
62
|
"capabilitiesManifest": "capabilities.json",
|
|
63
63
|
"sdk": {
|
|
64
64
|
"package": "node-autotask",
|
|
65
|
-
"versionRange": "0.116.
|
|
65
|
+
"versionRange": "0.116.2"
|
|
66
66
|
},
|
|
67
67
|
"vendorExtensions": false,
|
|
68
68
|
"credentialModelNote": "per-request; server-held under stdio or, on HTTP, only behind AUTOTASK_HTTP_AUTH=tokens; operator plans and the ledger are keyed by principal and tenant id, never by credential, and an apply authenticates the request credential and restores the plan's per-write impersonation"
|