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
Copy file name to clipboardExpand all lines: packages/tools/README.md
+8-5Lines changed: 8 additions & 5 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -28,14 +28,12 @@ const result = await executors.flyTo(viewer, rawArgsFromTheModel);
28
28
This package has no logging of its own by default — every executor just resolves a plain `{ success, error? }` result, so a caller that never reads `error` never finds out a tool call failed. Pass a `logger` as `createCesiumToolExecutors`'s second argument to have every executor's outcome (success, a resolved `{ error }`, or a thrown rejection) reported through it:
Pass any `Logger` from `@cesium-ai/observability` (e.g. one backed by your app's OTEL telemetry) to route logging through your own provider.
36
+
Implement your own `ToolsLogger` (e.g. backed by an OTEL-wired app logger — see this repo's `frontend/src/tools/cesium-tool-executors.ts` for the worked example) to route this package's logging through your own telemetry instead of `console`.
39
37
40
38
## Customizing a tool: two mechanisms
41
39
@@ -167,6 +165,7 @@ Executors are grouped by domain rather than one file per tool (unlike `@cesium-a
167
165
-[`src/utils/cesium-values.ts`](https://github.com/CesiumGS/cesiumjs-ai-starter-app/blob/main/packages/tools/src/utils/cesium-values.ts) — small conversions from schema-shaped plain data (a `{longitude, latitude, height?}` position, a CSS color string) into real Cesium types (`Cartesian3`, `Color`, ...).
168
166
-[`src/utils/animation-registry.ts`](https://github.com/CesiumGS/cesiumjs-ai-starter-app/blob/main/packages/tools/src/utils/animation-registry.ts), [`src/utils/imagery-registry.ts`](https://github.com/CesiumGS/cesiumjs-ai-starter-app/blob/main/packages/tools/src/utils/imagery-registry.ts) — per-`Viewer``WeakMap`-based bookkeeping the animation and imagery tools need (which entity ids/imagery layers this package itself created), so `animationListActive`/`imageryList`/etc. only ever report on state they created.
169
167
-[`src/utils/create-entity-add-executor.ts`](https://github.com/CesiumGS/cesiumjs-ai-starter-app/blob/main/packages/tools/src/utils/create-entity-add-executor.ts) — `createEntityAddExecutor`, the generic validate/build/add/error-handling plumbing every `entityAdd*` tool's own `createXExecutor` (in `entities.ts`) is built from.
168
+
-[`src/logger.ts`](https://github.com/CesiumGS/cesiumjs-ai-starter-app/blob/main/packages/tools/src/logger.ts) — `ToolsLogger`, `noopToolsLogger`, `createConsoleToolsLogger` — see "Logging" above.
@@ -190,3 +189,7 @@ Executors are grouped by domain rather than one file per tool (unlike `@cesium-a
190
189
|`createEntityAddExecutor`| The lower-level generic every `createEntityAddXExecutor` above is built from — only needed if you're building a brand-new `entityAdd*`-shaped tool from scratch. |
191
190
|`EntityAddExecutorConfig`| Type: an `entityAdd*` factory's config (`shape`, `extendEntityOptions`). |
192
191
|`flyTo`, `cameraSetView`, ... | Every individual default executor, exported by name (one per tool). |
192
+
|`ToolsLogger`| Type: the console-shaped logger interface (`debug`/`info`/`warn`/`error`) `createCesiumToolExecutors`'s `logger` argument accepts. See "Logging" above. |
|`createConsoleToolsLogger`| Builds a `console`-backed `ToolsLogger`, prefixed `[cesium-tools]`, filtered by level (default `"warn"`). |
195
+
|`noopToolsLogger`| A `ToolsLogger` whose methods are all no-ops — pass explicitly if you want `createCesiumToolExecutors`'s wrapping without any actual output. |
0 commit comments