You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Commit 159042a
Browse filesBrowse the repository at this point in the historyBrowse files
feat(spec): ConnectorProviderContext.resolvePackagePath, a host-provided package anchor
ConnectorProviderContext gains one optional, host-provided member,
resolvePackagePath(relativePath), beside loadPackageFile. It resolves a
relative path against the declaring stack/package root, returns the root
for '.', and refuses an empty, absolute or root-escaping path.
service-automation's materializer hands it to every provider factory,
anchored at packageRoot (default process.cwd()), and both members now
share one confinement check (resolveInsidePackageRoot) so they cannot
disagree. loadPackageFile's behaviour and error strings are unchanged.
Claude-Session: https://claude.ai/code/session_01VZqqwTj2wsihZEbfT6yyYN
Co-authored-by: Claude <noreply@anthropic.com>
feat(spec): `ConnectorProviderContext.resolvePackagePath` — a connector provider factory can resolve a path against the declaring app's root
7
+
8
+
Clause-②: yes (widening)
9
+
10
+
-**What is new.**`ConnectorProviderContext` gains one optional, host-provided member, `resolvePackagePath(relativePath): Promise<string>`, beside `loadPackageFile`. It resolves a relative path against the root of the stack or package that declared the connector entry and returns the absolute path. `'.'` returns the root itself. It refuses (throws on) an empty path, an absolute path, and a path that escapes the root after resolution, such as `../x` or `a/../../x`. That is the same rule `loadPackageFile` follows. It reads nothing and does not check that the path exists.
11
+
-**Who hands it.** The connector materializer in `@objectstack/service-automation` hands it to every provider factory. It is anchored at the plugin's `packageRoot` option, the same root `loadPackageFile` reads under, and falls back to `process.cwd()` the same way. The two members now share one confinement check, so they cannot disagree about what is inside the root. `loadPackageFile`'s behaviour and error messages are unchanged.
12
+
-**Who reads it.** Nothing yet. `@objectstack/connector-mcp` is next: a declarative stdio transport will use it as the launched process's working directory, so a relative command or argument resolves against the app's root instead of the directory the server was started from.
13
+
-**What does not change.** Which commands a declarative stdio transport may launch is untouched. A factory that does not read the member behaves as before.
14
+
-**Nothing to migrate.** A host that builds its own `ConnectorProviderContext` may leave the member out. A factory must then keep its existing behaviour, or fail with a clear message if it needs the root.
0 commit comments