@intentius/chant-lexicon-aws 0.44.10 → 0.44.13
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/dist/agentcore/trace-fetch.d.ts +332 -0
- package/dist/agentcore/trace-fetch.d.ts.map +1 -0
- package/dist/agentcore/trace-render.d.ts +256 -0
- package/dist/agentcore/trace-render.d.ts.map +1 -0
- package/dist/api/read-client.d.ts +16 -0
- package/dist/api/read-client.d.ts.map +1 -1
- package/dist/identity-observe.d.ts.map +1 -1
- package/dist/integrity.json +2 -2
- package/dist/manifest.json +1 -1
- package/dist/op/activities/index.d.ts +10 -0
- package/dist/op/activities/index.d.ts.map +1 -1
- package/package.json +2 -2
- package/src/agentcore/trace-fetch.test.ts +588 -0
- package/src/agentcore/trace-fetch.ts +754 -0
- package/src/agentcore/trace-render.test.ts +366 -0
- package/src/agentcore/trace-render.ts +589 -0
- package/src/api/read-client.ts +7 -1
- package/src/identity-observe.test.ts +44 -2
- package/src/identity-observe.ts +25 -2
- package/src/op/activities/index.ts +15 -0
package/src/identity-observe.ts
CHANGED
|
@@ -22,7 +22,7 @@
|
|
|
22
22
|
* `create` the moment the emulator lacks Cloud Control.
|
|
23
23
|
*/
|
|
24
24
|
import { createRequire } from "module";
|
|
25
|
-
import { getResource, type AwsReadClientOptions } from "./api/read-client";
|
|
25
|
+
import { AwsReadError, getResource, listResources, type AwsReadClientOptions, type CloudControlDescription } from "./api/read-client";
|
|
26
26
|
import type { ResourceMetadata } from "@intentius/chant/lexicon";
|
|
27
27
|
|
|
28
28
|
const require = createRequire(import.meta.url);
|
|
@@ -63,6 +63,29 @@ export function declaredIdentifier(entityType: string, props: Record<string, unk
|
|
|
63
63
|
return values.join("|");
|
|
64
64
|
}
|
|
65
65
|
|
|
66
|
+
/**
|
|
67
|
+
* `GetResource`, with a `ListResources` + identifier-match fallback when the
|
|
68
|
+
* endpoint says the operation itself is unsupported. That is Floci's exact
|
|
69
|
+
* answer (read-client's own note) while it serves `ListResources` fine — and
|
|
70
|
+
* an emulator is exactly where the carve state lives, so without this leg the
|
|
71
|
+
* fallback proves itself everywhere except the one place the walkthrough
|
|
72
|
+
* films it. Every other refusal propagates: the caller decides what a failed
|
|
73
|
+
* refinement means.
|
|
74
|
+
*/
|
|
75
|
+
async function readByIdentity(
|
|
76
|
+
typeName: string,
|
|
77
|
+
identifier: string,
|
|
78
|
+
client: AwsReadClientOptions,
|
|
79
|
+
): Promise<CloudControlDescription | null> {
|
|
80
|
+
try {
|
|
81
|
+
return await getResource(typeName, identifier, client);
|
|
82
|
+
} catch (err) {
|
|
83
|
+
if (!(err instanceof AwsReadError) || err.code !== "UnsupportedOperation") throw err;
|
|
84
|
+
const listed = await listResources(typeName, client);
|
|
85
|
+
return listed.find((d) => d.identifier === identifier) ?? null;
|
|
86
|
+
}
|
|
87
|
+
}
|
|
88
|
+
|
|
66
89
|
/** The same scrub the stack-output path applies, on live property KEYS. */
|
|
67
90
|
function redactSensitive(properties: Record<string, unknown>): Record<string, unknown> | undefined {
|
|
68
91
|
const out: Record<string, unknown> = {};
|
|
@@ -95,7 +118,7 @@ export async function observeByIdentity(
|
|
|
95
118
|
if (!identifier) continue;
|
|
96
119
|
queried[name] = `cloudcontrol:GetResource:${entity.entityType}:${identifier}`;
|
|
97
120
|
try {
|
|
98
|
-
const found = await
|
|
121
|
+
const found = await readByIdentity(entity.entityType, identifier, client);
|
|
99
122
|
if (!found) continue;
|
|
100
123
|
resources[name] = {
|
|
101
124
|
type: entity.entityType,
|
|
@@ -4,6 +4,14 @@
|
|
|
4
4
|
* emulator lifecycle (`flociUp`/`flociDown`) and the native CloudFormation
|
|
5
5
|
* applier (`awsApply`), which calls the CloudFormation API directly rather than
|
|
6
6
|
* shelling `aws` — the direct twin of `azApply`/`gcpApply`.
|
|
7
|
+
*
|
|
8
|
+
* The registry keys every exported *function* here by its name, so only the
|
|
9
|
+
* activities themselves belong in this barrel. `awsAgentCoreFetchTrace`'s
|
|
10
|
+
* helpers — the normalizer, the JSON coercion, the `ListEvents` walk — stay
|
|
11
|
+
* importable from `@intentius/chant-lexicon-aws/agentcore/trace-fetch` rather
|
|
12
|
+
* than being registered as activities nobody would ever name in a step, and the
|
|
13
|
+
* pure renderer lives one module further out again, in
|
|
14
|
+
* `@intentius/chant-lexicon-aws/agentcore/trace-render`.
|
|
7
15
|
*/
|
|
8
16
|
export {
|
|
9
17
|
flociUp,
|
|
@@ -35,3 +43,10 @@ export {
|
|
|
35
43
|
isTerminalStatus,
|
|
36
44
|
} from "./aws-apply";
|
|
37
45
|
export type { AwsApplyArgs, AwsHttp } from "./aws-apply";
|
|
46
|
+
|
|
47
|
+
export { awsAgentCoreFetchTrace } from "../../agentcore/trace-fetch";
|
|
48
|
+
export type {
|
|
49
|
+
AgentCoreTraceSource,
|
|
50
|
+
AwsAgentCoreFetchTraceArgs,
|
|
51
|
+
AwsAgentCoreFetchTraceResult,
|
|
52
|
+
} from "../../agentcore/trace-fetch";
|