iit-mcp-autotask 0.5.0 → 0.7.0

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 (77) hide show
  1. package/.env.example +39 -15
  2. package/README.md +316 -126
  3. package/capabilities.json +210 -482
  4. package/dist/config.d.ts +46 -27
  5. package/dist/config.js +136 -50
  6. package/dist/http-guard.d.ts +57 -0
  7. package/dist/http-guard.js +134 -0
  8. package/dist/http.d.ts +9 -6
  9. package/dist/http.js +72 -25
  10. package/dist/main.js +44 -5
  11. package/dist/mocks/fixture-ops.d.ts +2 -0
  12. package/dist/mocks/fixture-ops.js +2 -0
  13. package/dist/mocks/harness.d.ts +28 -7
  14. package/dist/mocks/harness.js +69 -71
  15. package/dist/policy.d.ts +21 -44
  16. package/dist/policy.js +38 -97
  17. package/dist/stdio.d.ts +2 -1
  18. package/dist/stdio.js +2 -2
  19. package/dist/tools/capabilities-manifest.d.ts +4 -0
  20. package/dist/tools/capabilities-manifest.js +89 -0
  21. package/dist/tools/catalog-data.d.ts +14 -69
  22. package/dist/tools/catalog-data.js +77 -276
  23. package/dist/tools/composites.d.ts +23 -19
  24. package/dist/tools/composites.js +139 -327
  25. package/dist/tools/context.d.ts +27 -6
  26. package/dist/tools/context.js +7 -4
  27. package/dist/tools/dispatch.d.ts +54 -42
  28. package/dist/tools/dispatch.js +168 -204
  29. package/dist/tools/guide.d.ts +30 -0
  30. package/dist/tools/guide.js +97 -0
  31. package/dist/tools/lists.d.ts +2 -30
  32. package/dist/tools/lists.js +100 -157
  33. package/dist/tools/meta.d.ts +11 -24
  34. package/dist/tools/meta.js +222 -327
  35. package/dist/tools/output-file.d.ts +7 -7
  36. package/dist/tools/output-file.js +34 -13
  37. package/dist/tools/profitability-window.d.ts +26 -0
  38. package/dist/tools/profitability-window.js +40 -0
  39. package/dist/tools/rank.d.ts +15 -0
  40. package/dist/tools/rank.js +59 -0
  41. package/dist/tools/reasons.d.ts +34 -0
  42. package/dist/tools/reasons.js +98 -0
  43. package/dist/tools/register.d.ts +16 -25
  44. package/dist/tools/register.js +39 -34
  45. package/dist/tools/resolves.d.ts +6 -21
  46. package/dist/tools/resolves.js +173 -119
  47. package/dist/tools/results.d.ts +105 -13
  48. package/dist/tools/results.js +311 -71
  49. package/dist/tools/schemas.d.ts +245 -447
  50. package/dist/tools/schemas.js +202 -918
  51. package/dist/tools/server.d.ts +39 -18
  52. package/dist/tools/server.js +65 -74
  53. package/dist/tools/surface.d.ts +33 -0
  54. package/dist/tools/surface.js +36 -0
  55. package/dist/tools/write.d.ts +30 -0
  56. package/dist/tools/write.js +744 -0
  57. package/dist/write/canonical.d.ts +4 -0
  58. package/dist/write/canonical.js +30 -0
  59. package/dist/write/evaluate.d.ts +61 -0
  60. package/dist/write/evaluate.js +97 -0
  61. package/dist/write/hard-rules.d.ts +37 -0
  62. package/dist/write/hard-rules.js +72 -0
  63. package/dist/write/policy-file.d.ts +78 -0
  64. package/dist/write/policy-file.js +112 -0
  65. package/dist/write/runtime.d.ts +33 -0
  66. package/dist/write/runtime.js +55 -0
  67. package/dist/write/store.d.ts +187 -0
  68. package/dist/write/store.js +629 -0
  69. package/examples/policy.time-entries.json +47 -0
  70. package/package.json +9 -3
  71. package/server.json +40 -5
  72. package/skills/company-360.md +62 -0
  73. package/skills/contract-profitability.md +62 -0
  74. package/skills/invoice-export.md +61 -0
  75. package/skills/log-time-entry.md +77 -0
  76. package/skills/ticket-triage.md +63 -0
  77. package/skills/unbilled-work-review.md +64 -0
package/.env.example CHANGED
@@ -21,6 +21,7 @@
21
21
  # in the X-Autotask-* headers injected by the gateway.
22
22
 
23
23
  # stdio (local: Claude Code / Claude Desktop / VS Code) or http (remote MCP clients / gateway).
24
+ # The CLI defaults to http on 127.0.0.1; local clients pass --transport stdio (or set this).
24
25
  MCP_TRANSPORT=stdio
25
26
 
26
27
  # --- Credentials (stdio: required from the environment; http: optional discouraged defaults) ---
@@ -47,21 +48,26 @@ MCP_TRANSPORT=stdio
47
48
  # AUTOTASK_ALLOWED_BASE_HOSTS=*.autotask.net
48
49
  # AUTOTASK_ALLOW_ANY_BASE_HOST=false
49
50
 
50
- # --- Mutation surface (opt-in; reads are never affected) ---
51
- # Omit all mutation tools entirely. Set false before enabling a write policy.
52
- AUTOTASK_READ_ONLY=true
53
- # deny (default — forgetting this yields a read-only server, never an open one) | allow_list | all
54
- # (must be typed out deliberately).
55
- AUTOTASK_WRITE_POLICY=deny
56
- # Only under allow_list: comma-separated registry operation keys (e.g. time_entries.create).
57
- # Must be non-empty and every key must exist in the SDK registry and be a write, or boot fails
58
- # with the variable named. Ignored under deny/all.
59
- # AUTOTASK_WRITE_ALLOW=time_entries.create
60
-
61
- # --- Secret reads (independent of the write policy) ---
62
- # deny (default) refuses authenticate.get, which returns a plaintext vendor token that the SDK's
63
- # redaction deliberately exempts. allow permits it; the token is still never logged.
64
- AUTOTASK_SECRET_READS=deny
51
+ # --- Profile and toolsets (0.6.0) ---
52
+ # readonly (default): reads only, no state. operator: adds autotask_write (preview) and
53
+ # autotask_apply (execute the previewed plan), governed by a policy file; needs the four below.
54
+ AUTOTASK_PROFILE=readonly
55
+ # operator: the write policy (closed JSON schema, default deny; see examples/policy.time-entries.json).
56
+ # AUTOTASK_POLICY_FILE=/etc/autotask-mcp/policy.json
57
+ # operator: the state dir (mode 0700; plans, ledger, audit log, lock; one process per dir).
58
+ # AUTOTASK_STATE_DIR=/var/lib/autotask-mcp
59
+ # operator on stdio: the run scope (required), {"companyIds":[...]} or {"all":true} (= the policy's
60
+ # own scope). It only narrows the policy. On HTTP set runScope per token instead.
61
+ # AUTOTASK_RUN_SCOPE={"companyIds":[12345]}
62
+ # operator on stdio: the principal plans and the audit log are bound to (default stdio).
63
+ # AUTOTASK_PRINCIPAL=nightly-time-entries
64
+ # The kill file: while it exists every preview and apply is denied (default <state dir>/KILL).
65
+ # AUTOTASK_KILL_FILE=/var/lib/autotask-mcp/KILL
66
+ # Optional toolsets on top of core (core is always on): a comma list of service, records, finance,
67
+ # or all. An unknown name fails boot. Unset = core only (10 tools).
68
+ # AUTOTASK_TOOLSETS=service,records,finance
69
+ # Removed in 0.6.0 (boot fails if set): AUTOTASK_READ_ONLY, AUTOTASK_WRITE_POLICY, AUTOTASK_WRITE_ALLOW,
70
+ # AUTOTASK_SECRET_READS. authenticate.* (a credential-minting read) is always refused.
65
71
 
66
72
  # --- Per-tenant read cache (in-process; never cross-tenant; never on disk) ---
67
73
  # on (default): each pooled tenant client applies the SDK reference TTL table (structural ~1 h /
@@ -82,6 +88,24 @@ AUTOTASK_CACHE_PRESET=on
82
88
  # symlink escape is refused BEFORE anything is created. See README, Query results.
83
89
  # AUTOTASK_OUTPUT_DIR=/srv/autotask-output
84
90
 
91
+ # --- HTTP hardening (http transport only) ---
92
+ # Bind address (the --host flag): 127.0.0.1 by default. Off loopback, the two settings below are
93
+ # required or boot fails.
94
+ # MCP_HOST=127.0.0.1
95
+ # Host header values /mcp accepts (comma-separated hostnames; DNS-rebinding defence).
96
+ # AUTOTASK_HTTP_ALLOWED_HOSTS=mcp.example.com
97
+ # Browser Origin hostnames /mcp accepts (a request without an Origin always passes).
98
+ # AUTOTASK_HTTP_ALLOWED_ORIGINS=
99
+ # Caller auth: gateway (the gateway in front authenticates and rate-limits callers) or tokens
100
+ # (this process checks bearer tokens and rate-limits per principal). tokens is required for the
101
+ # operator profile on HTTP and when this process holds Autotask credentials on HTTP.
102
+ # AUTOTASK_HTTP_AUTH=gateway
103
+ # tokens mode: a JSON file mapping the lowercase hex SHA-256 of each token to
104
+ # { "principal": "...", "profile": "readonly"|"operator", "toolsets"?: [...], "runScope"?: {...} }.
105
+ # Every operator token needs a runScope ({"companyIds":[...]} or {"all":true}).
106
+ # AUTOTASK_HTTP_TOKENS_FILE=/run/secrets/autotask-mcp-tokens.json
107
+ # AUTOTASK_HTTP_RATE_PER_MIN=60
108
+
85
109
  # --- Operational ---
86
110
  PORT=8080
87
111
  LOG_LEVEL=info